#include <lddirect.h>
Inheritance diagram for LoadDirect:
Public Member Functions | |
virtual | ~LoadDirect () |
BOOL | Execute (const TCHAR *lpszFilename) |
Execute the action of loading a named document, calling a subclass virtual function 'OnLoadDocument' and killing the loaded document. The selected document and view will be retained by this function. | |
Protected Member Functions | |
virtual BOOL | OnLoadDocument (Document *pKernelDoc) |
Having successfully loaded the document, this function will be called to process the loaded data. The kernel document can be used to scan the document tree and perform any actions necessary. On return from this function the calling framework will delete the document and all its associated structures. | |
Private Member Functions | |
CC_DECLARE_MEMDUMP (LoadDirect) | |
BOOL | ExecuteHelper (CCamApp *pApp, const TCHAR *lpszFilename) |
Helps out by conditioning its parent. ie, by making the parent routine less complex in its condition paths. |
Definition at line 120 of file lddirect.h.
|
Definition at line 125 of file lddirect.h.
|
|
|
|
Execute the action of loading a named document, calling a subclass virtual function 'OnLoadDocument' and killing the loaded document. The selected document and view will be retained by this function.
Definition at line 141 of file lddirect.cpp. 00142 { 00143 // find our main application object 00144 CCamApp *pApp = (CCamApp*)&AfxGetApp(); 00145 if (!pApp) 00146 return FALSE; 00147 00148 // Recode the currently selected document, view and spread 00149 Document *OldSelDocument = Document::GetSelected(); 00150 DocView *OldSelView = DocView::GetSelected(); 00151 Spread *OldSelSpread = Document::GetSelectedSpread(); 00152 00153 // call the loader 00154 BOOL ok = ExecuteHelper(pApp, lpszFilename); 00155 00156 // reset the previous selected state. 00157 if (OldSelDocument != NULL) 00158 Document::SetSelectedViewAndSpread(OldSelDocument,OldSelView,OldSelSpread); 00159 00160 // return the user state. 00161 return ok; 00162 }
|
|
Helps out by conditioning its parent. ie, by making the parent routine less complex in its condition paths. BOOL LoadDirect::ExecuteHelper(CCamApp* pApp, const TCHAR* lpszFilename)
Definition at line 180 of file lddirect.cpp. 00181 { 00182 BOOL ok=TRUE; 00183 00184 PORTNOTETRACE("other", "Disabled LoadDirect::ExecuteHelper"); 00185 #ifndef EXCLUDE_FROM_XARALX 00186 00187 // now call the supporting open document function 00188 CDocument* pLoadDirectDoc = pApp->OpenHiddenDocument(lpszFilename); 00189 if (pLoadDirectDoc==NULL) 00190 return FALSE; 00191 00192 // assume its a cam doc we have created, and find its kernel doc 00193 CCamDoc* pCamDoc = (CCamDoc*)pLoadDirectDoc; 00194 Document* pRealDoc = pCamDoc->GetKernelDoc(); 00195 00196 // call the user function for document decoding 00197 ok = (pRealDoc!=NULL); 00198 ok = ok && (OnLoadDocument(pRealDoc)); 00199 00200 // finally toast the loaded document. 00201 pCamDoc->SetModified(FALSE); 00202 pCamDoc->OnCloseDocument(); 00203 #endif 00204 00205 return ok; 00206 }
|
|
Having successfully loaded the document, this function will be called to process the loaded data. The kernel document can be used to scan the document tree and perform any actions necessary. On return from this function the calling framework will delete the document and all its associated structures.
Reimplemented in LoadBrushDirect, and LoadPrintMarks. Definition at line 230 of file lddirect.cpp. 00231 { 00232 ERROR3("The base class LoadDirect::OnLoadDocument() has been called, where's your derived class?"); 00233 return FALSE; 00234 }
|