ETWindowItem

Authors

Quentin Mathe (qmathe@club-internet.fr)
ETDecoratorItem subclass which makes possibe to decorate any layout items with a window.

Copyright: (C) 2007 Quentin Mathe

Software documentation for the ETWindowItem class

ETWindowItem : ETDecoratorItem

Declared in:
ETWindowItem.h
Conforms to:
ETFirstResponderSharingArea

A decorator which can be used to put a layout item inside a window.

With the AppKit widget backend, the window is an NSWindow object.

Once the window is managed by a window item, you must not call the following NSWindow methods: -setDelegate: , -setAcceptsMouseMovedEvents: and -registerForDraggedTypes: .

The NSWindow object is not in the EtoileUI responder chain, but common actions such as -performClose: are forwarded to the NSWindow.

Method summary

convertRectFromWidgetBackendScreenBase: 

+ (NSRect) convertRectFromWidgetBackendScreenBase: (NSRect)windowFrame;

This method is only exposed to be used internally by EtoileUI.

Converts the given rect expressed in the AppKit screen coordinate space to the EtoileUI window layer coordinate space.

This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.


convertRectToWidgetBackendScreenBase: 

+ (NSRect) convertRectToWidgetBackendScreenBase: (NSRect)rect;

@taskunit Framework Private

This method is only exposed to be used internally by EtoileUI.

Converts the given rect expressed in the EtoileUI window layer coordinate space to the AppKit screen coordinate space.

This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.

This method is only exposed to be used internally by EtoileUI.

Converts the given rect expressed in the EtoileUI window layer coordinate space to the AppKit screen coordinate space.

This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.


fullScreenItemWithObjectGraphContext: 

+ (ETWindowItem*) fullScreenItemWithObjectGraphContext: (COObjectGraphContext*)aContext;

Returns a new window item to which a fullscreen concrete window gets bound.

The returned item can be used as a decorator to make an existing layout item full screen.

The concrete window class used is ETFullScreenWindow .


itemWithWindow: objectGraphContext: 

+ (ETWindowItem*) itemWithWindow: (NSWindow*)window objectGraphContext: (COObjectGraphContext*)aContext;

@taskunit Factory Methods

Returns a new window item to which the given concrete window gets bound.

The returned item can be used as a decorator to wrap an existing layout item into a window.

Returns a new window item to which the given concrete window gets bound.

The returned item can be used as a decorator to wrap an existing layout item into a window.


panelItemWithObjectGraphContext: 

+ (ETWindowItem*) panelItemWithObjectGraphContext: (COObjectGraphContext*)aContext;

Returns a new window item to which a panel gets bound.

A panel is a utility window with a small titlebar.
For the AppKit, the panel cannot become the main item (the behavior might vary in other backends).

The concrete window class used is NSPanel .


transparentFullScreenItemWithObjectGraphContext: 

+ (ETWindowItem*) transparentFullScreenItemWithObjectGraphContext: (COObjectGraphContext*)aContext;

Returns a new window item to which a fullscreen concrete window gets bound. This window has a transparent background. The returned item can be used as a decorator to make an existing layout item full screen. The concrete window class used is ETFullScreenWindow .


acceptsDecoratorItem: 

- (BOOL) acceptsDecoratorItem: (ETDecoratorItem*)item;

Returns NO. A window can never be decorated.


activeFieldEditorItem 

- (ETLayoutItem*) activeFieldEditorItem;

Returns the item owning the field editor which has the first responder status, or nil when no text editing is underway in the window.


canDecorateItem: 

- (BOOL) canDecorateItem: (id)item;

Returns YES when item can be decorated with a window by the receiver, otherwise returns no.


contentRect 

- (NSRect) contentRect;

Returns the content view rect expressed in the window coordinate space.

This coordinate space includes the window decoration (titlebar etc.).


decorationRect 

- (NSRect) decorationRect;

Returns the window frame in the window layer coordinate base which is flipped by default.

See also -[ETItemFactory windowGroup].


editedItem 

- (ETLayoutItem*) editedItem;

Returns the item on which the text editing was initiated.


firstResponder 

- (id) firstResponder;

Returns the first responder in the window.

The first responder is the current responder where the action dispatch starts in the EtoileUI responder chain.

See ETResponder and -focusedItem .


focusedItem 

- (ETLayoutItem*) focusedItem;

Returns the focused item in the window.

The focused item can be the first responder or some previous responder higher in the EtoileUI responder chain.

More explanations and examples in -[ETResponder focusedItem].

See -firstResponder .


hitTestFieldEditorWithEvent: 

- (ETLayoutItem*) hitTestFieldEditorWithEvent: (ETEvent*)anEvent;

Returns the active field editor item if there is one located where the event occured, otherwise returns nil.


initWithWindow: objectGraphContext: 

- (id) initWithWindow: (NSWindow*)window objectGraphContext: (COObjectGraphContext*)aContext;
This is a designated initialiser for the class.

@taskunit Initialization

Initializes and returns a new window decorator with a hard window (provided by the widget backend).

Unless you write a subclass, you should never use this initializer but rather the factory methods.

The widget window is inserted in the responder chain between the receiver and -[ETLayoutItemFactory windowGroup].

If window is nil, the receiver creates a standard widget backend window.

Initializes and returns a new window decorator with a hard window (provided by the widget backend).

Unless you write a subclass, you should never use this initializer but rather the factory methods.

The widget window is inserted in the responder chain between the receiver and -[ETLayoutItemFactory windowGroup].

If window is nil, the receiver creates a standard widget backend window.


isUntitled 

- (BOOL) isUntitled;

Returns YES when the receiver window has no title, otherwise returns NO.


makeFirstResponder: 

- (BOOL) makeFirstResponder: (id)newResponder;

@taskunit First Responder Sharing Area

Sets the first responder in the window.

See also -firstResponder .

Sets the first responder in the window.

See also -firstResponder .


performClose: 

- (IBAction) performClose: (id)sender;

@taskunit Actions

Forwards the action to the underlying window object.

Forwards the action to the underlying window object.


performMiniaturize: 

- (IBAction) performMiniaturize: (id)sender;

Forwards the action to the underlying window object.


performZoom: 

- (IBAction) performZoom: (id)sender;

Forwards the action to the underlying window object.


postFocusedItemChangeNotificationIfNeeded 

- (void) postFocusedItemChangeNotificationIfNeeded;
Description forthcoming.

removeActiveFieldEditorItem 

- (void) removeActiveFieldEditorItem;

Removes the item which provides text editing in the window.

Does nothing when there is no active field editor item in the window.


setActiveFieldEditorItem: editedItem: 

- (void) setActiveFieldEditorItem: (ETLayoutItem*)editorItem editedItem: (ETLayoutItem*)editedItem;

Inserts the editor item which provides text editing in the window and makes it the first responder.

Any existing active field editor item is removed first.

An NSInvalidArgumentException is raised when any given item is nil.


setShouldKeepWindowFrame: 

- (void) setShouldKeepWindowFrame: (BOOL)shouldKeepWindowFrame;

Sets whether the window should keep its size when used as a decorator.

This is needed for fullscreen windows, so that they fill the screen regardless of the size of the item they decorate.


shouldKeepWindowFrame 

- (BOOL) shouldKeepWindowFrame;

Returns whether the window should keep its size when used as a decorator, rather than getting resized to match the decorated item size.


titleBarHeight 

- (CGFloat) titleBarHeight;

Returns the height of the window title bar or zero when no title bar is used.


usesCustomWindowTitle 

- (BOOL) usesCustomWindowTitle;

Returns YES when you have provided a custom window title, otherwise when returns NO when the receiver manages the window title.


view 

- (NSView*) view;

@taskunit Customized Decorator Methods

Returns the window content view.

Returns the window content view.


window 

- (NSWindow*) window;

@taskunit Main Accessors

Returns the underlying hard window.

Returns the underlying hard window.