OWLNext 7.0
Borland's Object Windows Library for the modern age
|
To register the associated document and view classes, a parameterized subclass, TDocTemplateT<D,V>, is used to construct a particular document and view, where D represents the document class and V represents the view class. More...
#include <owl/doctpl.h>
Public Member Functions | |
TDocTemplateT (TRegList ®List, TModule *&module=owl::Module, TDocTemplate *&phead=DocTemplateStaticHead) | |
Constructs a TDocTemplateT using the registration table to determine the file filter pattern, search path for viewing the directory, default file extension, and flag values. | |
TDocTemplateT (LPCTSTR desc, LPCTSTR filt, LPCTSTR dir, LPCTSTR ext, long flags=0, TModule *&module=owl::Module, TDocTemplate *&phead=DocTemplateStaticHead) | |
Constructs a TDocTemplateT with the specified file description (desc), file filter pattern (filt), search path for viewing the directory (dir), default file extension (ext), and flags representing the view and creation options (flags). | |
TDocTemplateT * | Clone (TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead) |
Makes a copy of the TDocTemplateT object. | |
D * | ConstructDoc (TDocument *parent=nullptr) |
'Factory' method to create a new document of type 'D' using the specified parameter as the parent document. | |
V * | ConstructView (TDocument &doc) |
'Factory' method to create a new view of type 'V' from the specified document parameter. | |
D * | IsMyKindOfDoc (TDocument &doc) |
Returns 0 if template can't support. | |
V * | IsMyKindOfView (TView &view) |
Returns 0 if template incompatible. | |
virtual LPCTSTR | GetViewName () |
Gets the name of the view associated with the template. | |
Public Member Functions inherited from owl::TDocTemplate | |
bool | IsVisible () |
displayable in file select dialogs | |
TDocManager * | GetDocManager () const |
Points to the document manager. | |
void | SetDocManager (TDocManager *dm) |
Sets the current document manager to the argument dm. | |
LPCTSTR | GetDirectory () const |
Gets the directory path to use when searching for matching files. | |
void | SetDirectory (LPCTSTR) |
Sets the directory path to use when searching for matching files. | |
void | SetDirectory (LPCTSTR, int len) |
Sets the directory path to use when searching for matching files. | |
TDocTemplate * | GetNextTemplate () const |
Gets the next template in the list of templates. | |
bool | IsFlagSet (long flag) const |
Returns nonzero if the document template flag is set. | |
long | GetFlags () const |
Gets the document template constants, which indicate how the document is created and opened. | |
void | SetFlag (long flag) |
Sets the document template constants, which indicate how the document is created and opened. | |
void | ClearFlag (long flag) |
Clears a document template constant. | |
bool | IsStatic () const |
Returns true if the template is statically constructed. | |
TModule *& | GetModule () |
Returns a module pointer. | |
void | SetModule (TModule *module) |
Sets a module pointer. | |
int | GetRefCount () const |
Return the number of reference count of the template. | |
LPCTSTR | GetFileFilter () const |
Gets any valid document matching pattern to use when searching for files. | |
LPCTSTR | GetDescription () const |
Gets the template description to put in the file-selection list box or the File|New menu-selection list box. | |
LPCTSTR | GetDefaultExt () const |
Gets the default extension to use if the user has entered the name of a file without any extension. | |
Public Member Functions inherited from owl::TRegLink | |
TRegLink (TRegList ®List, TRegLink *&head) | |
Constructs a reglink pointing to a reglist, and adds it to the end of the list. | |
virtual | ~TRegLink () |
Registration link node destructor. | |
TRegLink * | GetNext () const |
Returns a pointer to the next link. | |
void | SetNext (TRegLink *link) |
TRegList & | GetRegList () const |
Returns a pointer to the registration parameter table (reglist). | |
Public Member Functions inherited from owl::TStreamableBase | |
virtual | ~TStreamableBase () |
Additional Inherited Members | |
Static Public Member Functions inherited from owl::TRegLink | |
static void | AddLink (TRegLink **head, TRegLink *newLink) |
Adds a new link to the end of the link list. | |
static bool | RemoveLink (TRegLink **head, TRegLink *remLink) |
Removes a link from the link list. Returns true if the link is found and removed. | |
Protected Member Functions inherited from owl::TDocTemplate | |
TDocTemplate (TRegList ®List, TModule *&module, TDocTemplate *&phead) | |
Uses the information in the registration table (regList) to construct a TDocTemplate with the specified file description, file filter pattern, search path for viewing the directory, default file extension, and flags representing the view and creation options from the registration list. | |
~TDocTemplate () | |
Destroys a TDocTemplate object and frees the data members (FileFilter, Description, Directory, and DefaultExt). | |
TDocTemplate (LPCTSTR desc, LPCTSTR filt, LPCTSTR dir, LPCTSTR ext, long flags, TModule *&module, TDocTemplate *&phead) | |
Constructs a Doc/View template from the description, filter, directory, file extension, 'dt' flags, module and template head parameters. | |
DECLARE_ABSTRACT_STREAMABLE_OWL (TDocTemplate, 1) | |
Protected Member Functions inherited from owl::TRegLink | |
TRegLink () | |
Derived class must fill in ptrs. | |
Protected Attributes inherited from owl::TRegLink | |
TRegLink * | Next |
Next RegLink. | |
TRegList * | RegList |
Pointer to registration parameter table. | |
To register the associated document and view classes, a parameterized subclass, TDocTemplateT<D,V>, is used to construct a particular document and view, where D represents the document class and V represents the view class.
The parameterized template classes are created using a macro, which also generates the associated streamable support. The document and view classes are provided through the use of a parameterized subclass. The template class name is used as a typedef for the parameterized class. For example,
You can instantiate a document template using either a static member or an explicit construction. For example,
When a document template is created, the document manager (TDocManager) registers the template. When the document template's delete function is called to delete the template, it is no longer visible to the user. However, it remains in memory as long as any documents still use it.
|
inline |
Constructs a TDocTemplateT using the registration table to determine the file filter pattern, search path for viewing the directory, default file extension, and flag values.
See the entry in this manual for registration macros for more information about how the registration tables are created. module, which is instantiated and exported directly from every executable module, can be used to access the current instance.
|
inline |
Constructs a TDocTemplateT with the specified file description (desc), file filter pattern (filt), search path for viewing the directory (dir), default file extension (ext), and flags representing the view and creation options (flags).
module, which is instantiated and exported directly from every executable module, can be used to access the current instance.
|
inlinevirtual |
Makes a copy of the TDocTemplateT object.
Implements owl::TDocTemplate.
'Factory' method to create a new document of type 'D' using the specified parameter as the parent document.
Implements owl::TDocTemplate.
|
inlinevirtual |
'Factory' method to create a new view of type 'V' from the specified document parameter.
Implements owl::TDocTemplate.
Gets the name of the view associated with the template.
Implements owl::TDocTemplate.
|
virtual |
Returns 0 if template can't support.
Tests to see if the document (doc) is either the same class as the template's document class or a derived class.
If the template can't use the document, IsMyKIndOfDoc returns 0.
Implements owl::TDocTemplate.
Returns 0 if template incompatible.
Tests to see if the view (view) is either the same class as the template's view class or a derived class.
If the template can't use the view, IsMyKIndOfView returns 0.
Implements owl::TDocTemplate.