|
OWLNext 6.32
|
#include <doctpl.h>
Public Member Functions | |
| virtual TDocument * | ConstructDoc (TDocument *parent=0)=0 |
| virtual TView * | ConstructView (TDocument &doc)=0 |
| virtual TDocument * | IsMyKindOfDoc (TDocument &doc)=0 |
| virtual TView * | IsMyKindOfView (TView &view)=0 |
| virtual LPCTSTR | GetViewName ()=0 |
| bool | IsVisible () |
| virtual TDocTemplate * | Clone (TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead)=0 |
| TDocManager * | GetDocManager () const |
| void | SetDocManager (TDocManager *dm) |
| LPCTSTR | GetDirectory () const |
| void | SetDirectory (LPCTSTR) |
| void | SetDirectory (LPCTSTR, int len) |
| TDocTemplate * | GetNextTemplate () const |
| bool | IsFlagSet (long flag) const |
| long | GetFlags () const |
| void | SetFlag (long flag) |
| void | ClearFlag (long flag) |
| bool | IsStatic () const |
| TModule *& | GetModule () |
| void | SetModule (TModule *module) |
| int | GetRefCount () const |
| LPCTSTR | GetFileFilter () const |
| LPCTSTR | GetDescription () const |
| LPCTSTR | GetDefaultExt () const |
| void | SetFileFilter (LPCTSTR) |
| void | SetDescription (LPCTSTR) |
| void | SetDefaultExt (LPCTSTR) |
Protected Member Functions | |
| TDocTemplate (TRegList ®List, TModule *&module, TDocTemplate *&phead) | |
| ~TDocTemplate () | |
| TDocTemplate (LPCTSTR desc, LPCTSTR filt, LPCTSTR dir, LPCTSTR ext, long flags, TModule *&module, TDocTemplate *&phead) | |
| DECLARE_ABSTRACT_STREAMABLE_OWL (owl::TDocTemplate, 1) | |
Friends | |
| class | TDocument |
| class | TDocManager |
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.
| owl::TDocTemplate::TDocTemplate | ( | TRegList & | regList, |
| TModule *& | module, | ||
| TDocTemplate *& | rptpl | ||
| ) | [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.
References owl::TRegLink::RegList.
| owl::TDocTemplate::~TDocTemplate | ( | ) | [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.
References owl::dtDynRegInfo, GetFlags(), and owl::TRegLink::RegList.
| owl::TDocTemplate::TDocTemplate | ( | LPCTSTR | desc, |
| LPCTSTR | filt, | ||
| LPCTSTR | dir, | ||
| LPCTSTR | ext, | ||
| long | flags, | ||
| TModule *& | module, | ||
| TDocTemplate *& | rphead | ||
| ) | [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.
References owl::TRegLink::AddLink(), and owl::TRegLink::RegList.
| void owl::TDocTemplate::ClearFlag | ( | long | flag | ) |
Clears a document template constant.
References GetFlags().
| virtual TDocTemplate* owl::TDocTemplate::Clone | ( | TModule * | module, |
| TDocTemplate *& | phead = ::DocTemplateStaticHead |
||
| ) | [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 >.
| 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.
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.
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.
References owl::TRegLink::RegList.
| TDocManager * owl::TDocTemplate::GetDocManager | ( | ) | const [inline] |
Points to the document manager.
| LPCTSTR owl::TDocTemplate::GetFileFilter | ( | ) | const |
Gets any valid document matching pattern to use when searching for files.
References owl::TRegLink::RegList.
| long owl::TDocTemplate::GetFlags | ( | ) | const [inline] |
Gets the document template constants, which indicate how the document is created and opened.
| TModule *& owl::TDocTemplate::GetModule | ( | ) | [inline] |
Returns a module pointer.
| TDocTemplate * owl::TDocTemplate::GetNextTemplate | ( | ) | const [inline] |
Gets the next template in the list of templates.
References owl::TRegLink::Next.
| int owl::TDocTemplate::GetRefCount | ( | ) | const [inline] |
Return the number of reference count of the template.
| virtual LPCTSTR owl::TDocTemplate::GetViewName | ( | ) | [pure virtual] |
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 >.
| bool owl::TDocTemplate::IsFlagSet | ( | long | flag | ) | const [inline] |
Returns nonzero if the document template flag is set.
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 >.
| bool owl::TDocTemplate::IsStatic | ( | ) | const [inline] |
Returns true if the template is statically constructed.
| bool owl::TDocTemplate::IsVisible | ( | ) | [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.
References owl::dtHidden, and GetFlags().
| void owl::TDocTemplate::SetDirectory | ( | LPCTSTR | txt | ) |
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.
| void owl::TDocTemplate::SetDirectory | ( | LPCTSTR | txt, |
| int | len | ||
| ) |
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.
| void owl::TDocTemplate::SetDocManager | ( | TDocManager * | dm | ) | [inline] |
Sets the current document manager to the argument dm.
| void owl::TDocTemplate::SetFlag | ( | long | flag | ) |
Sets the document template constants, which indicate how the document is created and opened.
References GetFlags().
| void owl::TDocTemplate::SetModule | ( | TModule * | module | ) | [inline] |
Sets a module pointer.
1.7.4