Public Member Functions | |
Constructor / Destructor | |
CP_Document_Doc (CPLAT::CP_ScriptableObject *inContainer, CPLAT::FourCharCode inDocType) | |
Constructor. | |
virtual | ~CP_Document_Doc () throw () |
Document UI | |
virtual void | HandleCreateDocumentUI (SInt32 inPostCreateFlags=CP_E_Doc_Create_DoNothing) |
File | |
virtual void | HandleOpen (const CPLAT::CP_FileSystemSpec &inFileSpec) |
virtual void | WritePersistantData (CPLAT::CP_File &inFile, CPLAT::CP_PersistantWriter *inWriter) |
Static Public Member Functions | |
Creator | |
static CPLAT::CP_Document_Base * | DocumentCreator (CPLAT::CP_ScriptableObject *inContainer, CPLAT::FourCharCode inDocumentClass) |
Protected Member Functions | |
Persistance | |
void | CreateWriter (CPLAT::CP_PersistantWriter **inReturnWriter, CPLAT::FourCharCode inOSType) |
virtual void | GetFileTypeInfo (const CPLAT::CP_FileSystemSpec &inFileSpec, CPLAT::FourCharCode *inOutCreator, CPLAT::FourCharCode *inOutType, CPLAT::CP_String *inOutFileExtension) |
Printing | |
virtual void | HandlePrintCommand (CPLAT::OSStatus &inOutStatus, CPLAT::CP_CommandNo &inCommandNo) |
Protected Attributes | |
CPLAT::CP_TextView * | fTextView |
Private Types | |
typedef CPLAT::CP_Document< CPLAT::CP_UndoPolicy_None, CPLAT::CP_PrintPolicy_Print > | inherited |
Private Member Functions | |
Slots | |
void | TextFieldChanged (CPLAT::CP_DataValueHolder &inValue, CPLAT::OSStatus &inOutStatus) |
void | HandleSizeMenuCommand (CPLAT::OSStatus &inOutStatus, CPLAT::CP_CommandNo &inCommandNo) |
void | HandleStyleMenuCommand (CPLAT::OSStatus &inOutStatus, CPLAT::CP_CommandNo &inCommandNo) |
|
|
|
Constructor.
|
|
Destructor.
|
|
Called when some action has requested we create a new document object. This is usually called from the CP_DocumentFactoryManager when it needs to create a new document.
|
|
Called when the document wants to create the main user interface for the document. In this demo we create a window, with a CP_TextView in it.
|
|
Called when the user has requested we open a new document. In this demo we will create a CP_File object to read in the data, and then set the contents of the view to the data from the file. In this demo, no attempt is made to verify that we are dealing with text data.
|
|
Called from the persistant writer we created above to actualy write out the documents data. In this demo we write out the contents of the text view to the passed in file. No formatting or any other special information is written, just the plain text.
|
|
Called when the document is being saved. This will create a return a CP_PersistantWriter object that is used to save the actual data.
|
|
Called when we need to get the file type information for our documents file. In this demo, we supply the creator as the applications creator code, and the files extensio as 'txt' for a text file.
|
|
Called when the user wants to print the contents of this document. In this demo, we just ask the text view object to handle the OS native printing provided by the text view.
|
|
Slot called when the contents of the text view have changed. We use this opportunity to mark the document as being dirty, and needing to be saved.
|
|
Call when the user selects a size from the size menu
|
|
Call when the user selects a style from the size menu
|
|
|