| 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 BookmarkContextMenuCocoaController; | 10 @class BookmarkContextMenuCocoaController; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Text color for title. | 35 // Text color for title. |
| 36 scoped_nsobject<NSColor> textColor_; | 36 scoped_nsobject<NSColor> textColor_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; | 39 @property(nonatomic, readwrite, assign) const BookmarkNode* bookmarkNode; |
| 40 @property(nonatomic, readwrite, assign) int startingChildIndex; | 40 @property(nonatomic, readwrite, assign) int startingChildIndex; |
| 41 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; | 41 @property(nonatomic, readwrite, assign) BOOL drawFolderArrow; |
| 42 | 42 |
| 43 // Create a button cell which draws with a theme. | 43 // Create a button cell which draws with a theme. |
| 44 + (id)buttonCellForNode:(const BookmarkNode*)node | 44 + (id)buttonCellForNode:(const BookmarkNode*)node |
| 45 menuController:(BookmarkContextMenuCocoaController*)menuController | 45 text:(NSString*)text |
| 46 cellText:(NSString*)cellText | 46 image:(NSImage*)image |
| 47 cellImage:(NSImage*)cellImage; | 47 menuController:(BookmarkContextMenuCocoaController*)menuController; |
| 48 |
| 49 // Create a button cell not attached to any node which draws with a theme. |
| 50 + (id)buttonCellWithText:(NSString*)text |
| 51 image:(NSImage*)image |
| 52 menuController:(BookmarkContextMenuCocoaController*)menuController; |
| 48 | 53 |
| 49 // Initialize a button cell which draws with a theme. | 54 // Initialize a button cell which draws with a theme. |
| 50 // Designated initializer. | 55 // Designated initializer. |
| 51 - (id)initForNode:(const BookmarkNode*)node | 56 - (id)initForNode:(const BookmarkNode*)node |
| 52 menuController:(BookmarkContextMenuCocoaController*)menuController | 57 text:(NSString*)text |
| 53 cellText:(NSString*)cellText | 58 image:(NSImage*)image |
| 54 cellImage:(NSImage*)cellImage; | 59 menuController:(BookmarkContextMenuCocoaController*)menuController; |
| 55 | 60 |
| 56 - (BOOL)empty; // returns YES if empty. | 61 // Initialize a button cell not attached to any node which draws with a theme. |
| 62 - (id)initWithText:(NSString*)text |
| 63 image:(NSImage*)image |
| 64 menuController:(BookmarkContextMenuCocoaController*)menuController; |
| 65 |
| 66 // A button cell is considered empty if it is expected to be attached to a node |
| 67 // and this node is NULL. If the button was created with |
| 68 // buttonCellForContextMenu then no node is expected and empty is always NO. |
| 69 - (BOOL)empty; |
| 57 - (void)setEmpty:(BOOL)empty; | 70 - (void)setEmpty:(BOOL)empty; |
| 58 | 71 |
| 59 // |-setBookmarkCellText:image:| is used to set the text and image of | 72 // |-setBookmarkCellText:image:| is used to set the text and image of |
| 60 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) | 73 // a BookmarkButtonCell, and align the image to the left (NSImageLeft) |
| 61 // if there is text in the title, and centered (NSImageCenter) if | 74 // if there is text in the title, and centered (NSImageCenter) if |
| 62 // there is not. If |title| is nil, do not reset the title. | 75 // there is not. If |title| is nil, do not reset the title. |
| 63 - (void)setBookmarkCellText:(NSString*)title | 76 - (void)setBookmarkCellText:(NSString*)title |
| 64 image:(NSImage*)image; | 77 image:(NSImage*)image; |
| 65 | 78 |
| 66 // Set the color of text in this cell. | 79 // Set the color of text in this cell. |
| 67 - (void)setTextColor:(NSColor*)color; | 80 - (void)setTextColor:(NSColor*)color; |
| 68 | 81 |
| 69 - (BOOL)isFolderButtonCell; | 82 - (BOOL)isFolderButtonCell; |
| 70 | 83 |
| 71 @end | 84 @end |
| 72 | 85 |
| 73 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ | 86 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BUTTON_CELL_H_ |
| OLD | NEW |