CPApplication Class Reference

List of all members.

Public Member Functions

(id) - init [implementation]
(void) - setDelegate: [implementation]
(id) - delegate [implementation]
(void) - finishLaunching [implementation]
(void) - run [implementation]
(void) - runModalForWindow: [implementation]
(void) - stopModalWithCode: [implementation]
(void) - stopModal [implementation]
(void) - abortModal [implementation]
(CPModalSession) - beginModalSessionForWindow: [implementation]
(void) - runModalSession: [implementation]
(CPWindow- modalWindow [implementation]
(void) - sendEvent: [implementation]
(void) - doCommandBySelector: [implementation]
(CPWindow- keyWindow [implementation]
(CPWindow- mainWindow [implementation]
(CPWindow- windowWithWindowNumber: [implementation]
(CPArray- windows [implementation]
(CPMenu- mainMenu [implementation]
(void) - setMainMenu: [implementation]
(BOOL) - tryToPerform:with: [implementation]
(BOOL) - sendAction:to:from: [implementation]
(id) - targetForAction:to:from: [implementation]
(id) - targetForAction: [implementation]
(void) - setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation]
(CPEvent- setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation]
(void) - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: [implementation]
(CPArray- arguments [implementation]
(CPDictionary- namedArguments [implementation]

Static Public Member Functions

(CPApplication+ sharedApplication [implementation]


Detailed Description

CPApplication is THE way to start up the Cappucino framework for your application to use. Every GUI application has exactly one instance of CPApplication (or of a custom subclass of CPApplication). Your program's main() function can create that instance by calling the CPApplicationMain function. A simple example looks like this:

    function main(args, namedArgs)
    {
        CPApplicationMain(args, namedArgs);
    }
    

-(void)applicationDidFinishLaunching:(CPNotification)aNotification; Sent from the notification center after the app initializes, but before receiving events.

Parameters:
aNotification contains information about the event
-(void)applicationWillFinishLaunching:(CPNotification)aNotification; Sent from the notification center before the app is initialized.
Parameters:
aNotification contains information about the event

Definition at line 64 of file CPApplication.j.


Member Function Documentation

- (void) abortModal   [implementation]

Aborts the event loop started by runModalForWindow:

Definition at line 337 of file CPApplication.j.

- (CPArray) arguments   [implementation]

Definition at line 664 of file CPApplication.j.

- (CPModalSession) beginModalSessionForWindow: (CPWindow aWindow   [implementation]

Sets up a modal session with theWindow.

Parameters:
aWindow the window to set up the modal session for

Definition at line 346 of file CPApplication.j.

- (void) beginSheet: (CPWindow aSheet
modalForWindow: (CPWindow aWindow
modalDelegate: (id)  aModalDelegate
didEndSelector: (SEL)  aDidEndSelector
contextInfo: (id)  aContextInfo 
[implementation]

Displays a window as a sheet.

Parameters:
aSheet the window to display as a sheet
aWindow the window that will hold the sheet as a child
aModalDelegate 
aDidEndSelector 
aContextInfo 

Definition at line 659 of file CPApplication.j.

- (id) delegate   [implementation]

Returns the application's delegate. The app can only have one delegate at a time.

Definition at line 225 of file CPApplication.j.

- (void) doCommandBySelector: (SEL)  aSelector   [implementation]

Definition at line 415 of file CPApplication.j.

- (void) finishLaunching   [implementation]

This method is called by run before the event loop begins. When it successfully completes, it posts the notification CPApplicationDidFinishLaunchingNotification. If you override finishLaunching, the subclass method should invoke the superclass method.

Definition at line 236 of file CPApplication.j.

- (id) init   [implementation]

Initializes the Document based application with basic menu functions. Functions are New, Open, Undo, Redo, Save, Cut, Copy, Paste.

Returns:
the initialized application

Definition at line 104 of file CPApplication.j.

- (CPWindow) keyWindow   [implementation]

Returns the key window.

Definition at line 426 of file CPApplication.j.

- (CPMenu) mainMenu   [implementation]

Returns the application's main menu

Definition at line 459 of file CPApplication.j.

- (CPWindow) mainWindow   [implementation]

Returns the main window.

Definition at line 434 of file CPApplication.j.

- (CPWindow) modalWindow   [implementation]

Returns the window for the current modal session. If there is no modal session, it returns nil.

Definition at line 374 of file CPApplication.j.

- (CPDictionary) namedArguments   [implementation]

Definition at line 669 of file CPApplication.j.

- (void) run   [implementation]

Calls finishLaunching method which results in starting the main event loop.

Definition at line 277 of file CPApplication.j.

- (void) runModalForWindow: (CPWindow aWindow   [implementation]

Starts a modal event loop for aWindow

Parameters:
aWindow the window to start the event loop for

Definition at line 287 of file CPApplication.j.

- (void) runModalSession: (CPModalSession)  aModalSession   [implementation]

Runs a modal session

Parameters:
CPModalSession the session to run

Definition at line 355 of file CPApplication.j.

- (BOOL) sendAction: (SEL)  anAction
to: (id)  aTarget
from: (id)  aSender 
[implementation]

Sends an action to a target.

Parameters:
anAction the action to send
aTarget the target for the action
aSender the action sender
Returns:
YES

Definition at line 508 of file CPApplication.j.

- (void) sendEvent: (CPEvent anEvent   [implementation]

Dispatches events to other objects.

Parameters:
anEvent the event to dispatch

Definition at line 395 of file CPApplication.j.

- (void) setCallback: (Function)  aCallback
forNextEventMatchingMask: (unsigned int)  aMask
untilDate: (CPDate anExpiration
inMode: (CPString aMode
dequeue: (BOOL)  shouldDequeue 
[implementation]

Definition at line 637 of file CPApplication.j.

- (void) setDelegate: (id)  aDelegate   [implementation]

Sets the delegate for this application. The delegate will receive various notifications caused by user interactions during the application's run. The delegate can choose to react to these events.

Parameters:
aDelegate the delegate object

Definition at line 185 of file CPApplication.j.

- (void) setMainMenu: (CPMenu aMenu   [implementation]

Sets the main menu for the application

Parameters:
aMenu the menu to set for the application

Definition at line 468 of file CPApplication.j.

- (CPEvent) setTarget: (id)  aTarget
selector: (SEL)  aSelector
forNextEventMatchingMask: (unsigned int)  aMask
untilDate: (CPDate anExpiration
inMode: (CPString aMode
dequeue: (BOOL)  shouldDequeue 
[implementation]

Definition at line 644 of file CPApplication.j.

+ (CPApplication) sharedApplication   [implementation]

Returns the singleton instance of the running application. If it doesn't exist, it will be created, and then returned.

Returns:
the application singleton

Definition at line 91 of file CPApplication.j.

- (void) stopModal   [implementation]

Stops the modal event loop

Definition at line 329 of file CPApplication.j.

- (void) stopModalWithCode: (int)  aCode   [implementation]

Stops the event loop started by runModalForWindow: and sets the code that runModalForWindow: will return.

Parameters:
aCode the return code for the modal event

Definition at line 297 of file CPApplication.j.

- (id) targetForAction: (SEL)  anAction   [implementation]

Looks for a target that can handle the specified action. Checks for a target in the following order:

  1. a responder from the key window
  2. a responder frmo the main window
  3. the CPApplication instance
  4. the application delegate
  5. the document controller
Parameters:
anAction the action to handle
Returns:
a target that can respond, or nil if no match could be found

Definition at line 610 of file CPApplication.j.

- (id) targetForAction: (SEL)  anAction
to: (id)  aTarget
from: (id)  aSender 
[implementation]

Finds a target for the specified action. If the action is nil, returns nil. If the target is not nil, aTarget is returned. Otherwise, it calls targetForAction: to search for a target.

Parameters:
anAction the action to find a target for
aTarget if not nil, this will be returned not used
Returns:
a target for the action

Definition at line 531 of file CPApplication.j.

- (BOOL) tryToPerform: (SEL)  anAction
with: (id)  anObject 
[implementation]

Tries to perform the action with an argument. Performs the action on itself (if it responds to it), then tries to perform the action on the delegate.

Parameters:
anAction the action to perform.
anObject the argument for the action method
Returns:
YES if the action was performed

Definition at line 483 of file CPApplication.j.

- (CPArray) windows   [implementation]

Returns an array of the application's CPWindows

Definition at line 450 of file CPApplication.j.

- (CPWindow) windowWithWindowNumber: (int)  aWindowNumber   [implementation]

Returns the CPWindow object corresponding to aWindowNumber.

Definition at line 442 of file CPApplication.j.


The documentation for this class was generated from the following file:

Generated on Thu Dec 11 01:55:49 2008 for Cappuccino by  doxygen 1.5.7.1