X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b68d34f34c45b0c002c644b913af1959bb6f53b3..38723be1d50facc0176455b69b409dcd457ac07a:/interface/wx/docview.h?ds=sidebyside diff --git a/interface/wx/docview.h b/interface/wx/docview.h index 7996ea6afb..d7f4448754 100644 --- a/interface/wx/docview.h +++ b/interface/wx/docview.h @@ -60,6 +60,28 @@ public: - wxTEMPLATE_INVISIBLE - The template may not be displayed to the user in dialogs. - wxDEFAULT_TEMPLATE_FLAGS - Defined as wxTEMPLATE_VISIBLE. + + @beginWxPerlOnly + + In wxPerl @a docClassInfo and @a viewClassInfo can be either + @c Wx::ClassInfo objects or strings containing the name of the + perl packages which are to be used as @c Wx::Document and + @c Wx::View classes (they must have a constructor named new); + as an example: + + - Wx::DocTemplate->new(docmgr, descr, filter, dir, ext, + docTypeName, viewTypeName, docClassInfo, viewClassInfo, + flags): will construct document and view objects from the + class information. + - Wx::DocTemplate->new(docmgr, descr, filter, dir, ext, + docTypeName, viewTypeName, docClassName, viewClassName, + flags): will construct document and view objects from perl + packages. + - Wx::DocTemplate->new(docmgr, descr, filter, dir, ext, + docTypeName, viewTypeName): + in this case @c Wx::DocTemplate::CreateDocument() and + @c Wx::DocTemplate::CreateView() must be overridden + @endWxPerlOnly */ wxDocTemplate(wxDocManager* manager, const wxString& descr, const wxString& filter, const wxString& dir, @@ -494,6 +516,24 @@ public: */ wxList& GetTemplates(); + /** + Create the frame used for print preview. + + This method can be overridden if you need to change the behaviour or + appearance of the preview window. By default, a standard wxPreviewFrame + is created. + + @since 2.9.1 + + @param preview The associated preview object. + @param parent The parent window for the frame. + @param title The suggested title for the print preview frame. + @return A new print preview frame, must not return @NULL. + */ + virtual wxPreviewFrame* CreatePreviewFrame(wxPrintPreviewBase* preview, + wxWindow* parent, + const wxString& title); + /** Initializes data; currently just calls OnCreateFileHistory(). @@ -578,6 +618,16 @@ public: choice list is popped up, followed by a file selector. This function is used in CreateDocument(). + + @beginWxPerlOnly + In wxPerl @a templates is a reference to a list of templates. + If you override this method in your document manager it must + return two values, eg: + + @code + (doctemplate, path) = My::DocManager->SelectDocumentPath(...); + @endcode + @endWxPerlOnly */ virtual wxDocTemplate* SelectDocumentPath(wxDocTemplate** templates, int noTemplates, wxString& path, @@ -597,6 +647,10 @@ public: 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. + + @beginWxPerlOnly + In wxPerl @a templates is a reference to a list of templates. + @endWxPerlOnly */ virtual wxDocTemplate* SelectDocumentType(wxDocTemplate** templates, int noTemplates, @@ -619,6 +673,10 @@ public: 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. + + @beginWxPerlOnly + In wxPerl @a templates is a reference to a list of templates. + @endWxPerlOnly */ virtual wxDocTemplate* SelectViewType(wxDocTemplate** templates, int noTemplates, bool sort = false); @@ -1292,6 +1350,14 @@ public: */ virtual bool SaveAs(); + /** + Discard changes and load last saved version. + + Prompts the user first, and then calls DoOpenDocument() to reload the + current file. + */ + virtual bool Revert(); + //@{ /** Override this function and call it from your own SaveObject() before @@ -1326,11 +1392,26 @@ public: */ virtual void SetDocumentTemplate(wxDocTemplate* templ); + /** + Sets if this document has been already saved or not. + + Normally there is no need to call this function as the document-view + framework does it itself as the documents are loaded from and saved to + the files. However it may be useful in some particular cases, for + example it may be called with @false argument to prevent the user + from saving the just opened document into the same file if this + shouldn't be done for some reason (e.g. file format version changes and + a new extension should be used for saving). + + @see GetDocumentSaved(), AlreadySaved() + */ + void SetDocumentSaved(bool saved = true); + /** Sets the filename for this document. Usually called by the framework. Calls OnChangeFilename() which in turn calls wxView::OnChangeFilename() for - all views if @a notifyViews is @true, + all views if @a notifyViews is @true. */ void SetFilename(const wxString& filename, bool notifyViews = false);