Inheritance diagram for CP_Document< UNDO_POLICY, PRINT_POLICY >:
Containers | |
CP_ScriptableObject_Imp * | GetSuperScriptableObject () const |
virtual void | SetSuperScriptableObject (CP_ScriptableObject_Imp *inSuperScriptableObject) |
CP_ScriptableObject_Imp * | GetDefaultSubScriptableObject () const |
void | SetDefaultSubScriptableObject (CP_ScriptableObject_Imp *inObject) |
CP_ScriptableObject_Imp * | GetDefaultSuperScriptableObject () const |
void | SetDefaultSuperScriptableObject (CP_ScriptableObject_Imp *inObject) |
static void | SetDefaultObject (CP_ScriptableObject_Imp *inDefaultObject) |
static CP_ScriptableObject_Imp * | GetDefaultObject () |
static CP_ScriptableObject_Imp * | GetScriptableObjectFromToken (const AEDesc &inToken) |
Property | |
CP_ScriptableObject_Imp * | GetScriptableObjectProperty (DescType inProperty) const |
virtual void | DoAE_SetData (const DescType inPropertyType, const AEDesc &inValue, AppleEvent &inOutReply) |
AppleEventHandlers | |
virtual void | DoAE_Activate (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Clone (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Close (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Delete (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_DoObjectsExist (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Move (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Open (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Print (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Save (const AppleEvent &inEvent, AppleEvent &inOutReply) |
virtual void | DoAE_Revert (const AppleEvent &inEvent, AppleEvent &inOutReply) |
Public Types | |
typedef UNDO_POLICY | UndoPolicyType |
typedef PRINT_POLICY | PrintPolicyType |
enum | { CP_E_Doc_Create_DoNothing = 1, CP_E_Doc_Create_CreateUI = 2, CP_E_Doc_Create_CreateUIOnNew = 3, CP_E_Doc_Create_CreateUIOnOpen = 4 } |
Public Member Functions | |
CP_Document (CP_ScriptableObject *inContainer, SInt32 inDocType) | |
virtual | ~CP_Document () throw () |
PrintPolicyType & | GetPrintPolicy () |
UndoPolicyType & | GetUndoPolicy () |
virtual void | HandlePageSetupUpdateCommandStatusCommand (CP_CommandStatus &inOutCommandStatus, bool &inOutWasHandled, CP_CommandNo &inCommandNo) |
virtual void | HandlePageSetupCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo) |
virtual void | HandlePrintUpdateCommandStatusCommand (CP_CommandStatus &inOutCommandStatus, bool &inOutWasHandled, CP_CommandNo &inCommandNo) |
virtual void | HandlePrintCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo) |
virtual void | HandleUndoCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleUndoCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo) |
virtual void | HandleRedoCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleRedoCommand (OSStatus &inOutStatus, CP_CommandNo &inCommand) |
void | disconnect_all () |
void | signal_connect (CP_Signal *inSender) |
void | signal_disconnect (CP_Signal *inSender) |
Closing | |
virtual void | AttemptCloseDocument () |
void | CloseDocument () |
Getters | |
virtual CP_EventHandler & | GetEventHandler () |
virtual FourCharCode | GetDefaultFileCreator () |
virtual CP_String | GetFileName () const |
virtual CP_String | GetFileExtension () const |
virtual FourCharCode | GetDefaualtFileType () |
virtual CP_OSIcon * | GetIcon () |
virtual CP_String | GetDefaultFileName (const CP_String &inFileName) const |
Opening | |
virtual void | HandleOpen (const CP_FileSystemSpec &inFileSpec) |
Persist | |
virtual void | DoPostCreate (SInt32 inPostCreateFlags=CP_E_Doc_Create_DoNothing) |
Saving Commands | |
virtual bool | HandleSave (const CP_FileSystemSpec &inFileSpec, FourCharCode inCreator, FourCharCode inType, const CP_String &inFileExtension, bool inReplaceFile) |
virtual void | HandleRevert () |
virtual void | HandleSaveCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleSaveCommand (OSStatus &inOutStatus) |
virtual void | HandleSaveAsCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleSaveAsCommand (OSStatus &inOutStatus) |
virtual void | HandleRevertCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleRevertCommand (OSStatus &inOutStatus) |
Setters | |
virtual void | SetDefaultFileCreator (FourCharCode inCreator) |
virtual void | SetDefaualtFileType (FourCharCode inFileType) |
virtual void | SetFileName (const CP_String &inFileName) |
virtual void | SetFileExtension (const CP_String &inExtension) |
UI | |
virtual void | HandleCreateDocumentUI (SInt32 inCreateFlags=CP_E_Doc_Create_DoNothing) |
virtual void | Show () |
virtual void | Hide () |
CP_DocumentWindow * | GetMainWindow () |
void | SetMainWindow (CP_DocumentWindow *inMainWindow) |
File Dialogs | |
CP_AskSaveChangesDialog * | GetSaveChangesDialog () |
CP_AskRevertDialog * | GetAskRevertDialog () |
CP_PutFileDialog * | GetPutFileDialog () |
CP_FileSystemSpec | GetFileSpec () |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
bool | GetSaveIsSaveAs () |
AppleEvents | |
virtual SInt32 | CountContainedObjects (const DescType inType) |
virtual CP_ScriptableObject_Imp * | GetContainedObjectByName (const DescType inDesiredClass, const CP_String &inName) |
virtual CP_ScriptableObject_Imp * | GetContainedObjectByPosition (const DescType inDesiredClass, const SInt32 inPosition) |
virtual void | DoAE_GetData (const DescType inPropertyType, const AEDesc &inValue, AppleEvent &inOutReply) |
ProxyIcon | |
void | LoadProxyIcon () |
Dirty | |
virtual bool | IsDirty () |
virtual void | SetDirty (bool inIsDirty) |
Reading / Writing | |
virtual void | WritePersistantData (CP_File &, CP_PersistantWriter *) |
Closing | |
virtual void | AttemptCloseDocument () |
void | CloseDocument () |
Getters | |
virtual CP_EventHandler & | GetEventHandler () |
virtual FourCharCode | GetDefaultFileCreator () |
virtual CP_String | GetFileName () const |
virtual CP_String | GetFileExtension () const |
virtual FourCharCode | GetDefaualtFileType () |
virtual CP_OSIcon * | GetIcon () |
virtual CP_String | GetDefaultFileName (const CP_String &inFileName) const |
Opening | |
virtual void | HandleOpen (const CP_FileSystemSpec &inFileSpec) |
Persist | |
virtual void | DoPostCreate (SInt32 inPostCreateFlags=CP_E_Doc_Create_DoNothing) |
Saving Commands | |
virtual bool | HandleSave (const CP_FileSystemSpec &inFileSpec, FourCharCode inCreator, FourCharCode inType, const CP_String &inFileExtension, bool inReplaceFile) |
virtual void | HandleRevert () |
virtual void | HandleSaveCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleSaveCommand (OSStatus &inOutStatus) |
virtual void | HandleSaveAsCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleSaveAsCommand (OSStatus &inOutStatus) |
virtual void | HandleRevertCommandStatus (CP_CommandStatus &inOutCommandStatus, bool &inOutResult, CP_CommandNo &inCommand) |
virtual void | HandleRevertCommand (OSStatus &inOutStatus) |
Setters | |
virtual void | SetDefaultFileCreator (FourCharCode inCreator) |
virtual void | SetDefaualtFileType (FourCharCode inFileType) |
virtual void | SetFileName (const CP_String &inFileName) |
virtual void | SetFileExtension (const CP_String &inExtension) |
UI | |
virtual void | HandleCreateDocumentUI (SInt32 inCreateFlags=CP_E_Doc_Create_DoNothing) |
virtual void | Show () |
virtual void | Hide () |
CP_DocumentWindow * | GetMainWindow () |
void | SetMainWindow (CP_DocumentWindow *inMainWindow) |
File Dialogs | |
CP_AskSaveChangesDialog * | GetSaveChangesDialog () |
CP_AskRevertDialog * | GetAskRevertDialog () |
CP_PutFileDialog * | GetPutFileDialog () |
CP_FileSystemSpec | GetFileSpec () |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
bool | GetSaveIsSaveAs () |
AppleEvents | |
virtual SInt32 | CountContainedObjects (const DescType inType) |
virtual CP_ScriptableObject_Imp * | GetContainedObjectByName (const DescType inDesiredClass, const CP_String &inName) |
virtual CP_ScriptableObject_Imp * | GetContainedObjectByPosition (const DescType inDesiredClass, const SInt32 inPosition) |
virtual void | DoAE_GetData (const DescType inPropertyType, const AEDesc &inValue, AppleEvent &inOutReply) |
ProxyIcon | |
void | LoadProxyIcon () |
Dirty | |
virtual bool | IsDirty () |
virtual void | SetDirty (bool inIsDirty) |
Reading / Writing | |
virtual void | WritePersistantData (CP_File &, CP_PersistantWriter *) |
Dirty | |
virtual bool | IsDirty () |
virtual void | SetDirty (bool inIsDirty) |
Reading / Writing | |
virtual void | WritePersistantData (CP_File &, CP_PersistantWriter *) |
Static Public Member Functions | |
Persistance | |
static CP_Document_Base * | DocumentCreator (CP_ScriptableObject *inContainer, SInt32 inDocumentClass) |
Persistance | |
static CP_Document_Base * | DocumentCreator (CP_ScriptableObject *inContainer, SInt32 inDocumentClass) |
Protected Member Functions | |
virtual void | HandleUndoEvent (CP_Event_Base &inEvent) |
Printing | |
virtual void | HandlePrinting (CP_Printer *) |
AppleEvents | |
virtual DescType | GetAppleClass () const |
virtual void | MakeSelfSpecifier (AEDesc &inContainerSpec, AEDesc &inOutSelfSpec) |
FileType | |
virtual void | GetFileTypeInfo (const CP_FileSystemSpec &inFileSpec, FourCharCode *inOutCreator, FourCharCode *inOutType, CP_String *inOutFileExtension) |
AppleEvents | |
virtual DescType | GetAppleClass () const |
virtual void | MakeSelfSpecifier (AEDesc &inContainerSpec, AEDesc &inOutSelfSpec) |
FileType | |
virtual void | GetFileTypeInfo (const CP_FileSystemSpec &inFileSpec, FourCharCode *inOutCreator, FourCharCode *inOutType, CP_String *inOutFileExtension) |
FileType | |
virtual void | GetFileTypeInfo (const CP_FileSystemSpec &inFileSpec, FourCharCode *inOutCreator, FourCharCode *inOutType, CP_String *inOutFileExtension) |
Protected Attributes | |
CP_DocumentWindow * | fMainWindow |
bool | fCloseInProgress |
bool | fSaveIsSaveAs |
CP_EventHandler | fDummyHandler |
FourCharCode | fDefaultFileCreator |
FourCharCode | fDefaultFileType |
CP_String | fFileName |
CP_String | fExtension |
CP_AppleEventHandler_Map | fEventHandlers |
CP_ScriptableObject_Imp * | fSuperScriptableObject |
CP_ScriptableObject_Imp * | fDefaultSubScriptableObject |
CP_ScriptableObject_Imp * | fDefaultSuperScriptableObject |
CP_FileSystemSpec | fFileSpec |
bool | fDirty |
CP_Commands_Array * | fCommands |
CP_MenuSelectionSignal * | fMennuSelectionSignal |
sender_set | fSenders |
Static Protected Attributes | |
static CP_ScriptableObject_Imp * | gDefaultObject = NULL |
static bool | gInited = false |
Private Attributes | |
CP_EventHandler | fEventHandler |
PRINT_POLICY | fPrintPolicy |
UNDO_POLICY | fUndoPolicy |
CP_PrintSignal | fPrintSignal |
Friends | |
class | CP_DocumentNameMatch |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from CP_Document_Base. |
|
Reimplemented from CP_Document_Base. |
|
Reimplemented from CP_Document_Base. |
|
Reimplemented from CP_Document_Base. |
|
Reimplemented from CP_Document_Base. |
|
|
|
|
|
Called when the user is attempting to close this document, or the main CP_DocumentWindow associated with this document. If the document is dirty, the user will be prompted if they want to save the contents.
|
|
Called when the user is done with this document. The default is to just delete this object. This will be called automatically by the framework.
|
|
Returns the CP_EventHandler for this class. If the document has a window associated with it, then that handler is returned, otherwise a dummy handler is returned. Since documents don't have an associated event handling object associated with them, the event handler for the main window is returned.
|
|
|
|
Returns the file name used with this document.
|
|
Returns the file extension used with files created for this document. The default is txt. Users should set this field based on the extensions used for their document.
|
|
|
|
Returns the default icon for this document.
|
|
Returns the default file name for this document. This is "Untitled" followed by a count, based on the number of default documents created.
|
|
User overrideable method to be called when the user wants to open a document. This method does nothing here, users must override.
|
|
This is called right after the document class is created. The default is to call HandleCreateDocumentUI which you need to override in your document subclass to handle creation of the main UI elements for this class.
|
|
Called when the user needs to save the documents contents to a file. Normally you do not need to override this, but just supply a CP_PersistantWriter object that will do the actual writing of the documents data.
the original file if we have saved to a temp file. Reimplemented from CP_Persistant. |
|
|
|
Called when the status of the save command needs to be updated.
|
|
Handle the save command.
|
|
Called when the status of the save as command needs to be updated.
|
|
Handle the save as command.
|
|
Called when the status of the revert command needs to be updated.
|
|
Handle the revert command.
|
|
|
|
|
|
|
|
|
|
User overrideable method to handle creation of the document main UI and windows.
|
|
Make this document visible. The default is to just call the main window and show that window. However if you have other UI elements such as palettes you can override this and handle showing them here.
|
|
Make this document hidden. The default is to just call the main window and hide that window. However if you have other UI elements such as palettes you can override this and handle hiding them here.
|
|
Return the main document window.
|
|
Sets the CP_DocumentWindow that is associated with this document. This is the window that will check with this object before it closes itself to ensure that any data is saved first. This will also broadcast a document message of type kCP_Message_DocumentWindowSet so that any listeners will be notified when the main window has changed for this object.
|
|
Return a CP_AskSaveChangesDialog so the user will be notified if the document has any changes that need saving. Before returning the dialog, we fill in values that the dialog will display, based on information in this document.
|
|
|
|
Return a CP_PutFileDialog so the user can choose the location to save the file to. Before returning the dialog, we fill in values that the dialog will display, based on information in this document.
|
|
Returns the file spec used for this documents main file.
|
|
Sets the file spec used for this documents main file.
|
|
|
|
Extension used with the file for this document. Reimplemented from CP_ScriptableObject_Imp. |
|
Return the object contained inourselves based on the name passed in.
Reimplemented from CP_ScriptableObject_Imp. |
|
Return the object contained inourselves based on the position passed in.
Reimplemented from CP_ScriptableObject_Imp. |
|
Handles the get data Apple Event to return some type of data about this window.
Reimplemented from CP_ScriptableObject_Imp. |
|
Loads the proxy icon based on the saved status of this document.
|
|
Returns the AppleEvent document class for this object. The default is to return cDocument.
Implements CP_ScriptableObject_Imp. |
|
Add a specifier to ourselves. This is by default a specifier for an object of typeNull.
Reimplemented from CP_ScriptableObject_Imp. |
|
Handle the passed in Apple Event. You should not need to override this. Either call the one of the default handlers for the core events, or to override the default handlers, register an event handler for the event. Registered event handlers will be handled first, then the built in functions will be called if there is no overriding event handler for the event.
Reimplemented in CP_ScriptableObject_Property. |
|
Handles AppleEvents for this object and any sub scriptable objects that this object might contain.
|
|
Set the default object. This is the object that subsequent events will use when they refer to the default object.
|
|
|
|
Gets the scriptable object that an event corresponds to, by extracting our CP_ModelToken from the descriptor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compare Apple Event objects. This method returns false, and subclasses need to override it.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in ourselves based on the unique ID passed in. Subclasses need to override this function. This routine just returns NULL.
|
|
Return the object contained in ourselves based on the position passed in. Subclasses need to override this function. This routine just returns NULL.
|
|
Subclasses need to override this to handle the create element event.
Reimplemented in CP_Application< DOC_POLICY, PRINT_POLICY, UNDO_POLICY >. |
|
Adds the passed in CP_AppleEventSignal to the list of AppleEvents we will handle through a signal / slot connection.
|
|
Removes a previously added event handler from the list of the events handled by the object.
|
|
Returns true if there is a registered signal handler for the passed in event.
|
|
Finds and returns the signal for the passed in event.
|
|
Tries to get the CP_ModelToken from the passed in descriptor and return in outToken.
|
|
Places the passed in scriptable object into a CP_ModelToken and then packages it up in a descriptor and returns in outToken.
|
|
|
|
Subclasses should override this to handle the set data event.
Reimplemented in CP_Window_Imp. |
|
Send an Apple Event to ourselves. Used to record events.
|
|
Make the specifier for our object. This method will recruisvely travel the object heirachy to make the correct specifier.
|
|
Check to make sure that the required params for the event are present, and throw an OSErr exception if they are missing.
|
|
Initialize our Apple Event handling by installing the Apple Event dispatcher and its object handlers.
|
|
|
|
|
|
Reimplemented in CP_Window_Imp. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Return the object contained in the passed in container based upon the inForm criteria.
|
|
Subclasses need to override to return the position of their sub objects.
|
|
|
|
|
|
Method call by our persistant writer to write out the data from the CP_Persistant class.
|
|
|
|
Updates the status of a command.
|
|
Updates the status of a command based on the current state of the application.
|
|
Handles the processing of a command. If the command has been registered with this class, then its signal will be called. If the command has not been registered, then this function does nothing with the passed in command.
|
|
Signal called when a menu item is selected with no associated command. |
|
Returns the signal called when a menu item is selected and has no command associated with it.
|
|
Registers the passed in command. This places the command in a list of commands we will handle updating the status for, and when called executing the signal registered for the command.
|
|
Registers the passed in command. This places the command in a list of commands we will handle updating the status for, and when called executing the signal registered for the command.
|
|
Registers the passed in command. This places the command in a list of commands we will handle updating the status for. You are returned the signal object that you need to connect your slot to.
|
|
Registers the passed in command, returning the command status signal. If the command already exists, we will return the existing command status signal if there is one, otherwise we create a new signal, and return that signal. If there is already a signal, then return the existing signal.
|
|
Registers the passed in command, returning the command handling signal. If the command already exists, we will return the existing command handler signal if there is one, otherwise we create a new signal, and return that signal. If there is already a signal, then return the existing signal.
|
|
Returns true if the passed in command is known to this class.
|
|
Replaces a CP_Command for the passed in command number.
|
|
Unregisters a command.
|
|
Returns the CP_Command object associated with the passed in command number.
|
|
MacOS - Handles the processing of the passed in HICommand. This will translate the HICommand into a CPLAT CP_CommandNo for processing and updating the status of the command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CarbonEvent handler. |
|
|
|
|
|
|
|
This is the main window for this class, and allows communication between the window and this document so closing the window will also cause this document to close. |
|
Flag used to indicate if a close is in progress. Used with non-modal file dialogs to monitor progress. |
|
|
|
Default event handler returnned for this class. |
|
Default file creator used with documents. Users should provide actual creator if different than the applications. |
|
Defaualt file type code for documents created with this class. Default is 'TEXT'. |
|
File name for the default document of this class. |
|
|
|
The default object that events will be dispatched to. |
|
Flag to indicate if this class has been initialized. |
|
Map that contains all of the registered handlers. |
|
Scriptable object that is our container. |
|
Default scriptable object that is contained by this object. |
|
|
|
|
|
|
|
List of commands managed by this class. |
|
|