Home | History | Annotate | Download | only in constrained_window
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_INFO_H_
      6 #define CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_INFO_H_
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 #include "base/mac/scoped_nsobject.h"
     11 
     12 @protocol ConstrainedWindowSheet;
     13 
     14 // Information about a single sheet managed by
     15 // ConstrainedWindowSheetController. Note, this is a private class not meant for
     16 // public use.
     17 @interface ConstrainedWindowSheetInfo : NSObject {
     18  @private
     19   base::scoped_nsprotocol<id<ConstrainedWindowSheet>> sheet_;
     20   base::scoped_nsobject<NSView> parentView_;
     21   base::scoped_nsobject<NSWindow> overlayWindow_;
     22   BOOL sheetDidShow_;
     23 }
     24 
     25 @property(nonatomic, readonly) id<ConstrainedWindowSheet> sheet;
     26 @property(nonatomic, readonly) NSView* parentView;
     27 @property(nonatomic, readonly) NSWindow* overlayWindow;
     28 @property(nonatomic, assign) BOOL sheetDidShow;
     29 
     30 // Initializes a info object with for the given |sheet| and associated
     31 // |parentView| and |overlayWindow|.
     32 - (id)initWithSheet:(id<ConstrainedWindowSheet>)sheet
     33          parentView:(NSView*)parentView
     34       overlayWindow:(NSWindow*)overlayWindow;
     35 
     36 // Hides the sheet and the associated overlay window. Hiding is done in such
     37 // a way as to not disturb the window cycle order.
     38 - (void)hideSheet;
     39 
     40 // Shows the sheet and the associated overlay window.
     41 - (void)showSheet;
     42 
     43 @end
     44 
     45 #endif  // CHROME_BROWSER_UI_COCOA_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_SHEET_INFO_H_
     46