OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocf::TStorageDocument Class Reference

#include <ocf/stgdoc.h>

Inheritance diagram for ocf::TStorageDocument:
owl::TDocument owl::TStreamableBase ocf::TOleDocument

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::TInStreamInStream (int omode, LPCTSTR strmId=0)
 
owl::TOutStreamOutStream (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 IStorageGetNewStorage ()
 Get a new IStorage, typically in a SaveAs situation.
 
IStorageGetStorage ()
 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.
 
TInStreamInStream (int mode, const tstring &streamId)
 
TOutStreamOutStream (int mode, const tstring &streamId)
 
bool Open (int mode, const tstring &path)
 
virtual TDocumentRootDocument ()
 Returns the this pointer as the root document.
 
TDocManagerGetDocManager ()
 Returns a pointer to the current document manager.
 
void SetDocManager (TDocManager &dm)
 Sets the current document manager to the argument dm.
 
TDocumentGetParentDoc ()
 Returns either the parent document of the current document or 0 if there is no parent document.
 
TDocTemplateGetTemplate ()
 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 TDocumentDocWithFocus (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.
 
TViewQueryViews (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)
 
TListGetChildren ()
 Return reference to the children document list.
 
TViewGetViewList () const
 Return pointer to the head of the link list of views associated with this document.
 
TViewNextView (const TView *view)
 Gets the next view in the list of views. Holds 0 if none exists.
 
TStreamGetStreamList () const
 Returns head of the link list of streams associated with this document.
 
TStreamNextStream (const TStream *strm)
 Gets the next entry in the stream. Holds 0 if none exists.
 
voidGetTag () 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.
 
TViewInitView (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.
 
IStorageGetOrgStorageI ()
 Return a pointer to the original IStorage interface associated with this storage document object.
 
ILockBytesGetLockBytes ()
 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
 

Detailed Description

Definition at line 34 of file stgdoc.h.

Member Enumeration Documentation

◆ TStgDocProp

Enumerator
PrevProperty 
CreateTime 
ModifyTime 
AccessTime 
StorageSize 
IStorageInstance 
NextProperty 

Definition at line 36 of file stgdoc.h.

Constructor & Destructor Documentation

◆ TStorageDocument()

ocf::TStorageDocument::TStorageDocument ( owl::TDocument * parent = 0)
inline

Construct a default Storage document object.

Definition at line 111 of file stgdoc.h.

◆ ~TStorageDocument()

ocf::TStorageDocument::~TStorageDocument ( )

Definition at line 199 of file stgdoc.cpp.

References ReleaseDoc(), and owl::TDocument::SetDirty().

Member Function Documentation

◆ Close()

bool ocf::TStorageDocument::Close ( )
virtual

◆ Commit()

bool ocf::TStorageDocument::Commit ( bool force = false)
virtual

Reimplemented from owl::TDocument.

Definition at line 612 of file stgdoc.cpp.

References owl::TDocument::Commit(), CommitTransactedStorage(), and owl::TDocument::SetDirty().

◆ CommitTransactedStorage()

bool ocf::TStorageDocument::CommitTransactedStorage ( )

Definition at line 628 of file stgdoc.cpp.

◆ FindProperty()

int ocf::TStorageDocument::FindProperty ( LPCTSTR name)
virtual

Reimplemented from owl::TDocument.

Definition at line 707 of file stgdoc.cpp.

References _tcscmp, NextProperty, and PrevProperty.

◆ GetHandle()

bool ocf::TStorageDocument::GetHandle ( HGLOBAL * handle)
virtual

Get the global handle from ILockBytes.

Definition at line 513 of file stgdoc.cpp.

◆ GetLockBytes()

ILockBytes * ocf::TStorageDocument::GetLockBytes ( )
inlineprotected

Return a pointer to the ILockBytes interface currently being used by this storage document object.

Return 0 if no ILockBytes interface is in use.

Definition at line 163 of file stgdoc.h.

◆ GetNewStorage()

IStorage * ocf::TStorageDocument::GetNewStorage ( )
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.

◆ GetOrgStorageI()

IStorage * ocf::TStorageDocument::GetOrgStorageI ( )
inlineprotected

Return a pointer to the original IStorage interface associated with this storage document object.

Definition at line 155 of file stgdoc.h.

◆ GetProperty()

int ocf::TStorageDocument::GetProperty ( int index,
void * dest,
int textlen = 0 )
virtual

◆ GetStorage()

IStorage * ocf::TStorageDocument::GetStorage ( )
inline

Return the IStorage interface pointer currently associated with the storage document object.

Returns 0 if no storage is currently opened.

Definition at line 139 of file stgdoc.h.

◆ GetThisOpen()

int ocf::TStorageDocument::GetThisOpen ( )
inlineprotected

Return the mode bits used to open the storage currently associated with this storage object.

Definition at line 147 of file stgdoc.h.

◆ InStream()

TInStream * ocf::TStorageDocument::InStream ( int omode,
LPCTSTR strmId = 0 )
virtual

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.

◆ IsOpen()

bool ocf::TStorageDocument::IsOpen ( )
inlinevirtual

Return 'true' if the storage document object has opened an OLE storage.

Return 'false' otherwise.

Reimplemented from owl::TDocument.

Definition at line 122 of file stgdoc.h.

◆ Open()

◆ OpenHandle()

bool ocf::TStorageDocument::OpenHandle ( int omode,
HANDLE hGlobal )
virtual

◆ OutStream()

TOutStream * ocf::TStorageDocument::OutStream ( int omode,
LPCTSTR strmId = 0 )
virtual

◆ PropertyCount()

int ocf::TStorageDocument::PropertyCount ( )
inlinevirtual

Return the number of properties supported by the storage document object.

Note
The number includes the inherited properties of the storage

Reimplemented from owl::TDocument.

Definition at line 131 of file stgdoc.h.

References NextProperty.

◆ PropertyFlags()

int ocf::TStorageDocument::PropertyFlags ( int index)
virtual

Reimplemented from owl::TDocument.

Definition at line 693 of file stgdoc.cpp.

References NextProperty, PrevProperty, and owl::TDocument::PropertyFlags().

◆ PropertyName()

LPCTSTR ocf::TStorageDocument::PropertyName ( int index)
virtual

Reimplemented from owl::TDocument.

Definition at line 679 of file stgdoc.cpp.

References NextProperty, PrevProperty, and owl::TDocument::PropertyName().

◆ ReleaseDoc()

bool ocf::TStorageDocument::ReleaseDoc ( )
virtual

Release the IStorage and close the document.

Reimplemented in ocf::TOleDocument.

Definition at line 209 of file stgdoc.cpp.

References Close().

◆ RestoreStorage()

bool ocf::TStorageDocument::RestoreStorage ( )
virtual

Restore the original root IStorage before the save operation.

Reimplemented in ocf::TOleDocument.

Definition at line 384 of file stgdoc.cpp.

◆ Revert()

bool ocf::TStorageDocument::Revert ( bool clear = false)
virtual

Reimplemented from owl::TDocument.

Definition at line 643 of file stgdoc.cpp.

References owl::TDocument::Revert(), and owl::TDocument::SetDirty().

◆ SetDocPath()

bool ocf::TStorageDocument::SetDocPath ( LPCTSTR path)
virtual

Reimplemented from owl::TDocument.

Definition at line 602 of file stgdoc.cpp.

References owl::TDocument::SetDocPath().

◆ SetHandle()

bool ocf::TStorageDocument::SetHandle ( int omode,
HANDLE hGlobal,
bool create = false,
bool remember = false )
virtual

◆ SetProperty()

bool ocf::TStorageDocument::SetProperty ( int index,
const void * src )
virtual

Reimplemented from owl::TDocument.

Definition at line 788 of file stgdoc.cpp.

References owl::TDocument::SetProperty().

◆ SetStorage()

bool ocf::TStorageDocument::SetStorage ( IStorage * stg,
bool remember = true )
virtual

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().

Friends And Related Symbol Documentation

◆ TStorageInStream

friend class TStorageInStream
friend

Definition at line 97 of file stgdoc.h.

◆ TStorageOutStream

friend class TStorageOutStream
friend

Definition at line 98 of file stgdoc.h.


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