/////////////////////////////////////////////////////////////////////////////
// Name: docview.h
-// Purpose: documentation for wxDocTemplate class
+// Purpose: interface of wxDocTemplate
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_wxdoctemplateoverview "wxDocTemplate overview", wxDocument, wxView
+ @see @ref overview_wxdoctemplateoverview "wxDocTemplate overview", wxDocument,
+ wxView
*/
class wxDocTemplate : public wxObject
{
wxTEMPLATE_VISIBLE The template may be displayed to the user in dialogs.
wxTEMPLATE_INVISIBLE The template may not be displayed to the user in dialogs.
wxDEFAULT_TEMPLATE_FLAGS Defined as wxTEMPLATE_VISIBLE.
-
-
+
+
@b Wx::DocTemplate-new( docmgr, descr, filter, dir,
ext, docTypeName, viewTypeName, docClassInfo, viewClassInfo, flags
)
-
+
will construct document and view objects from the class information
-
+
@b Wx::DocTemplate-new( docmgr, descr, filter, dir,
ext, docTypeName, viewTypeName, docClassName, viewClassName, flags
)
-
+
will construct document and view objects from perl packages
-
+
@b Wx::DocTemplate-new( docmgr, descr, filter, dir,
ext, docTypeName, viewTypeName )
-
+
@c Wx::DocTemplate::CreateDocument() and
@c Wx::DocTemplate::CreateView() must be overridden
*/
};
+
/**
@class wxDocManager
@wxheader{docview.h}
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_wxdocmanageroverview "wxDocManager overview", wxDocument, wxView,
- wxDocTemplate, wxFileHistory
+ @see @ref overview_wxdocmanageroverview "wxDocManager overview", wxDocument,
+ wxView, wxDocTemplate, wxFileHistory
*/
class wxDocManager : public wxEvtHandler
{
/**
Loads the file history from a config object.
-
- @see wxConfig
+
+ @see wxConfig()
*/
void FileHistoryLoad(wxConfigBase& config);
/**
Saves the file history into a config object. This must be called
explicitly by the application.
-
- @see wxConfig
+
+ @see wxConfig()
*/
void FileHistorySave(wxConfigBase& resourceFile);
Returns the directory last selected by the user when opening a file. Initially
empty.
*/
- wxString GetLastDirectory();
+ wxString GetLastDirectory() const;
/**
Returns the number of documents that can be open simultaneously.
Returns a document template by asking the user (if there is more than one
template).
This function is used in CreateDocument().
-
+
@param templates
Pointer to an array of templates from which to choose a desired template.
@param noTemplates
If more than one template is passed in in templates,
then this parameter indicates whether the list of templates that the user
will have to choose from is sorted or not when shown the choice box dialog.
-
+
Default is @false.
*/
wxDocTemplate* SelectDocumentType(wxDocTemplate** templates,
The dialog normally will not appear because the array of templates only contains
those relevant to the document in question, and often there will only be one
such.
-
+
@param templates
Pointer to an array of templates from which to choose a desired template.
@param noTemplates
If more than one template is passed in in templates,
then this parameter indicates whether the list of templates that the user
will have to choose from is sorted or not when shown the choice box dialog.
-
+
Default is @false.
*/
wxDocTemplate* SelectViewType(wxDocTemplate** templates,
};
+
/**
@class wxView
@wxheader{docview.h}
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_wxviewoverview "wxView overview", wxDocument, wxDocTemplate,
+ @see @ref overview_wxviewoverview "wxView overview", wxDocument, wxDocTemplate,
wxDocManager
*/
class wxView : public wxEvtHandler
/**
Gets a pointer to the document associated with the view.
*/
- wxDocument* GetDocument();
+ wxDocument* GetDocument() const;
/**
Returns a pointer to the document manager instance associated with this view.
*/
- wxDocManager* GetDocumentManager();
+ wxDocManager* GetDocumentManager() const;
/**
Gets the frame associated with the view (if any). Note that this "frame'' is
constructor).
Not currently used by the framework.
*/
- wxString GetViewName();
+ wxString GetViewName() const;
/**
Called when a view is activated by means of Activate(). The default
};
+
/**
@class wxDocChildFrame
@wxheader{docview.h}
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_docviewoverview, wxFrame
+ @see @ref overview_docviewoverview, wxFrame
*/
class wxDocChildFrame : public wxFrame
{
/**
Returns the document associated with this frame.
*/
- wxDocument* GetDocument();
+ wxDocument* GetDocument() const;
/**
Returns the view associated with this frame.
*/
- wxView* GetView();
+ wxView* GetView() const;
/**
Sets the currently active view to be the frame's view. You may need
};
+
/**
@class wxDocParentFrame
@wxheader{docview.h}
SDI (not MDI) parent frames.
It cooperates with the wxView, wxDocument,
- wxDocManager and wxDocTemplates classes.
+ wxDocManager and wxDocTemplates() classes.
See the example application in @c samples/docview.
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_docviewoverview, wxFrame
+ @see @ref overview_docviewoverview, wxFrame
*/
class wxDocParentFrame : public wxFrame
{
/**
Returns the associated @ref overview_wxdocmanager "document manager object".
*/
- wxDocManager* GetDocumentManager();
+ wxDocManager* GetDocumentManager() const;
/**
Deletes all views and documents. If no user input cancelled the
};
+
/**
@class wxDocument
@wxheader{docview.h}
@library{wxcore}
@category{dvf}
- @seealso
- @ref overview_wxdocumentoverview "wxDocument overview", wxView, wxDocTemplate,
- wxDocManager
+ @see @ref overview_wxdocumentoverview "wxDocument overview", wxView,
+ wxDocTemplate, wxDocManager
*/
class wxDocument : public wxEvtHandler
{
Returns a pointer to the command processor associated with this document.
See wxCommandProcessor.
*/
- wxCommandProcessor* GetCommandProcessor();
+ wxCommandProcessor* GetCommandProcessor() const;
/**
Gets a pointer to the associated document manager.
*/
- wxDocManager* GetDocumentManager();
+ wxDocManager* GetDocumentManager() const;
/**
Gets the document type name for this document. See the comment for
- documentTypeName.
+ documentTypeName().
*/
- wxString GetDocumentName();
+ wxString GetDocumentName() const;
/**
Gets a pointer to the template that created the document.
*/
- wxDocTemplate* GetDocumentTemplate();
+ wxDocTemplate* GetDocumentTemplate() const;
/**
Intended to return a suitable window for using as a parent for document-related
dialog boxes. By default, uses the frame associated with the first view.
*/
- wxWindow* GetDocumentWindow();
+ wxWindow* GetDocumentWindow() const;
/**
Gets the filename associated with this document, or "" if none is
associated.
*/
- wxString GetFilename();
+ wxString GetFilename() const;
/**
A convenience function to get the first view for a document, because
in many cases a document will only have a single view.
See also: GetViews()
*/
- wxView* GetFirstView();
+ wxView* GetFirstView() const;
/**
Gets the title for this document. The document title is used for an associated
frame (if any), and is usually constructed by the framework from
the filename.
*/
- wxString GetTitle();
+ wxString GetTitle() const;
/**
Return the document name suitable to be shown to the user. The default
implementation uses the document title, if any, of the name part of the
document filename if it was set or, otherwise, the string @b unnamed.
*/
- virtual wxString GetUserReadableName();
+ virtual wxString GetUserReadableName() const;
/**
Returns the list whose elements are the views on the document.
See also: GetFirstView()
*/
- wxList GetViews();
+ wxList GetViews() const;
/**
Returns @true if the document has been modified since the last save, @false
the document).
See also Modify().
*/
- virtual bool IsModified();
+ virtual bool IsModified() const;
//@{
/**
/**
Sets the document type name for this document. See the comment for
- documentTypeName.
+ documentTypeName().
*/
void SetDocumentName(const wxString& name);
};
+
/**
@class wxFileHistory
@wxheader{docview.h}
@library{wxcore}
@category{FIXME}
- @seealso
- @ref overview_wxfilehistoryoverview "wxFileHistory overview", wxDocManager
+ @see @ref overview_wxfilehistoryoverview "wxFileHistory overview", wxDocManager
*/
class wxFileHistory : public wxObject
{
/**
Returns the base identifier for the range used for appending items.
*/
- wxWindowID GetBaseId();
+ wxWindowID GetBaseId() const;
/**
Returns the number of files currently stored in the file history.
*/
- size_t GetCount();
+ size_t GetCount() const;
/**
Returns the file at this index (zero-based).
*/
- wxString GetHistoryFile(size_t index);
+ wxString GetHistoryFile(size_t index) const;
/**
Returns the maximum number of files that can be stored.
*/
- int GetMaxFiles();
+ int GetMaxFiles() const;
/**
Returns the list of menus that are managed by this file history object.
-
+
@see UseMenu()
*/
- const wxList GetMenus();
+ const wxList GetMenus() const;
/**
Loads the file history from the given config object. This function should be
called explicitly by the application.
-
- @see wxConfig
+
+ @see wxConfig()
*/
void Load(wxConfigBase& config);
/**
Saves the file history into the given config object. This must be called
explicitly by the application.
-
- @see wxConfig
+
+ @see wxConfig()
*/
void Save(wxConfigBase& config);
};
+
// ============================================================================
// Global functions/macros
// ============================================================================
+/** @ingroup group_funcmacro_file */
+//@{
+
/**
- Copies the given file to @e stream. Useful when converting an old application to
- use streams (within the document/view framework, for example).
+ Copies the given file to @a stream. Useful when converting an old
+ application to use streams (within the document/view framework, for
+ example).
+
+ @header{wx/docview.h}
*/
bool wxTransferFileToStream(const wxString& filename,
ostream& stream);
+/**
+ Copies the given stream to the file @a filename. Useful when converting an
+ old application to use streams (within the document/view framework, for
+ example).
+
+ @header{wx/docview.h}
+*/
+bool wxTransferStreamToFile(istream& stream,
+ const wxString& filename);
+
+//@}
+