OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Derived from TDocument, TFileDocument opens and closes views and provides stream support for views. More...
#include <owl/filedoc.h>
Public Types | |
enum | TFileDocProp { PrevProperty = TDocument::NextProperty-1 , CreateTime , ModifyTime , AccessTime , StorageSize , FileHandle , NextProperty } |
Contains constants that define the following properties of the document: More... | |
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 | |
bool | Open (int mode, LPCTSTR path=0) |
Overrides TDocument::Open and opens the file using the specified path. | |
bool | Close () |
< String-aware overload | |
TInStream * | InStream (int mode, LPCTSTR strmId=0) |
Overrides TDocument::InStream and provides generic input for the particular storage medium. | |
TOutStream * | OutStream (int mode, LPCTSTR strmId=0) |
< String-aware overload | |
bool | Commit (bool force=false) |
< String-aware overload | |
bool | Revert (bool clear=false) |
Calls TDocument::Revert to notify the views to refresh their data. | |
int | FindProperty (LPCTSTR name) |
return index | |
int | PropertyFlags (int index) |
< String-aware overload | |
LPCTSTR | PropertyName (int index) |
Returns the text name of the property given the index value. | |
int | GetProperty (int index, void *dest, int textlen=0) |
Overrides TDocument::GetProperty. | |
bool | SetProperty (int index, const void *src) |
Sets the property data, which must be in the native data type (either string or binary). | |
bool | Open (HFILE fhdl) |
open on existing file handle | |
virtual bool | Open (int mode, LPCTSTR path=nullptr) |
Opens the document using the path specified by DocPath. | |
bool | Open (int mode, const tstring &path) |
virtual TInStream * | InStream (int mode, LPCTSTR strmId=nullptr) |
Generic input for the particular storage medium, InStream returns a pointer to a TInStream. | |
TInStream * | InStream (int mode, const tstring &streamId) |
virtual TOutStream * | OutStream (int mode, LPCTSTR strmId=nullptr) |
Generic output for the particular storage medium, OutStream returns a pointer to a TOutStream. | |
TOutStream * | OutStream (int mode, const tstring &streamId) |
virtual int | FindProperty (LPCTSTR name) |
return property index | |
int | FindProperty (const tstring &name) |
TFileDocument (TDocument *parent=0) | |
Constructs a TFileDocument object with the optional parent document. | |
~TFileDocument () | |
Destroys a TFileDocument object. | |
bool | IsOpen () |
Is nonzero if the document or any streams are open. | |
int | PropertyCount () |
Return the number of property support by this document. | |
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. | |
virtual bool | SetDocPath (LPCTSTR path) |
Sets the document path for Open and Save operations. | |
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 | |
HFILE | OpenThisFile (int omode, const tstring &fileName, std::streampos *pseekpos) |
Opens the file document after checking the file sharing mode (omode). | |
void | CloseThisFile (HFILE fhdl, int omode) |
Closes the file handle if the associated file was opened by TFileDocument. | |
Protected Member Functions inherited from owl::TDocument | |
virtual void | AttachStream (TStream &strm) |
called from TStream constructor | |
virtual void | DetachStream (TStream &strm) |
called from TStream destructor | |
void | DestroyViews () |
Destroys the views attached to this document. | |
void | DestroyChildren () |
Destroy children first if we have any. | |
Friends | |
class | TFileInStream |
class | TFileOutStream |
Derived from TDocument, TFileDocument opens and closes views and provides stream support for views.
TFileDocument has member functions that continue to process FileNew and FileOpen messages after a view is constructed. You can add support for specialized file types by deriving classes from TFileDocument. TFileDocument makes this process easy by hiding the actual process of storing file types.
return property index
Gets the property index, given the property name (name).
Returns either the integer index number that corresponds to the name or 0 if the name isn't found in the list of properties.
Reimplemented from owl::TDocument.
Definition at line 277 of file document.cpp.
Generic input for the particular storage medium, InStream returns a pointer to a TInStream.
mode is a combination of the ios bits defined in iostream.h. See the document open mode constants for a list of the open modes. Used for documents that support named streams, strmId is a pointer to the name of a stream. Override this function to provide streaming for your document class.
Reimplemented from owl::TDocument.
Opens the document using the path specified by DocPath.
Sets OpenMode to mode. TDocument::Open always returns true and actually performs no actions. Other classes override this function to open specified file documents and views.
Reimplemented from owl::TDocument.
|
inline |
|
inlinevirtual |
Generic output for the particular storage medium, OutStream returns a pointer to a TOutStream.
mode is a combination of the ios bits defined in iostream.h. Used for documents that support named streams, strmId points to the name of the stream. TDocument::OutStream version always returns 0. Override this function to provide streaming for your document class.
Reimplemented from owl::TDocument.