8#if !defined(OWL_DOCTPL_H)
12#if defined(BI_HAS_PRAGMA_ONCE)
83#if !defined (BI_GLOBALNM_BUG)
97 bool IsFlagSet(
long flag)
const;
98 long GetFlags()
const;
99 void SetFlag(
long flag);
100 void ClearFlag(
long flag);
101 bool IsStatic()
const;
103 void SetModule(
TModule* module);
104 int GetRefCount()
const;
107 LPCTSTR GetDescription()
const;
134#define DECLARE_STREAMABLE_OPSDV( cls ) \
135static ipstream& readRef( ipstream& is, cls& cl ); \
136friend inline ipstream& operator >> ( ipstream& is, cls& cl ) \
137 { return cls::readRef( is, cl ); } \
138static ipstream& readPtr( ipstream& is, cls*& cl ); \
139friend inline ipstream& operator >> ( ipstream& is, cls*& cl ) \
140 { return cls::readPtr( is, cl ); } \
141static opstream& writeRef( opstream& is, const cls& cl ); \
142friend inline opstream& operator << ( opstream& os, const cls& cl ) \
143 { return cls::writeRef( os, cl ); } \
144static opstream& writePtr( opstream& is, const cls* cl ); \
145friend inline opstream& operator << ( opstream& os, const cls* cl ) \
146 { return cls::writePtr( os, cl ); }
173template<
class D,
class V>
182#if !defined (BI_GLOBALNM_BUG)
197#if OWL_PERSISTENT_STREAMS
297 return (RefCnt & 0x8000) != 0;
322 ModuleDeref =
module;
323 ModulePtr = &ModuleDeref;
344template<
class D,
class V>
inline
359template<
class D,
class V>
inline
376 tpl->SetModule(module);
384template<
class D,
class V>
inline D*
387 return new D(parent);
394template<
class D,
class V>
inline V*
397 return new V(
static_cast<D&
>(
doc));
403template<
class D,
class V>
inline LPCTSTR
406 return V::StaticName();
415template<
class D,
class V>
D*
418 return dynamic_cast<D*
>(&
doc);
425template<
class D,
class V>
V*
428 return dynamic_cast<V*
>(&
view);
431#define DEFINE_DOC_TEMPLATE_CLASS(docClass, viewClass, cls)\
432 typedef ::owl::TDocTemplateT<docClass, viewClass> cls;\
433 IMPLEMENT_STREAMABLE_CLASS(cls);\
434 IMPLEMENT_STREAMABLE_CTOR1_IMPL(template<>, cls, TDocTemplateT, ::owl::TDocTemplate)\
435 IMPLEMENT_STREAMABLE_POINTER_IMPL(template<>, cls)
TDocManager creates a document manager object that manages the list of current documents and register...
TDocTemplate is an abstract base class that contains document template functionality.
void SetDocManager(TDocManager *dm)
Sets the current document manager to the argument dm.
virtual LPCTSTR GetViewName()=0
A pure virtual function that must be defined in a derived class, GetViewName gets the name of the vie...
virtual TDocument * ConstructDoc(TDocument *parent=nullptr)=0
A pure virtual function that must be defined in a derived class, ConstructDoc creates a document spec...
DECLARE_ABSTRACT_STREAMABLE_OWL(TDocTemplate, 1)
bool IsFlagSet(long flag) const
Returns nonzero if the document template flag is set.
virtual TView * ConstructView(TDocument &doc)=0
A pure virtual function that must be defined in a derived class, ConstructView creates the view speci...
bool IsVisible()
displayable in file select dialogs
virtual TDocument * IsMyKindOfDoc(TDocument &doc)=0
A pure virtual function that must be defined in a derived class, IsMyKindOfDoc tests if the template ...
bool IsStatic() const
Returns true if the template is statically constructed.
virtual TDocTemplate * Clone(TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead)=0
Makes a copy of a document template.
int GetRefCount() const
Return the number of reference count of the template.
virtual TView * IsMyKindOfView(TView &view)=0
A pure virtual function that must be defined in a derived class, IsMyKindofView tests if the template...
TDocTemplate * GetNextTemplate() const
Gets the next template in the list of templates.
void SetModule(TModule *module)
Sets a module pointer.
TDocManager * GetDocManager() const
Points to the document manager.
long GetFlags() const
Gets the document template constants, which indicate how the document is created and opened.
TModule *& GetModule()
Returns a module pointer.
To register the associated document and view classes, a parameterized subclass, TDocTemplateT<D,...
D * ConstructDoc(TDocument *parent=nullptr)
'Factory' method to create a new document of type 'D' using the specified parameter as the parent doc...
virtual LPCTSTR GetViewName()
Gets the name of the view associated with the template.
TDocTemplateT * Clone(TModule *module, TDocTemplate *&phead=::DocTemplateStaticHead)
Makes a copy of the TDocTemplateT object.
V * ConstructView(TDocument &doc)
'Factory' method to create a new view of type 'V' from the specified document parameter.
TDocTemplateT(TRegList ®List, TModule *&module=owl::Module, TDocTemplate *&phead=DocTemplateStaticHead)
Constructs a TDocTemplateT using the registration table to determine the file filter pattern,...
D * IsMyKindOfDoc(TDocument &doc)
Returns 0 if template can't support.
V * IsMyKindOfView(TView &view)
Returns 0 if template incompatible.
An abstract base class, TDocument is the base class for all document objects and serves as an interfa...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
A linked structure in which each node points to a list of TRegList objects (or TRegList-derived objec...
TRegLink * Next
Next RegLink.
A registration parameter table, composed of a list of TRegItems.
Classes that inherit from TStreamableBase are known as streamable classes (their objects can be writt...
Abstract base class for view access from document.
owl::TDocTemplate * DocTemplateStaticHead
Templates constructed before app get linked onto this head pointer.
#define DECLARE_STREAMER_FROM_BASES(cls, base)
#define DECLARE_STREAMABLE_CTOR(cls)
#define DECLARE_STREAMABLE_INLINES(cls)
const uint dtAutoDelete
delete doc when last view is deleted
#define DECLARE_STREAMABLE_OPSDV(cls)
const uint dtPathMustExist
const uint dtFileMustExist
const uint dtNoTestCreate
const uint dtNewDoc
create new document, no path used
const uint dtNoAutoView
no automatic create of default view
const uint dtAutoOpen
open document upon creation
const uint dtForbidNew
forbids creating new document
const uint dtSingleUse
to be registered as single use
const uint dtRegisterExt
register extension with this app
const uint dtCreatePrompt
const uint dtHidden
hide template from user selection
const uint dtOverwritePrompt
const uint dtHideReadOnly
const uint dtDynRegInfo
reginfo table is dynamic, not static
const uint dtSelected
indicates template last selected
const uint dtSingleView
only a single view per document
const uint dtUpdateDir
syncronize directory with dialog dir
Object Windows Library (OWLNext Core)
General definitions used by all ObjectWindows programs.
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...