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