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_FOLDER_APPLESCRIPT_H_
      6 #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_FOLDER_APPLESCRIPT_H_
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 #import "chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.h"
     11 
     12 @class BookmarkItemAppleScript;
     13 
     14 // Represent a bookmark folder scriptable object in applescript.
     15 @interface BookmarkFolderAppleScript : BookmarkNodeAppleScript {
     16 
     17 }
     18 
     19 // Bookmark folder manipulation methods.
     20 // Returns an array of |BookmarkFolderAppleScript*| of all the bookmark folders
     21 // contained within this particular folder.
     22 - (NSArray*)bookmarkFolders;
     23 
     24 // Inserts a bookmark folder at the end.
     25 - (void)insertInBookmarkFolders:(id)aBookmarkFolder;
     26 
     27 // Inserts a bookmark folder at some position in the list.
     28 // Called by applescript which takes care of bounds checking, make sure of it
     29 // before calling directly.
     30 - (void)insertInBookmarkFolders:(id)aBookmarkFolder atIndex:(int)index;
     31 
     32 // Remove a bookmark folder from the list.
     33 // Called by applescript which takes care of bounds checking, make sure of it
     34 // before calling directly.
     35 - (void)removeFromBookmarkFoldersAtIndex:(int)index;
     36 
     37 // Bookmark item manipulation methods.
     38 // Returns an array of |BookmarkItemAppleScript*| of all the bookmark items
     39 // contained within this particular folder.
     40 - (NSArray*)bookmarkItems;
     41 
     42 // Inserts a bookmark item at the end.
     43 - (void)insertInBookmarkItems:(BookmarkItemAppleScript*)aBookmarkItem;
     44 
     45 // Inserts a bookmark item at some position in the list.
     46 // Called by applescript which takes care of bounds checking, make sure of it
     47 // before calling directly.
     48 - (void)insertInBookmarkItems:(BookmarkItemAppleScript*)aBookmarkItem
     49                       atIndex:(int)index;
     50 
     51 // Removes a bookmarks folder from the list.
     52 // Called by applescript which takes care of bounds checking, make sure of it
     53 // before calling directly.
     54 - (void)removeFromBookmarkItemsAtIndex:(int)index;
     55 
     56 // Returns the position of a bookmark folder within the current bookmark folder
     57 // which consists of bookmark folders as well as bookmark items.
     58 // AppleScript makes sure that there is a bookmark folder before calling this
     59 // method, make sure of that before calling directly.
     60 - (int)calculatePositionOfBookmarkFolderAt:(int)index;
     61 
     62 // Returns the position of a bookmark item within the current bookmark folder
     63 // which consists of bookmark folders as well as bookmark items.
     64 // AppleScript makes sure that there is a bookmark item before calling this
     65 // method, make sure of that before calling directly.
     66 - (int)calculatePositionOfBookmarkItemAt:(int)index;
     67 
     68 @end
     69 
     70 #endif  // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_BOOKMARK_FOLDER_APPLESCRIPT_H_
     71