9#if !defined(OWL_DOCMANAG_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
45 OFN_ALLOWMULTISELECT |
46 OFN_ENABLETEMPLATEHANDLE;
109 TView* ofViewType =
nullptr);
117 int tplcount,
tchar* buff =
nullptr,
125 TDocument* parent=
nullptr,
long flags=0);
145 static bool IsAMatch(LPCTSTR path, LPCTSTR fltr);
146 static bool MatchFilter(LPCTSTR path, LPCTSTR filters);
196 uint choice = MB_OK);
228 tchar * path,
int buflen,
229 long flags,
bool save=
false,
TDocument* doc =
nullptr);
247 long AdditionalFileDialogFlags;
282 int filterIndex,
TDocTemplate **tmplList,
int tmplCount);
326 LPCTSTR title =
nullptr,
TModule* module =
nullptr);
342 LPCTSTR title =
nullptr,
TModule* module =
nullptr);
352#define EV_WM_PREPROCMENU OWL_EV_(WM_OWLPREPROCMENU, EvPreProcessMenu)
353#define EV_WM_CANCLOSE OWL_EV_(WM_OWLCANCLOSE, EvCanClose)
354#define EV_WM_WAKEUP OWL_EV_(WM_OWLWAKEUP, EvWakeUp)
374 ::InterlockedIncrement(&tpl.RefCnt);
383 if (::InterlockedDecrement(&tpl.RefCnt) == 0)
401 return (Mode & flag) != 0;
454 return AdditionalFileDialogFlags;
462 AdditionalFileDialogFlags = flags;
Definition of class TApplication.
Derived from TModule and TMsgThread and virtually derived from TEventHandler, TApplication acts as an...
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
TDocManager creates a document manager object that manages the list of current documents and register...
virtual void ViewCreate()
Calls CreateAnyView(*doc) where doc is the current document.
void CmFileSaveAs()
Public to allow direct invocation from app; for backward compatibility.
TView * CreateView(TDocument &doc, TDocTemplate *tpl=nullptr)
Create a view on a given document using the given tempalte, or document's template if none given,...
bool EvCanClose()
Checks to see if all child documents can be closed before closing the current document.
TDocument * CreateDummyDoc()
Creates dummy document.
virtual void PostEvent(int id, TDocument &doc)
changed doc status
virtual uint PostDocError(TDocument &doc, uint sid, uint choice=MB_OK)
Displays a message box with the error message passed as a string resource ID in sid.
int GetTemplateCount(TDocument *ofDocType=nullptr, TView *ofViewType=nullptr)
Count the number of templates, filtering by document type and/or view type as indicated.
virtual int SelectViewType(TDocTemplate **tpllist, int tplcount)
Given a list of templates, lets the user select a view name for a new view from a list of view names.
static bool MatchFilter(LPCTSTR path, LPCTSTR filters)
Helper function used by 'MatchTemplate'.
void EvWakeUp()
Used only after streaming in the doc manager, EvWakeUp allows for the windows to be created after the...
int GetModeFlags() const
Returns variable representing the dtXXXX flags [see DOCTPL.H for list] of the DocManager.
virtual bool FlushDoc(TDocument &doc)
Method invoked when specified document is about to be closed.
uint NextViewId
Next ID to be assigned to a view.
bool IsFlagSet(int flag) const
Returns true if the specified flag is currently enabled by the DocManager or false otherwise.
bool NotifyAllDocs(int event, long item, TView *exclude)
Notifies the views of all documents and the views of any child documents of a change.
virtual int GetNewTemplates(TDocTemplate **tplList, int size, bool newDoc)
Build a list of templates for creating new documents or opening existing documents.
virtual void UpdateFileMenu(TMenu &menubar)
Update the specified menu bar by removing the current '&File' popup menu [assumed to be the first pop...
virtual void FileSaveAs()
SelectAnySave() is called to get a template.
friend class TDocTemplate
virtual TView * CreateAnyView(TDocument &doc, long flags=0)
Creates a document view based on the directory path and specified template.
int UntitledIndex
Index of last untitled document.
TApplication * GetApplication() const
Returns the TApplication* object associated with this DocManager.
void CmFileOpen()
Public to allow direct invocation from app; for backward compatibility.
TDocument * InitDoc(TDocument *doc, LPCTSTR path, long flags)
Initializes the document, using the given path for the document and the given document flags.
virtual TDocument * CreateDoc(TDocTemplate *tpl, LPCTSTR path, TDocument *parent=nullptr, long flags=0)
CreateDoc creates a document based on the directory path and the specified template.
long GetAdditionalFileDialogFlags() const
See SelectDocPath for details.
TDocManager(int mode, TApplication *app, TDocTemplate *&templateHead=DocTemplateStaticHead)
The constructor performs the same operations as the first constructor.
void CmFileSave()
Public to allow direct invocation from app; for backward compatibility.
virtual int GetTemplateDescription(TDocTemplate **tpllist, int tplcount, tchar *buff=nullptr, int size=0)
Build up a long string containing the template descriptions and file filters for every template in th...
void CmViewCreate()
Public to allow direct invocation from app; for backward compatibility.
TDocument * FindDocument(LPCTSTR path)
0 if not found
TDocument::List & GetDocList()
Returns a List of document currently managed by the DocManager.
void UnRefTemplate(TDocTemplate &)
drop template ref
virtual bool CreatingDoc(TDocTemplate *tpl)
Overrideable method invoked just before the DocumentManager creates a new document.
void SetAdditionalFileDialogFlags(long)
See SelectDocPath for details.
virtual int GetSaveTemplates(TDocTemplate **tplList, int size, TDocument &doc, bool sameDoc)
Build a list of templates for saving documents.
void Init(int mode, TApplication *app, TDocTemplate *&templateHead)
Helper routine used by constructor(s).
virtual TDocument * CreateAnyDoc(LPCTSTR path, long flags=0)
Creates a document based on the directory path and the specified template.
static bool IsAMatch(LPCTSTR path, LPCTSTR fltr)
Helper function used by 'MatchTemplate'.
bool SelectSave(TDocument &doc)
Displays FileSave dialog prompting the user to select a file name for savinng the document.
void EvPreProcessMenu(HMENU hMenu)
Preprocess the app frame's menu to replace the file menu with one managed by this docmanager.
virtual TDocument * GetCurrentDoc()
Return doc with focus, else 0.
void DeleteTemplate(TDocTemplate &)
remove from list
virtual void FileClose()
If the document can be closed it is closed.
int & GetUntitledIndex()
Returns the index to be used by an untitled document.
virtual void FileRevert()
void CmFileRevert()
Public to allow direct invocation from app; for backward compatibility.
void CmFileNew()
Public to allow direct invocation from app; for backward compatibility.
virtual TDocTemplate * MatchTemplate(LPCTSTR path)
Returns the first registered template whose pattern matches the given file name.
void RefTemplate(TDocTemplate &)
add template ref
virtual TDocTemplate * SelectAnySave(TDocument &doc, bool samedoc=true)
Select a new docpath for a document from the registered templates supporting the doc.
void CmFileClose()
Public to allow direct invocation from app; for backward compatibility.
virtual int SelectDocPath(TDocTemplate **tpllist, int tplcount, tchar *path, int buflen, long flags, bool save=false, TDocument *doc=nullptr)
Given a list of templates, prompts the user to select one of the templates to use for the file to be ...
virtual int SelectDocType(TDocTemplate **tpllist, int tplcount)
Given a list of templates, lets the user select a document type from a list of document templates.
TDocTemplate * GetNextTemplate(TDocTemplate *tpl) const
Returns template following specified template - Pass in '0' as parameter to get pointer to the templa...
virtual int GetViewTemplates(TDocTemplate **tplList, int size, TDocument &doc)
Build a list of templates for creating views.
void AttachTemplate(TDocTemplate &)
append to list
TDocTemplate * GetTemplateList() const
Returns a pointer to the list of DocView templates currently registered with the DocManager.
TDocTemplate is an abstract base class that contains document template functionality.
TDocTemplate * GetNextTemplate() const
Gets the next template in the list of templates.
TDocument(TDocument *parent=nullptr)
Although you do not create a TDocument object directly, you must call the constructor when you create...
TDvFileOpenDialog(TWindow *parent, TDvOpenSaveData &data, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructor of object encapsulating the Open File dialog used by the DocManager.
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Overriden virtual function of TFileOpenDialog to allow us to detect when the user switches between fi...
TDvFileSaveDialog(TWindow *parent, TDvOpenSaveData &data, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructor of object encapsulating the FileSave dialog used by the DocManager.
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Overriden virtual function of TFileOpenDialog to allow us to detect when the user switches between fi...
TDvOpenSaveData encapsulates the information used to initialized the Open or Save As dialog box by Ob...
int TmplIndex
Index of the default template.
int TmplCount
Number of Doc/View templates in 'TmplList'.
TDocTemplate ** TmplList
List of Doc/View templates displayed in Common Dialog during a File|Open or File|SaveAs operation.
TDvOpenSaveData(uint32 flags, tchar *filter, tchar *initialDir, tchar *defExt, int filterIndex, TDocTemplate **tmplList, int tmplCount)
Constructor of class representing the data to be displayed in the Open/Save dialogs used by the DocMa...
TDocTemplate ** GetTmplList() const
Returns the list of templates displayed in the Open or Save dialogs used by the DocManager.
int GetTmplCount() const
Returns the number of DocView templates currently displayed in the Open or Save dialogs used by the D...
TDvOpenSaveDataOwner(TDvOpenSaveData &data)
Constructor of mixin.
int GetTmplCount() const
Returns the number of DocView templates currently displayed in the Open or Save dialogs used by the D...
TDocTemplate ** GetTmplList() const
Returns the list of templates displayed in the Open or Save dialogs used by the DocManager.
TEventHandler is a base class from which you can derive classes that handle messages.
TFileOpenDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructs and initializes the TFileOpen object based on information in the TOpenSaveDialog::TData da...
TFileSaveDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Constructs and initializes the TFileOpen object based on the TOpenSaveDialog::TData structure,...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TOpenSaveDialog structure contains information about the user's file open or save selection.
Classes that inherit from TStreamableBase are known as streamable classes (their objects can be writt...
Abstract base class for view access from document.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition of class TDocTemplate, and class template TDocTemplateT<D,V>.
owl::TDocTemplate * DocTemplateStaticHead
Templates constructed before app get linked onto this head pointer.
Definition of classes TDocument, TView, TWindowView, TStream, TInStream, TOutStream.
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
const uint dtProhibited
Flags which are stripped off when invoking Open/Save dialogs [See SelectDocPath() method for more inf...
const uint dmNoRevert
Disable FileRevert menu item.
const uint dmSDI
Does not support multiple open documents.
const uint dmMenu
Set IDs for file menu.
const uint dmSaveEnable
Enable FileSave even if doc is unmodified.
const uint dmMDI
Supports multiple open documents.
@ dnRename
Document has been renamed.
@ dnCreate
New document or view has been created.
@ dnClose
Document or view has been closed.
Object Windows Library (OWLNext Core).
UINT TMsgId
Message ID type.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
Definition of TOpenSave abstract, TFileOpen, TFileSave common Dialog classes.