OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TDocTemplate is an abstract base class that contains document template functionality. More...
#include <owl/doctpl.h>
Public Member Functions | |
virtual TDocument * | ConstructDoc (TDocument *parent=nullptr)=0 |
A pure virtual function that must be defined in a derived class, ConstructDoc creates a document specified by the document template class. | |
virtual TView * | ConstructView (TDocument &doc)=0 |
A pure virtual function that must be defined in a derived class, ConstructView creates the view specified by the document template class. | |
virtual TDocument * | IsMyKindOfDoc (TDocument &doc)=0 |
A pure virtual function that must be defined in a derived class, IsMyKindOfDoc tests if the template belongs to the same class as the document or to a derived class. | |
virtual TView * | IsMyKindOfView (TView &view)=0 |
A pure virtual function that must be defined in a derived class, IsMyKindofView tests if the template belongs to the same class as the view or to a derived class. | |
virtual LPCTSTR | GetViewName ()=0 |
A pure virtual function that must be defined in a derived class, GetViewName gets the name of the view associated with the template. | |
bool | IsVisible () |
displayable in file select dialogs | |
virtual TDocTemplate * | Clone (TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead)=0 |
Makes a copy of a document template. | |
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 () |
Protected Member Functions | |
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. | |
Friends | |
class | TDocument |
class | TDocManager |
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 Attributes inherited from owl::TRegLink | |
TRegLink * | Next |
Next RegLink. | |
TRegList * | RegList |
Pointer to registration parameter table. | |
TDocTemplate is an abstract base class that contains document template functionality.
This document template class defines several functions that make it easier for you to use documents and their corresponding views. TDocTemplate classes create documents and views from resources and handle document naming and browsing. The document manager maintains a list of the current template objects. Each document type requires a separate document template.
|
protected |
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.
Then, adds this template to the document manager's template list. If the document manager is not yet constructed, adds the template to a static list, which the document manager will later add to its template list. The argument, module, specifies the TModule of the caller. phead specifies the template head for the caller's module. See the Registration macros entry in this manual for information about the registration macros that generate a TRegList, which contains the attributes used to create a TDocTemplate object.
Definition at line 32 of file doctpl.cpp.
References _ttol, and owl::TRegLink::RegList.
|
protected |
Destroys a TDocTemplate object and frees the data members (FileFilter, Description, Directory, and DefaultExt).
The Destructor is called only when no views or documents are associated with the template. Instead of calling this Destructor directly, use the Delete member function.
Definition at line 105 of file doctpl.cpp.
References owl::dtDynRegInfo, GetFlags(), and owl::TRegLink::RegList.
|
protected |
Constructs a Doc/View template from the description, filter, directory, file extension, 'dt' flags, module and template head parameters.
This constructor is primarily for backward compatibility with earlier implementation of ObjectWindows' Doc/View subsystem.
Definition at line 183 of file doctpl.cpp.
References owl::TRegLink::AddLink(), and owl::TRegLink::RegList.
Clears a document template constant.
Definition at line 55 of file doctpl.cpp.
References GetFlags().
|
pure virtual |
Makes a copy of a document template.
Implemented in owl::TDocTemplateT< D, V >.
A pure virtual function that must be defined in a derived class, ConstructDoc creates a document specified by the document template class.
Use this function in place of CreateDoc.
Implemented in owl::TDocTemplateT< D, V >.
A pure virtual function that must be defined in a derived class, ConstructView creates the view specified by the document template class.
Implemented in owl::TDocTemplateT< D, V >.
|
protected |
LPCTSTR owl::TDocTemplate::GetDefaultExt | ( | ) | const |
Gets the default extension to use if the user has entered the name of a file without any extension.
If there is no default extension, GetDefaultExt contains 0.
Definition at line 136 of file doctpl.cpp.
References owl::TRegLink::RegList.
LPCTSTR owl::TDocTemplate::GetDescription | ( | ) | const |
Gets the template description to put in the file-selection list box or the File|New menu-selection list box.
Definition at line 126 of file doctpl.cpp.
References owl::TRegLink::RegList.
LPCTSTR owl::TDocTemplate::GetDirectory | ( | ) | const |
Gets the directory path to use when searching for matching files.
This will get updated if a file is selected and the dtUpdateDir flag is set.
Definition at line 64 of file doctpl.cpp.
References owl::TRegLink::RegList.
|
inline |
LPCTSTR owl::TDocTemplate::GetFileFilter | ( | ) | const |
Gets any valid document matching pattern to use when searching for files.
Definition at line 117 of file doctpl.cpp.
References owl::TRegLink::RegList.
|
inline |
|
inline |
|
inline |
Gets the next template in the list of templates.
Definition at line 270 of file doctpl.h.
References owl::TRegLink::Next.
|
inline |
A pure virtual function that must be defined in a derived class, GetViewName gets the name of the view associated with the template.
Implemented in owl::TDocTemplateT< D, V >.
Returns nonzero if the document template flag is set.
Definition at line 278 of file doctpl.h.
References GetFlags().
A pure virtual function that must be defined in a derived class, IsMyKindOfDoc tests if the template belongs to the same class as the document or to a derived class.
Implemented in owl::TDocTemplateT< D, V >.
A pure virtual function that must be defined in a derived class, IsMyKindofView tests if the template belongs to the same class as the view or to a derived class.
Implemented in owl::TDocTemplateT< D, V >.
|
inline |
|
inline |
displayable in file select dialogs
Indicates whether the document can be displayed in the file selection dialog box.
A document is visible if dtHidden isn't set and Description isn't 0.
Definition at line 331 of file doctpl.h.
References owl::dtHidden, and GetFlags().
Sets the directory path to use when searching for matching files.
This will get updated if a file is selected and the dtUpdateDir flag is set.
Definition at line 75 of file doctpl.cpp.
References strnewdup().
Sets the directory path to use when searching for matching files.
This will get updated if a file is selected and the dtUpdateDir flag is set.
Definition at line 87 of file doctpl.cpp.
References strnewdup().
|
inline |
Sets the document template constants, which indicate how the document is created and opened.
Definition at line 47 of file doctpl.cpp.
References GetFlags().
|
friend |