OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TDocTemplate Class Referenceabstract

TDocTemplate is an abstract base class that contains document template functionality. More...

#include <owl/doctpl.h>

Inheritance diagram for owl::TDocTemplate:
owl::TRegLink owl::TStreamableBase owl::TDocTemplateT< D, V >

Public Member Functions

virtual TDocumentConstructDoc (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 TViewConstructView (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 TDocumentIsMyKindOfDoc (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 TViewIsMyKindOfView (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 TDocTemplateClone (TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead)=0
 Makes a copy of a document template.
 
TDocManagerGetDocManager () 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.
 
TDocTemplateGetNextTemplate () 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::TStreamableBase
virtual ~TStreamableBase ()
 

Protected Member Functions

 TDocTemplate (TRegList &regList, 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)
 

Friends

class TDocument
 
class TDocManager
 

Additional Inherited Members

Detailed Description

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.

Definition at line 54 of file doctpl.h.

Constructor & Destructor Documentation

◆ TDocTemplate() [1/2]

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.

Definition at line 32 of file doctpl.cpp.

References _ttol, and owl::TRegLink::RegList.

◆ ~TDocTemplate()

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.

Definition at line 105 of file doctpl.cpp.

References owl::dtDynRegInfo, GetFlags(), and owl::TRegLink::RegList.

◆ TDocTemplate() [2/2]

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.

Definition at line 183 of file doctpl.cpp.

References owl::TRegLink::AddLink(), and owl::TRegLink::RegList.

Member Function Documentation

◆ ClearFlag()

void owl::TDocTemplate::ClearFlag ( long flag)

Clears a document template constant.

Definition at line 55 of file doctpl.cpp.

References GetFlags().

◆ Clone()

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

◆ ConstructDoc()

virtual TDocument * owl::TDocTemplate::ConstructDoc ( TDocument * parent = nullptr)
pure virtual

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

◆ ConstructView()

virtual TView * owl::TDocTemplate::ConstructView ( TDocument & doc)
pure virtual

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

◆ DECLARE_ABSTRACT_STREAMABLE_OWL()

owl::TDocTemplate::DECLARE_ABSTRACT_STREAMABLE_OWL ( TDocTemplate ,
1  )
protected

◆ GetDefaultExt()

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.

◆ GetDescription()

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.

◆ GetDirectory()

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.

◆ GetDocManager()

TDocManager * owl::TDocTemplate::GetDocManager ( ) const
inline

Points to the document manager.

Definition at line 254 of file doctpl.h.

◆ GetFileFilter()

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.

◆ GetFlags()

long owl::TDocTemplate::GetFlags ( ) const
inline

Gets the document template constants, which indicate how the document is created and opened.

Definition at line 287 of file doctpl.h.

◆ GetModule()

TModule *& owl::TDocTemplate::GetModule ( )
inline

Returns a module pointer.

Definition at line 303 of file doctpl.h.

◆ GetNextTemplate()

TDocTemplate * owl::TDocTemplate::GetNextTemplate ( ) const
inline

Gets the next template in the list of templates.

Definition at line 270 of file doctpl.h.

References owl::TRegLink::Next.

◆ GetRefCount()

int owl::TDocTemplate::GetRefCount ( ) const
inline

Return the number of reference count of the template.

Note
The reference count of static templates has the high bit set.

Definition at line 312 of file doctpl.h.

◆ GetViewName()

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

◆ IsFlagSet()

bool owl::TDocTemplate::IsFlagSet ( long flag) const
inline

Returns nonzero if the document template flag is set.

Definition at line 278 of file doctpl.h.

References GetFlags().

◆ IsMyKindOfDoc()

virtual TDocument * owl::TDocTemplate::IsMyKindOfDoc ( TDocument & doc)
pure virtual

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

◆ IsMyKindOfView()

virtual TView * owl::TDocTemplate::IsMyKindOfView ( TView & view)
pure virtual

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

◆ IsStatic()

bool owl::TDocTemplate::IsStatic ( ) const
inline

Returns true if the template is statically constructed.

Definition at line 295 of file doctpl.h.

◆ IsVisible()

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.

Definition at line 331 of file doctpl.h.

References owl::dtHidden, and GetFlags().

◆ SetDirectory() [1/2]

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.

Definition at line 75 of file doctpl.cpp.

References strnewdup().

◆ SetDirectory() [2/2]

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.

Definition at line 87 of file doctpl.cpp.

References strnewdup().

◆ SetDocManager()

void owl::TDocTemplate::SetDocManager ( TDocManager * dm)
inline

Sets the current document manager to the argument dm.

Definition at line 262 of file doctpl.h.

◆ SetFlag()

void owl::TDocTemplate::SetFlag ( long flag)

Sets the document template constants, which indicate how the document is created and opened.

Definition at line 47 of file doctpl.cpp.

References GetFlags().

◆ SetModule()

void owl::TDocTemplate::SetModule ( TModule * module)
inline

Sets a module pointer.

Definition at line 320 of file doctpl.h.

Friends And Related Symbol Documentation

◆ TDocManager

Definition at line 128 of file doctpl.h.

◆ TDocument

Definition at line 127 of file doctpl.h.


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