OWLNext 7.0
Borland's Object Windows Library for the modern age
|
#include <ocf/stgdoc.h>
Public Types | |
enum | TStgDocProp { PrevProperty = owl::TDocument::NextProperty-1 , CreateTime , ModifyTime , AccessTime , StorageSize , IStorageInstance , NextProperty } |
Public Types inherited from owl::TDocument | |
enum | TDocProp { PrevProperty = 0 , DocumentClass , TemplateName , ViewCount , StoragePath , DocTitle , NextProperty } |
These property values, which describe the basic properties of a document, are available in classes derived from TDocument. More... | |
typedef TList | List |
Public Member Functions | |
TStorageDocument (owl::TDocument *parent=0) | |
Construct a default Storage document object. | |
~TStorageDocument () | |
virtual bool | ReleaseDoc () |
Release the IStorage and close the document. | |
owl::TInStream * | InStream (int omode, LPCTSTR strmId=0) |
owl::TOutStream * | OutStream (int omode, LPCTSTR strmId=0) |
bool | Open (int omode, LPCTSTR stgId) |
Open the compound file with a given path. | |
bool | Close () |
bool | Commit (bool force=false) |
bool | CommitTransactedStorage () |
bool | Revert (bool clear=false) |
bool | SetDocPath (LPCTSTR path) |
bool | IsOpen () |
Return 'true' if the storage document object has opened an OLE storage. | |
int | FindProperty (LPCTSTR name) |
int | PropertyFlags (int index) |
LPCTSTR | PropertyName (int index) |
int | PropertyCount () |
Return the number of properties supported by the storage document object. | |
int | GetProperty (int index, void *dest, int textlen=0) |
bool | SetProperty (int index, const void *src) |
virtual bool | SetStorage (IStorage *stg, bool remember=true) |
Give an IStorage to document. This typically happens for OLE servers. | |
virtual bool | RestoreStorage () |
Restore the original root IStorage before the save operation. | |
virtual IStorage * | GetNewStorage () |
Get a new IStorage, typically in a SaveAs situation. | |
IStorage * | GetStorage () |
Return the IStorage interface pointer currently associated with the storage document object. | |
virtual bool | OpenHandle (int omode, HANDLE hGlobal) |
Create an IStorage based on a memory handle. | |
virtual bool | SetHandle (int omode, HANDLE hGlobal, bool create=false, bool remember=false) |
Replace the IStorage with an istorage based on a memory handle. | |
virtual bool | GetHandle (HGLOBAL *handle) |
Get the global handle from ILockBytes. | |
Public Member Functions inherited from owl::TDocument | |
TDocument (TDocument *parent=nullptr) | |
Although you do not create a TDocument object directly, you must call the constructor when you create a derived class. | |
virtual | ~TDocument () |
Deletes a TDocument object. | |
TInStream * | InStream (int mode, const tstring &streamId) |
TOutStream * | OutStream (int mode, const tstring &streamId) |
bool | Open (int mode, const tstring &path) |
virtual TDocument & | RootDocument () |
Returns the this pointer as the root document. | |
TDocManager & | GetDocManager () |
Returns a pointer to the current document manager. | |
void | SetDocManager (TDocManager &dm) |
Sets the current document manager to the argument dm. | |
TDocument * | GetParentDoc () |
Returns either the parent document of the current document or 0 if there is no parent document. | |
TDocTemplate * | GetTemplate () |
Gets the template used for document creation. | |
bool | SetTemplate (TDocTemplate *tpl) |
Sets the document template. | |
LPCTSTR | GetDocPath () const |
Returns the directory path for the document. | |
bool | SetDocPath (const tstring &path) |
LPCTSTR | GetTitle () const |
Returns the title of the document. | |
virtual void | SetTitle (LPCTSTR title) |
Sets the title of the document. | |
void | SetTitle (const tstring &title) |
virtual bool | IsDirty () |
Also queries doc and view hierarchy. | |
void | SetDirty (bool dirty=true) |
Updates the document's dirty flag using the specified parameter. | |
virtual bool | CanClose () |
Returns false if unable to close. | |
virtual bool | HasFocus (HWND hwnd) |
Document (or child doc) has Focus. | |
virtual TDocument * | DocWithFocus (HWND hwnd) |
Return pointer to this document or one of its child documents if the spcecified window parameter is a view associated with the document. | |
bool | NotifyViews (int eventId, TParam2=0, TView *exclude=nullptr) |
Notifies the views of this document, and the views of any child documents, of a change. | |
bool | NotifyOwnViews (int eventId, TParam2=0, TView *exclude=nullptr) |
Notifies the views of this document of a change. | |
TView * | QueryViews (int eventId, TParam2=0, TView *exclude=nullptr) |
Queries the views of the current document, and the views of any child documents, about a specified event. | |
virtual uint | PostError (uint sid, uint choice=MB_OK) |
Posts the error message passed as a string resource ID in sid. | |
int | FindProperty (const tstring &name) |
TList & | GetChildren () |
Return reference to the children document list. | |
TView * | GetViewList () const |
Return pointer to the head of the link list of views associated with this document. | |
TView * | NextView (const TView *view) |
Gets the next view in the list of views. Holds 0 if none exists. | |
TStream * | GetStreamList () const |
Returns head of the link list of streams associated with this document. | |
TStream * | NextStream (const TStream *strm) |
Gets the next entry in the stream. Holds 0 if none exists. | |
void * | GetTag () const |
Returns pointer to user-defined data [i.e. tag] attached to this document. | |
void | SetTag (void **tag) |
Attach an arbitrary (user-defined) pointer with this document. | |
int | GetOpenMode () const |
Gets the mode and protection flag values for the current document. | |
void | SetOpenMode (int mode) |
Sets the mode and protection flag values for the current document. | |
TView * | InitView (TView *view) |
called from template InitView | |
bool | IsEmbedded () const |
Returns true if the document is embedded in an OLE 2 container. | |
void | SetEmbedded (bool embed) |
Marks the document as being embedded in an OLE 2 container. | |
virtual bool | InitDoc () |
A virtual method that is overridden by TOleDocument::InitDoc. | |
TDocument (TDocManager *docMan) | |
create a dummy document to hold docmgr | |
Public Member Functions inherited from owl::TStreamableBase | |
virtual | ~TStreamableBase () |
Protected Member Functions | |
int | GetThisOpen () |
Return the mode bits used to open the storage currently associated with this storage object. | |
IStorage * | GetOrgStorageI () |
Return a pointer to the original IStorage interface associated with this storage document object. | |
ILockBytes * | GetLockBytes () |
Return a pointer to the ILockBytes interface currently being used by this storage document object. | |
Protected Member Functions inherited from owl::TDocument | |
virtual void | AttachStream (TStream &strm) |
called from TStream constructor | |
void | DestroyViews () |
Destroys the views attached to this document. | |
void | DestroyChildren () |
Destroy children first if we have any. | |
Friends | |
class | TStorageInStream |
class | TStorageOutStream |
|
inline |
ocf::TStorageDocument::~TStorageDocument | ( | ) |
Definition at line 199 of file stgdoc.cpp.
References ReleaseDoc(), and owl::TDocument::SetDirty().
|
virtual |
Reimplemented from owl::TDocument.
Definition at line 526 of file stgdoc.cpp.
References owl::TDocument::Close(), owl::TDocument::GetParentDoc(), owl::TDocument::NotifyViews(), owl::TDocument::SetDirty(), and owl::vnDocClosed.
Reimplemented from owl::TDocument.
Definition at line 612 of file stgdoc.cpp.
References owl::TDocument::Commit(), CommitTransactedStorage(), and owl::TDocument::SetDirty().
bool ocf::TStorageDocument::CommitTransactedStorage | ( | ) |
Definition at line 628 of file stgdoc.cpp.
Reimplemented from owl::TDocument.
Definition at line 707 of file stgdoc.cpp.
References _tcscmp, NextProperty, and PrevProperty.
Get the global handle from ILockBytes.
Definition at line 513 of file stgdoc.cpp.
|
inlineprotected |
|
virtual |
Get a new IStorage, typically in a SaveAs situation.
Release StorageI and set it to the new storage if all OK.
Definition at line 402 of file stgdoc.cpp.
References owl::TDocument::GetDocPath(), IStorage, OleStr, and PRECONDITION.
|
inlineprotected |
Reimplemented from owl::TDocument.
Definition at line 719 of file stgdoc.cpp.
References _stprintf, _T, AccessTime, COUNTOF, CreateTime, owl::TDocument::GetProperty(), IStorage, IStorageInstance, ModifyTime, and StorageSize.
|
inline |
|
inlineprotected |
Reimplemented from owl::TDocument.
Definition at line 555 of file stgdoc.cpp.
References Close(), owl::TDocument::GetOpenMode(), IsOpen(), owl::ofParent, owl::ofRead, Open(), and TStorageInStream.
|
inlinevirtual |
Return 'true' if the storage document object has opened an OLE storage.
Return 'false' otherwise.
Reimplemented from owl::TDocument.
Open the compound file with a given path.
Reimplemented from owl::TDocument.
Definition at line 219 of file stgdoc.cpp.
References _T, owl::TDocument::Close(), FindProperty(), owl::TDocument::GetDocPath(), owl::TDocument::GetOpenMode(), owl::TDocument::GetParentDoc(), owl::TDocument::GetProperty(), ocf::IosToStgMode(), ocf::IosToStgTempMode(), IStorage, owl::TDocument::NotifyViews(), owl::ofAppend, owl::ofAtEnd, owl::ofNoCreate, owl::ofNoReplace, owl::ofRead, owl::ofTransacted, owl::ofTruncate, owl::ofWrite, OleStr, Open(), RefCountCheck, SetDocPath(), owl::TDocument::SetOpenMode(), owl::shMask, owl::shNone, owl::shRead, owl::shReadWrite, and owl::vnDocOpened.
Create an IStorage based on a memory handle.
Definition at line 432 of file stgdoc.cpp.
References owl::TDocument::GetOpenMode(), ocf::IosToStgMode(), owl::TDocument::NotifyViews(), owl::ofRead, owl::ofTemporary, owl::ofWrite, owl::TDocument::SetOpenMode(), owl::shMask, owl::shNone, and owl::vnDocOpened.
|
virtual |
Reimplemented from owl::TDocument.
Definition at line 579 of file stgdoc.cpp.
References Close(), owl::TDocument::GetOpenMode(), IsOpen(), owl::ofParent, owl::ofWrite, Open(), owl::TDocument::SetDirty(), and TStorageOutStream.
|
inlinevirtual |
Return the number of properties supported by the storage document object.
Reimplemented from owl::TDocument.
Definition at line 131 of file stgdoc.h.
References NextProperty.
Reimplemented from owl::TDocument.
Definition at line 693 of file stgdoc.cpp.
References NextProperty, PrevProperty, and owl::TDocument::PropertyFlags().
Reimplemented from owl::TDocument.
Definition at line 679 of file stgdoc.cpp.
References NextProperty, PrevProperty, and owl::TDocument::PropertyName().
|
virtual |
Release the IStorage and close the document.
Reimplemented in ocf::TOleDocument.
Definition at line 209 of file stgdoc.cpp.
References Close().
|
virtual |
Restore the original root IStorage before the save operation.
Reimplemented in ocf::TOleDocument.
Definition at line 384 of file stgdoc.cpp.
Reimplemented from owl::TDocument.
Definition at line 643 of file stgdoc.cpp.
References owl::TDocument::Revert(), and owl::TDocument::SetDirty().
Reimplemented from owl::TDocument.
Definition at line 602 of file stgdoc.cpp.
References owl::TDocument::SetDocPath().
|
virtual |
Replace the IStorage with an istorage based on a memory handle.
Definition at line 465 of file stgdoc.cpp.
References owl::TDocument::GetOpenMode(), ocf::IosToStgMode(), owl::TDocument::IsEmbedded(), IStorage, owl::ofRead, owl::ofTemporary, owl::ofWrite, RefCountCheck, owl::TDocument::SetEmbedded(), owl::TDocument::SetOpenMode(), SetStorage(), owl::shMask, and owl::shNone.
Reimplemented from owl::TDocument.
Definition at line 788 of file stgdoc.cpp.
References owl::TDocument::SetProperty().
Give an IStorage to document. This typically happens for OLE servers.
Reimplemented in ocf::TOleDocument.
Definition at line 331 of file stgdoc.cpp.
References _T, owl::TDocument::GetOpenMode(), OleStr, RefCountCheck, SetDocPath(), owl::TDocument::SetOpenMode(), ocf::StgToIosMode(), and ocf::StgToIosTempMode().