1 // Copyright 2013 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.
5 #ifndef UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_
6 #define UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "ui/base/ui_base_export.h"
13 // A custom NSPopUpButtonCell that permits a hover image, and draws only an
14 // image in its frame; no border, bezel or drop-down arrow. Use setDefaultImage:
15 // to set the default image, setAlternateImage: to set the button shown while
16 // the menu is active, and setHoverImage: for the mouseover hover image.
18 @interface HoverImageMenuButtonCell
: NSPopUpButtonCell
{
20 base::scoped_nsobject
<NSImage
> hoverImage_
;
24 @
property(retain
, nonatomic
) NSImage
* hoverImage
;
25 @
property(assign
, nonatomic
, getter
=isHovered
) BOOL hovered
;
27 // Return the image that would be drawn based on the current state flags.
28 - (NSImage
*)imageToDraw
;
30 // Set the default image to show on the menu button.
31 - (void)setDefaultImage
:(NSImage
*)defaultImage
;
35 #endif // UI_BASE_COCOA_CONTROLS_HOVER_IMAGE_MENU_BUTTON_CELL_H_