CPApplication Class Reference
[AppKit]

List of all members.

Public Member Functions

(void) - abortModal [implementation]
(void) - activateIgnoringOtherApps: [implementation]
(CPImage- applicationIconImage [implementation]
(CPArray- arguments [implementation]
(CPModalSession) - beginModalSessionForWindow: [implementation]
(void) - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: [implementation]
(CPEvent- currentEvent [implementation]
(void) - deactivate [implementation]
(id) - delegate [implementation]
(void) - doCommandBySelector: [implementation]
(void) - endSheet: [implementation]
(void) - endSheet:returnCode: [implementation]
(void) - finishLaunching [implementation]
(void) - hide: [implementation]
(void) - hideOtherApplications: [implementation]
(id) - init [implementation]
(void) - isActive [implementation]
(CPWindow- keyWindow [implementation]
(CPMenu- mainMenu [implementation]
(CPWindow- mainWindow [implementation]
(CPWindow- modalWindow [implementation]
(CPDictionary- namedArguments [implementation]
(CPArray- orderedWindows [implementation]
(void) - orderFrontColorPanel: [implementation]
(void) - orderFrontStandardAboutPanel: [implementation]
(void) - orderFrontStandardAboutPanelWithOptions: [implementation]
(void) - replyToApplicationShouldTerminate: [implementation]
(void) - run [implementation]
(void) - runModalForWindow: [implementation]
(void) - runModalSession: [implementation]
(BOOL) - sendAction:to:from: [implementation]
(void) - sendEvent: [implementation]
(void) - setApplicationIconImage: [implementation]
(void) - setArguments: [implementation]
(void) - setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation]
(void) - setDelegate: [implementation]
(void) - setMainMenu: [implementation]
(CPEvent- setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation]
(void) - stopModal [implementation]
(void) - stopModalWithCode: [implementation]
(id) - targetForAction: [implementation]
(id) - targetForAction:to:from: [implementation]
(void) - terminate: [implementation]
(BOOL) - tryToPerform:with: [implementation]
(CPArray- windows [implementation]
(CPWindow- windowWithWindowNumber: [implementation]

Static Public Member Functions

(CPString+ defaultThemeName [implementation]
(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 81 of file CPApplication.j.


Member Function Documentation

- (void) abortModal   [implementation]

Aborts the event loop started by -runModalForWindow:

Definition at line 569 of file CPApplication.j.

- (void) activateIgnoringOtherApps: (BOOL)  shouldIgnoreOtherApps   [implementation]

Definition at line 475 of file CPApplication.j.

- (CPImage) applicationIconImage   [implementation]

Definition at line 389 of file CPApplication.j.

- (CPArray) arguments   [implementation]

Definition at line 973 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 578 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 937 of file CPApplication.j.

- (CPEvent) currentEvent   [implementation]

Definition at line 922 of file CPApplication.j.

- (void) deactivate   [implementation]

Definition at line 485 of file CPApplication.j.

+ (CPString) defaultThemeName   [implementation]

Definition at line 1102 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 299 of file CPApplication.j.

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

Definition at line 662 of file CPApplication.j.

- (void) endSheet: (CPWindow sheet   [implementation]

Definition at line 968 of file CPApplication.j.

- (void) endSheet: (CPWindow sheet
returnCode: (int)  returnCode 
[implementation]

Definition at line 950 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 310 of file CPApplication.j.

- (void) hide: (id)  aSender   [implementation]

Definition at line 710 of file CPApplication.j.

- (void) hideOtherApplications: (id)  aSender   [implementation]

Definition at line 500 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 130 of file CPApplication.j.

- (void) isActive   [implementation]

Definition at line 495 of file CPApplication.j.

- (CPWindow) keyWindow   [implementation]

Returns the key window.

Definition at line 673 of file CPApplication.j.

- (CPMenu) mainMenu   [implementation]

Returns the application's main menu

Definition at line 719 of file CPApplication.j.

- (CPWindow) mainWindow   [implementation]

Returns the main window.

Definition at line 681 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 606 of file CPApplication.j.

- (CPDictionary) namedArguments   [implementation]

Definition at line 1022 of file CPApplication.j.

- (CPArray) orderedWindows   [implementation]

Returns an array of visible CPWindow objects, ordered by their front to back order on the screen.

Definition at line 705 of file CPApplication.j.

- (void) orderFrontColorPanel: (id)  aSender   [implementation]

Definition at line 744 of file CPApplication.j.

- (void) orderFrontStandardAboutPanel: (id)  sender   [implementation]

Definition at line 401 of file CPApplication.j.

- (void) orderFrontStandardAboutPanelWithOptions: (CPDictionary options   [implementation]

Definition at line 406 of file CPApplication.j.

- (void) replyToApplicationShouldTerminate: (BOOL)  terminate   [implementation]

Definition at line 466 of file CPApplication.j.

- (void) run   [implementation]

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

Definition at line 509 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 519 of file CPApplication.j.

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

Runs a modal session

Parameters:
CPModalSession the session to run

Definition at line 587 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 784 of file CPApplication.j.

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

Dispatches events to other objects.

Parameters:
anEvent the event to dispatch

Definition at line 625 of file CPApplication.j.

- (void) setApplicationIconImage: (CPImage anImage   [implementation]

Definition at line 384 of file CPApplication.j.

- (void) setArguments: (CPArray args   [implementation]

Definition at line 981 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 912 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 211 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 728 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 917 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 117 of file CPApplication.j.

- (void) stopModal   [implementation]

Stops the modal event loop

Definition at line 561 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 529 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 from 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 885 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 807 of file CPApplication.j.

- (void) terminate: (id)  aSender   [implementation]

Definition at line 370 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 759 of file CPApplication.j.

- (CPArray) windows   [implementation]

Returns an array of the application's CPWindows

Definition at line 697 of file CPApplication.j.

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

Returns the CPWindow object corresponding to aWindowNumber.

Definition at line 689 of file CPApplication.j.


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

Generated on Fri Apr 9 11:04:20 2010 for Cappuccino API by  doxygen 1.6.1