OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_ | |
6 #define CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 #include "base/scoped_nsobject.h" | |
10 | |
11 @class DisclosureViewState; | |
12 @class NSViewAnimation; | |
13 | |
14 // A view class that provides a disclosure triangle that controls the size | |
15 // of the view. Toggling the disclosure triangle animates the change in | |
16 // size of the view. The |openHeight| is initialized from the initial size | |
17 // of the view. |disclosureState| is initialized as |NSOnState| (of type | |
18 // NSCellStateValue) which corresponds to "open". | |
19 @interface DisclosureViewController : NSViewController { | |
20 @private | |
21 // The |detailedView_| IBOutlet references the content that becomes visible | |
22 // when the disclosure view is in the "open" state. We hold a reference | |
23 // to the content so that we can hide and show it when disclosure state | |
24 // changes. | |
25 IBOutlet NSBox* detailedView_; // weak reference | |
26 | |
27 // The |disclosureState_| is instantiated from within |awakeFromNib|. | |
28 // We do not hold it as a scoped_nsobject because it is exposed as a KVO | |
29 // compliant property. | |
30 DisclosureViewState* disclosureState_; // strong reference | |
31 | |
32 // Open height determines the height of the disclosed view. This value | |
33 // is derived from the initial height specified in the nib. | |
34 CGFloat openHeight_; | |
35 | |
36 // Value passed in to the designated initializer. Used to set up | |
37 // initial view state when we |awakeFromNib|. | |
38 NSCellStateValue initialDisclosureState_; | |
39 | |
40 // Animation object for view disclosure transitions. | |
41 scoped_nsobject<NSViewAnimation> animation_; | |
42 } | |
43 | |
44 @property (nonatomic, retain) DisclosureViewState* disclosureState; | |
45 | |
46 // Designated initializer. Sets the initial disclosure state. | |
47 - (id)initWithNibName:(NSString *)nibNameOrNil | |
48 bundle:(NSBundle *)nibBundleOrNil | |
49 disclosure:(NSCellStateValue)disclosureState; | |
50 | |
51 @end | |
52 | |
53 #endif // CHROME_BROWSER_COCOA_DISCLOSURE_VIEW_CONTROLLER_ | |
OLD | NEW |