OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Doc/View class support the Doc/View model, a system in which data is contained in and accessed through a document object, and displayed and manipulated through a view object. More...
Classes | |
class | owl::TTreeViewCtrlView |
class | owl::TListViewCtrlView |
class | owl::TDocManager |
TDocManager creates a document manager object that manages the list of current documents and registered templates, handles standard file menu commands, and displays the user-interface for file and view selection boxes. More... | |
class | owl::TDvOpenSaveData |
TDvOpenSaveData encapsulates the information used to initialized the Open or Save As dialog box by ObjectWindows' DocView manager. More... | |
class | owl::TDvOpenSaveDataOwner |
TDvOpenSaveDataOwner is a mixin class used by the DocView encapsulation of the FileOpen and FileSave dialogs. More... | |
class | owl::TDvFileOpenDialog |
TDvFileOpenDialog encapsulates the FileOpen dialog used by the DocView manager. More... | |
class | owl::TDvFileSaveDialog |
TDvFileSaveDialog encapsulates the FileSave dialog used by the DocView manager. More... | |
class | owl::TDocTemplate |
TDocTemplate is an abstract base class that contains document template functionality. More... | |
class | owl::TDocTemplateT< D, V > |
To register the associated document and view classes, a parameterized subclass, TDocTemplateT<D,V>, is used to construct a particular document and view, where D represents the document class and V represents the view class. More... | |
class | owl::TDocument |
An abstract base class, TDocument is the base class for all document objects and serves as an interface between the document, its views, and the document manager (TDocManager class). More... | |
class | owl::TView |
Abstract base class for view access from document. More... | |
class | owl::TWindowView |
Derived from both TWindow and TView, TWindowView is a streamable base class that can be used for deriving window-based views. More... | |
class | owl::TDialogView |
Derived from TDialog and TView. More... | |
class | owl::TStream |
An abstract base class, TStream provides links between streams and documents, views, and document files. More... | |
class | owl::TInStream |
Derived from TStream and istream, TInStream is a base class used to define input streams for documents. More... | |
class | owl::TOutStream |
Derived from TStream and ostream, TOutStream is a base class used to create output storage streams for a document. More... | |
struct | owl::TDispatch< WM_OWLDOCUMENT > |
struct | owl::TDispatch< WM_OWLVIEW > |
struct | owl::TDispatch< WM_OWLNOTIFY > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnDocOpened > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnDocClosed > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnViewOpened > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnViewClosed > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnCommit > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnRevert > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnIsDirty > |
struct | owl::TDispatch< WM_OWLNOTIFY >::TNotificationDispatch< vnIsWindow > |
class | owl::TEditView |
Derived from TView and TEditSearch, TEditView provides a view wrapper for the ObjectWindows text edit class (TEdit). More... | |
class | owl::TFileDocument |
Derived from TDocument, TFileDocument opens and closes views and provides stream support for views. More... | |
class | owl::TListBoxView |
Provides views for list boxes. More... | |
class | owl::TPaneSplitterView |
Macros | |
#define | DECLARE_STREAMABLE_OPSDV(cls) |
#define | PREV_OPEN (ofNoCreate|ofNoReplace) |
#define | IS_PREV_OPEN(omode) ((omode & PREV_OPEN)==PREV_OPEN) |
#define | VN_DEFINE(id, method, dispatcher) {{WM_OWLNOTIFY}, static_cast<::owl::uint>(id), OWL_DISPATCH(dispatcher, method)} |
Defines a DocView notification response entry. | |
#define | VN_DEFINE_STANDARD_(id, method) |
Typedefs | |
typedef TTreeViewCtrlView | owl::TTreeWindowView |
Enumerations | |
enum | { owl::dnCreate , owl::dnClose , owl::dnRename } |
Definitions of dnXxx document/view message notifications. More... | |
enum | { owl::ofRead_workaround = std::ios::in , owl::ofWrite_workaround = std::ios::out } |
enum | owl::TDocMode { owl::ofParent = 0 , owl::ofRead = std::ios::in , owl::ofWrite = std::ios::out , owl::ofReadWrite = ofRead_workaround | ofWrite_workaround , owl::ofAtEnd = std::ios::ate , owl::ofAppend = std::ios::app , owl::ofTruncate = std::ios::trunc , owl::ofNoCreate = 0x40 , owl::ofNoReplace = 0x80 , owl::ofBinary = std::ios::binary , owl::ofIosMask = 0x00FF , owl::ofTransacted = 0x1000 , owl::ofPreserve = 0x2000 , owl::ofPriority = 0x4000 , owl::ofTemporary = 0x8000 , owl::shCompat = 0x0600 , owl::shNone = 0x0800 , owl::shRead = 0x0A00 , owl::shWrite = 0x0C00 , owl::shReadWrite = 0x0E00 , owl::shDefault = 0 , owl::shMask = (shCompat|shNone|shRead|shWrite) } |
Document open and sharing modes - used in storage and stream constructors. More... | |
enum | owl::TFileDocument::TFileDocProp { owl::TFileDocument::PrevProperty = TDocument::NextProperty-1 , owl::TFileDocument::CreateTime , owl::TFileDocument::ModifyTime , owl::TFileDocument::AccessTime , owl::TFileDocument::StorageSize , owl::TFileDocument::FileHandle , owl::TFileDocument::NextProperty } |
Contains constants that define the following properties of the document: More... | |
Functions | |
bool | owl::TFileDocument::Open (int mode, LPCTSTR path=0) |
Overrides TDocument::Open and opens the file using the specified path. | |
bool | owl::TFileDocument::Close () |
< String-aware overload | |
TInStream * | owl::TFileDocument::InStream (int mode, LPCTSTR strmId=0) |
Overrides TDocument::InStream and provides generic input for the particular storage medium. | |
TOutStream * | owl::TFileDocument::OutStream (int mode, LPCTSTR strmId=0) |
< String-aware overload | |
bool | owl::TFileDocument::Commit (bool force=false) |
< String-aware overload | |
bool | owl::TFileDocument::Revert (bool clear=false) |
Calls TDocument::Revert to notify the views to refresh their data. | |
int | owl::TFileDocument::FindProperty (LPCTSTR name) |
return index | |
int | owl::TFileDocument::PropertyFlags (int index) |
< String-aware overload | |
LPCTSTR | owl::TFileDocument::PropertyName (int index) |
Returns the text name of the property given the index value. | |
int | owl::TFileDocument::GetProperty (int index, void *dest, int textlen=0) |
Overrides TDocument::GetProperty. | |
bool | owl::TFileDocument::SetProperty (int index, const void *src) |
Sets the property data, which must be in the native data type (either string or binary). | |
bool | owl::TFileDocument::Open (HFILE fhdl) |
open on existing file handle | |
HFILE | owl::TFileDocument::OpenThisFile (int omode, const tstring &fileName, std::streampos *pseekpos) |
Opens the file document after checking the file sharing mode (omode). | |
void | owl::TFileDocument::CloseThisFile (HFILE fhdl, int omode) |
Closes the file handle if the associated file was opened by TFileDocument. | |
Variables | |
const uint | owl::dtProhibited |
Flags which are stripped off when invoking Open/Save dialogs [See SelectDocPath() method for more information ]. | |
const uint | owl::dtNewDoc = 0x80000000L |
create new document, no path used | |
const uint | owl::dtAutoDelete = 0x40000000L |
delete doc when last view is deleted | |
const uint | owl::dtNoAutoView = 0x20000000L |
no automatic create of default view | |
const uint | owl::dtSingleView = 0x10000000L |
only a single view per document | |
const uint | owl::dtAutoOpen = 0x08000000L |
open document upon creation | |
const uint | owl::dtUpdateDir = 0x04000000L |
syncronize directory with dialog dir | |
const uint | owl::dtHidden = 0x02000000L |
hide template from user selection | |
const uint | owl::dtSelected = 0x01000000L |
indicates template last selected | |
const uint | owl::dtDynRegInfo = 0x00800000L |
reginfo table is dynamic, not static | |
const uint | owl::dtSingleUse = 0x00400000L |
to be registered as single use | |
const uint | owl::dtRegisterExt = 0x00200000L |
register extension with this app | |
const uint | owl::dtForbidNew = 0x00100000L |
forbids creating new document | |
const uint | owl::dtReadOnly = 0x0001 |
const uint | owl::dtOverwritePrompt = 0x0002 |
const uint | owl::dtHideReadOnly = 0x0004 |
const uint | owl::dtPathMustExist = 0x0800 |
const uint | owl::dtFileMustExist = 0x1000 |
const uint | owl::dtCreatePrompt = 0x2000 |
const uint | owl::dtNoReadOnly = 0x8000 |
const uint | owl::dtNoTestCreate = 0x10000L |
Friends | |
class | owl::TFileDocument::TFileInStream |
class | owl::TFileDocument::TFileOutStream |
Definitions of dmXxx document manager operational mode flags | |
const uint | owl::dmSDI = 0x0001 |
Does not support multiple open documents. | |
const uint | owl::dmMDI = 0x0002 |
Supports multiple open documents. | |
const uint | owl::dmMenu = 0x0004 |
Set IDs for file menu. | |
const uint | owl::dmSaveEnable = 0x0010 |
Enable FileSave even if doc is unmodified. | |
const uint | owl::dmNoRevert = 0x0020 |
Disable FileRevert menu item. | |
Definitions of WM_OWLNOTIFY event IDs (view notifications) | |
event ID's up to vnCustomBase reserved for general doc-view notifications | |
const uint | owl::vnViewOpened = 1 |
a new view has just been constructed | |
const uint | owl::vnViewClosed = 2 |
another view is about to be destructed | |
const uint | owl::vnDocOpened = 3 |
document has just been opened | |
const uint | owl::vnDocClosed = 4 |
document has just been closed | |
const uint | owl::vnCommit = 5 |
document is committing, flush cached changes | |
const uint | owl::vnRevert = 6 |
document has reverted, reload data from doc | |
const uint | owl::vnIsDirty = 7 |
respond true if uncommitted changes present | |
const uint | owl::vnIsWindow = 8 |
respond true if passed HWND is that of view | |
const uint | owl::vnCustomBase = 100 |
base of document class specific notifications | |
Document and view property access flags | |
Define document and view property attributes. Documents, views, and applications use these attributes to determine how to process a document or view. | |
const uint | owl::pfGetText = 1 |
property accessible as text format | |
const uint | owl::pfGetBinary = 2 |
property accessible as native non-text format | |
const uint | owl::pfConstant = 4 |
property is invariant for object instance | |
const uint | owl::pfSettable = 8 |
property settable as native format | |
const uint | owl::pfUnknown = 16 |
property defined but unavailable in object | |
const uint | owl::pfHidden = 32 |
property should be hidden from normal browse | |
const uint | owl::pfUserDef =128 |
property has been user-defined at run time | |
owl::TFileDocument::TFileDocument (TDocument *parent=0) | |
Constructs a TFileDocument object with the optional parent document. | |
owl::TFileDocument::~TFileDocument () | |
Destroys a TFileDocument object. | |
bool | owl::TFileDocument::IsOpen () |
Is nonzero if the document or any streams are open. | |
int | owl::TFileDocument::PropertyCount () |
Return the number of property support by this document. | |
Custom OWL Window Messages | |
These macros handle OWL-defined window messages used internally by the framework: | |
#define | EV_WM_PREPROCMENU OWL_EV_(WM_OWLPREPROCMENU, EvPreProcessMenu) |
#define | EV_WM_CANCLOSE OWL_EV_(WM_OWLCANCLOSE, EvCanClose) |
#define | EV_WM_WAKEUP OWL_EV_(WM_OWLWAKEUP, EvWakeUp) |
Standard view notificaton events | |
These macros handle view-related messages generated by the document manager. | |
#define | EV_VN_VIEWOPENED VN_DEFINE_STANDARD_(::owl::vnViewOpened, VnViewOpened) |
#define | EV_VN_VIEWCLOSED VN_DEFINE_STANDARD_(::owl::vnViewClosed, VnViewClosed) |
#define | EV_VN_DOCOPENED VN_DEFINE_STANDARD_(::owl::vnDocOpened, VnDocOpened) |
#define | EV_VN_DOCCLOSED VN_DEFINE_STANDARD_(::owl::vnDocClosed, VnDocClosed) |
#define | EV_VN_COMMIT VN_DEFINE_STANDARD_(::owl::vnCommit, VnCommit) |
#define | EV_VN_REVERT VN_DEFINE_STANDARD_(::owl::vnRevert, VnRevert) |
#define | EV_VN_ISDIRTY VN_DEFINE_STANDARD_(::owl::vnIsDirty, VnIsDirty) |
#define | EV_VN_ISWINDOW VN_DEFINE_STANDARD_(::owl::vnIsWindow, VnIsWindow) |
Doc/View class support the Doc/View model, a system in which data is contained in and accessed through a document object, and displayed and manipulated through a view object.
Any number of views can be associated with a particular document type. Various classes control the flow of information within this system. Several classes also provide support for OLE's compound document and compound file structure within the Doc/View model.
TDocManager is the base class designed to handle documents, templates, messages and so on.
TDocument is
an abstract base class that serves as an interface between the document, its views and its document manager.TStorageDocument supports
OLE's compound file structure and lets you create compound documents with embedded objects.TOleDocument implements
the document half of an OLE-enabled Doc/View application.TView is
the base class that displays the document's data and gets user input.TListBoxView supports
views for list boxes.TEditView supports
views for edit control.TDialogView supports
views for dialog.TRichEditView supports
views for edit control.TOleView supports
the view half of an OLE-enabled Doc/View application. #define EV_VN_COMMIT VN_DEFINE_STANDARD_(::owl::vnCommit, VnCommit) |
#define EV_VN_DOCCLOSED VN_DEFINE_STANDARD_(::owl::vnDocClosed, VnDocClosed) |
#define EV_VN_DOCOPENED VN_DEFINE_STANDARD_(::owl::vnDocOpened, VnDocOpened) |
#define EV_VN_ISDIRTY VN_DEFINE_STANDARD_(::owl::vnIsDirty, VnIsDirty) |
#define EV_VN_ISWINDOW VN_DEFINE_STANDARD_(::owl::vnIsWindow, VnIsWindow) |
#define EV_VN_REVERT VN_DEFINE_STANDARD_(::owl::vnRevert, VnRevert) |
#define EV_VN_VIEWCLOSED VN_DEFINE_STANDARD_(::owl::vnViewClosed, VnViewClosed) |
#define EV_VN_VIEWOPENED VN_DEFINE_STANDARD_(::owl::vnViewOpened, VnViewOpened) |
#define EV_WM_CANCLOSE OWL_EV_(WM_OWLCANCLOSE, EvCanClose) |
Definition at line 353 of file docmanag.h.
#define EV_WM_PREPROCMENU OWL_EV_(WM_OWLPREPROCMENU, EvPreProcessMenu) |
Definition at line 352 of file docmanag.h.
#define EV_WM_WAKEUP OWL_EV_(WM_OWLWAKEUP, EvWakeUp) |
Definition at line 354 of file docmanag.h.
#define VN_DEFINE | ( | id, | |
method, | |||
dispatcher ) {{WM_OWLNOTIFY}, static_cast<::owl::uint>(id), OWL_DISPATCH(dispatcher, method)} |
Definition at line 60 of file commview.h.
Definitions of dnXxx document/view message notifications.
Enumerator | |
---|---|
dnCreate | New document or view has been created. |
dnClose | Document or view has been closed. |
dnRename | Document has been renamed. |
Definition at line 51 of file docmanag.h.
Document open and sharing modes - used in storage and stream constructors.
Defines the document and open sharing modes used for constructing streams and storing data. Any constants that have the same functionality as those used by OLE 2.0 doc files are indicated in the following table; for example, STGM_TRANSACTED, STGM_CONVERT, STGM_PRIORITY, and STGM_DELETEONRELEASE. Although files are typically used for data storage, databases or spreadsheets can also be used. I/O streams rather than DOS use these bit values. Documents open the object used for storage in one of the following modes:
Contains constants that define the following properties of the document:
|
inline |
Constructs a TFileDocument object with the optional parent document.
|
inline |
Destroys a TFileDocument object.
|
virtual |
< String-aware overload
Closes the document but does not delete or detach any associated views.
Before closing the document, Close calls TDocument::Close to make sure all child documents are closed. If any children are open, Close returns 0 and does not close the document. If all children are closed, Close checks to see if any associated streams are open, and if so, returns 0 and does not close the document. If there are no open streams, Close closes the file.
Reimplemented from owl::TDocument.
Definition at line 266 of file filedoc.cpp.
Closes the file handle if the associated file was opened by TFileDocument.
Calls TDocument::NotifyViews() to notify all views that the file document has closed.
Definition at line 212 of file filedoc.cpp.
References IS_PREV_OPEN, and owl::vnDocClosed.
< String-aware overload
Calls TDocument::Commit and clears TDocument's DirtyFlag data member, thus indicating that there are no unsaved changes made to the document.
Reimplemented from owl::TDocument.
Definition at line 284 of file filedoc.cpp.
return index
Gets the property index, given the property name (name).
Returns 0 if the name is not found.
Reimplemented from owl::TDocument.
Definition at line 354 of file filedoc.cpp.
References _tcscmp.
Overrides TDocument::GetProperty.
Reimplemented from owl::TDocument.
Definition at line 368 of file filedoc.cpp.
Overrides TDocument::InStream and provides generic input for the particular storage medium.
InStream returns a pointer to a TInStream. mode is a combination of the ios bits defined in iostream.h. strmId is not used for file documents. The view reads data from the document as a stream or through stream functions.
Reimplemented from owl::TDocument.
Definition at line 448 of file filedoc.cpp.
References owl::ofBinary, owl::ofParent, owl::ofRead, and PREV_OPEN.
|
inlinevirtual |
Is nonzero if the document or any streams are open.
Reimplemented from owl::TDocument.
Definition at line 122 of file filedoc.h.
References owl::TDocument::IsOpen().
open on existing file handle
Opens a file document using an existing file handle.
Sets TDocument::OpenMode to PREV_OPEN and read/write. Sets the document path to 0. Sets FHdl to fhdl. Always returns a nonzero value.
Definition at line 249 of file filedoc.cpp.
References owl::ofReadWrite, and PREV_OPEN.
Overrides TDocument::Open and opens the file using the specified path.
If the file is already open, returns 0. Calls TDocument::SetDocPath to set the directory path. If mode is not 0, sets TDocument::OpenMode to mode. If the file cannot be opened, returns 0.
Reimplemented from owl::TDocument.
Definition at line 227 of file filedoc.cpp.
|
protected |
Opens the file document after checking the file sharing mode (omode).
If a file mode is not specified as read, write, or read and write, OpenThisFile returns 0.
Definition at line 145 of file filedoc.cpp.
References _USES_CONVERSION, _W2A, owl::ofAppend, owl::ofAtEnd, owl::ofNoCreate, owl::ofNoReplace, owl::ofRead, owl::ofTruncate, owl::ofWrite, owl::shCompat, owl::shMask, owl::shRead, owl::shReadWrite, and owl::vnDocOpened.
|
virtual |
< String-aware overload
Overrides TDocument::OutStream and provides generic input for the particular storage medium.
OutStream returns a pointer to a TOutStream. mode is a combination of the ios bits defined in iostream.h. strmId is not used for file documents. Instead, the view reads data from the document through stream functions.
Reimplemented from owl::TDocument.
Definition at line 483 of file filedoc.cpp.
References owl::ofBinary, owl::ofParent, owl::ofWrite, and PREV_OPEN.
|
inlinevirtual |
Return the number of property support by this document.
Reimplemented from owl::TDocument.
Definition at line 132 of file filedoc.h.
References owl::TFileDocument::NextProperty.
< String-aware overload
Returns the property attribute constants (pfGetText, pfHidden, and so on).
Reimplemented from owl::TDocument.
Definition at line 339 of file filedoc.cpp.
Returns the text name of the property given the index value.
Reimplemented from owl::TDocument.
Definition at line 325 of file filedoc.cpp.
Calls TDocument::Revert to notify the views to refresh their data.
If clear is false, the data is restored instead of cleared.
Reimplemented from owl::TDocument.
Definition at line 297 of file filedoc.cpp.
Sets the property data, which must be in the native data type (either string or binary).
Reimplemented from owl::TDocument.
Definition at line 434 of file filedoc.cpp.
const uint owl::dmMDI = 0x0002 |
Supports multiple open documents.
Definition at line 33 of file docmanag.h.
const uint owl::dmMenu = 0x0004 |
Set IDs for file menu.
Definition at line 34 of file docmanag.h.
const uint owl::dmNoRevert = 0x0020 |
Disable FileRevert menu item.
Definition at line 36 of file docmanag.h.
const uint owl::dmSaveEnable = 0x0010 |
Enable FileSave even if doc is unmodified.
Definition at line 35 of file docmanag.h.
const uint owl::dmSDI = 0x0001 |
Does not support multiple open documents.
Definition at line 32 of file docmanag.h.
const uint owl::dtAutoDelete = 0x40000000L |
const uint owl::dtAutoOpen = 0x08000000L |
const uint owl::dtDynRegInfo = 0x00800000L |
const uint owl::dtForbidNew = 0x00100000L |
const uint owl::dtHidden = 0x02000000L |
const uint owl::dtNewDoc = 0x80000000L |
const uint owl::dtNoAutoView = 0x20000000L |
const uint owl::dtProhibited |
Flags which are stripped off when invoking Open/Save dialogs [See SelectDocPath() method for more information ].
Definition at line 43 of file docmanag.h.
const uint owl::dtRegisterExt = 0x00200000L |
const uint owl::dtSelected = 0x01000000L |
const uint owl::dtSingleUse = 0x00400000L |
const uint owl::dtSingleView = 0x10000000L |
const uint owl::dtUpdateDir = 0x04000000L |
const uint owl::pfConstant = 4 |
const uint owl::pfGetBinary = 2 |
const uint owl::pfGetText = 1 |
const uint owl::pfHidden = 32 |
const uint owl::pfSettable = 8 |
const uint owl::pfUnknown = 16 |
const uint owl::pfUserDef =128 |
const uint owl::vnCommit = 5 |
const uint owl::vnCustomBase = 100 |
const uint owl::vnDocClosed = 4 |
const uint owl::vnDocOpened = 3 |
const uint owl::vnIsDirty = 7 |
const uint owl::vnIsWindow = 8 |
const uint owl::vnRevert = 6 |
const uint owl::vnViewClosed = 2 |
const uint owl::vnViewOpened = 1 |