OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
7 | 7 |
8 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 8 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
9 | 9 |
10 class BookmarkNode; | 10 class BookmarkNode; |
(...skipping 23 matching lines...) Expand all Loading... |
34 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; | 34 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; |
35 @property(nonatomic, readwrite, assign) int startingChildIndex; | 35 @property(nonatomic, readwrite, assign) int startingChildIndex; |
36 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; | 36 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; |
37 | 37 |
38 // Create a button cell which draws with a theme. | 38 // Create a button cell which draws with a theme. |
39 + (id)buttonCellForNode:(const BookmarkNode*)node | 39 + (id)buttonCellForNode:(const BookmarkNode*)node |
40 contextMenu:(NSMenu*)contextMenu | 40 contextMenu:(NSMenu*)contextMenu |
41 cellText:(NSString*)cellText | 41 cellText:(NSString*)cellText |
42 cellImage:(NSImage*)cellImage; | 42 cellImage:(NSImage*)cellImage; |
43 | 43 |
| 44 // Create a button cell not attached to any node which draws with a theme. |
| 45 + (id)buttonCellForContextMenu:(NSMenu*)contextMenu |
| 46 cellText:(NSString*)cellText |
| 47 cellImage:(NSImage*)cellImage; |
| 48 |
44 // Initialize a button cell which draws with a theme. | 49 // Initialize a button cell which draws with a theme. |
45 // Designated initializer. | 50 // Designated initializer. |
46 - (id)initForNode:(const BookmarkNode*)node | 51 - (id)initForNode:(const BookmarkNode*)node |
47 contextMenu:(NSMenu*)contextMenu | 52 contextMenu:(NSMenu*)contextMenu |
48 cellText:(NSString*)cellText | 53 cellText:(NSString*)cellText |
49 cellImage:(NSImage*)cellImage; | 54 cellImage:(NSImage*)cellImage; |
50 | 55 |
51 - (BOOL)empty; // returns YES if empty. | 56 // Initialize a button cell not attached to any node which draws with a theme. |
| 57 - (id)initForContextMenu:(NSMenu*)contextMenu |
| 58 cellText:(NSString*)cellText |
| 59 cellImage:(NSImage*)cellImage; |
| 60 |
| 61 // A button cell is considered empty if it is expected to be attached to a node |
| 62 // and this node is NULL. If the button was created with |
| 63 // buttonCellForContextMenu then no node is expecte and empty is always NO. |
| 64 - (BOOL)empty; |
52 - (void)setEmpty:(BOOL)empty; | 65 - (void)setEmpty:(BOOL)empty; |
53 | 66 |
54 // |-setBookmarkCellText:image:| is used to set the text and image of | 67 // |-setBookmarkCellText:image:| is used to set the text and image of |
55 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) | 68 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) |
56 // if there is text in the title, and centered (NSImageCenter) if | 69 // if there is text in the title, and centered (NSImageCenter) if |
57 // there is not. If |title| is nil, do not reset the title. | 70 // there is not. If |title| is nil, do not reset the title. |
58 - (void)setBookmarkCellText:(NSString*)title | 71 - (void)setBookmarkCellText:(NSString*)title |
59 image:(NSImage*)image; | 72 image:(NSImage*)image; |
60 | 73 |
61 // Set the color of text in this cell. | 74 // Set the color of text in this cell. |
62 - (void)setTextColor:(NSColor*)color; | 75 - (void)setTextColor:(NSColor*)color; |
63 | 76 |
64 - (BOOL)isFolderButtonCell; | 77 - (BOOL)isFolderButtonCell; |
65 | 78 |
66 @end | 79 @end |
67 | 80 |
68 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 81 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
OLD | NEW |