Home | History | Annotate | Download | only in applescript
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_NODE_APPLESCRIPT_H_
      6 #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_NODE_APPLESCRIPT_H_
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 #import "chrome/browser/ui/cocoa/applescript/element_applescript.h"
     11 
     12 class BookmarkModel;
     13 class BookmarkNode;
     14 
     15 // Contains all the elements that are common to both a bookmark folder and
     16 // bookmark item.
     17 @interface BookmarkNodeAppleScript : ElementAppleScript {
     18  @protected
     19   const BookmarkNode* bookmarkNode_;  // weak.
     20   // Contains the temporary title when a scripter creates a new folder/item with
     21   // title specified like
     22   // |make new bookmark folder with properties {title:"foo"}|.
     23   NSString* tempTitle_;
     24 }
     25 
     26 // Does not actually create a folder/item but just sets its ID, the folder is
     27 // created in insertInBookmarksFolder: in the corresponding bookmarks folder.
     28 - (id)init;
     29 
     30 // Does not make a folder/item but instead uses an existing one.
     31 - (id)initWithBookmarkNode:(const BookmarkNode*)aBookmarkNode;
     32 
     33 // Assigns a node, sets its unique ID and also copies temporary values.
     34 - (void)setBookmarkNode:(const BookmarkNode*)aBookmarkNode;
     35 
     36 // Get and Set title.
     37 - (NSString*)title;
     38 - (void)setTitle:(NSString*)aTitle;
     39 
     40 // Returns the index with respect to its parent bookmark folder.
     41 - (NSNumber*)index;
     42 
     43 // Returns the bookmark model of the browser, returns NULL if there is an error.
     44 - (BookmarkModel*)bookmarkModel;
     45 
     46 @end
     47 
     48 #endif  // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_NODE_APPLESCRIPT_H_
     49