Home | History | Annotate | Download | only in cocoa
      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.
      4 
      5 #ifndef UI_MESSAGE_CENTER_COCOA_SETTINGS_ENTRY_VIEW_H_
      6 #define UI_MESSAGE_CENTER_COCOA_SETTINGS_ENTRY_VIEW_H_
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 #import "base/mac/scoped_nsobject.h"
     11 #import "ui/base/cocoa/hover_image_button.h"
     12 #include "ui/message_center/notifier_settings.h"
     13 
     14 @class MCSettingsController;
     15 
     16 // The view that renders individual notifiers in the settings sheet.  This
     17 // includes an enable/disable checkbox, icon, name, and learn more button,
     18 // and an optional horizontal separator line.
     19 @interface MCSettingsEntryView : NSBox {
     20  @private
     21   // Weak. Owns us.
     22   MCSettingsController* controller_;
     23 
     24   // Weak, owned by MCSettingsController.
     25   message_center::Notifier* notifier_;
     26 
     27   // The image that will be displayed next to the notifier name, loaded
     28   // asynchronously.
     29   base::scoped_nsobject<NSImage> notifierIcon_;
     30 
     31   // The button that can be displayed after the notifier name, that when
     32   // clicked on causes an event to be fired for more information.
     33   base::scoped_nsobject<HoverImageButton> learnMoreButton_;
     34 
     35   // The button that contains the label, notifier icon and checkbox.
     36   base::scoped_nsobject<NSButton> checkbox_;
     37 
     38   // The border on the bottom of the view.
     39   BOOL hasSeparator_;
     40   base::scoped_nsobject<NSBox> separator_;
     41 }
     42 
     43 - (id)initWithController:(MCSettingsController*)controller
     44                 notifier:(message_center::Notifier*)notifier
     45                    frame:(NSRect)frame
     46             hasSeparator:(BOOL)hasSeparator;
     47 
     48 - (void)setNotifierIcon:(NSImage*)notifierIcon;
     49 
     50 - (NSButton*)checkbox;
     51 
     52 @end
     53 
     54 @interface MCSettingsEntryView (TestingAPI)
     55 - (void)clickLearnMore;
     56 @end
     57 
     58 #endif  // UI_MESSAGE_CENTER_COCOA_SETTINGS_ENTRY_VIEW_H_
     59