1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Doc/View classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #if wxUSE_DOC_VIEW_ARCHITECTURE
20 #include "wx/string.h"
23 #if wxUSE_PRINTING_ARCHITECTURE
27 class WXDLLIMPEXP_FWD_CORE wxWindow
;
28 class WXDLLIMPEXP_FWD_CORE wxDocument
;
29 class WXDLLIMPEXP_FWD_CORE wxView
;
30 class WXDLLIMPEXP_FWD_CORE wxDocTemplate
;
31 class WXDLLIMPEXP_FWD_CORE wxDocManager
;
32 class WXDLLIMPEXP_FWD_CORE wxPrintInfo
;
33 class WXDLLIMPEXP_FWD_CORE wxCommandProcessor
;
34 class WXDLLIMPEXP_FWD_CORE wxFileHistory
;
35 class WXDLLIMPEXP_FWD_BASE wxConfigBase
;
37 #if wxUSE_STD_IOSTREAM
38 #include "wx/iosfwrap.h"
40 #include "wx/stream.h"
43 // Flags for wxDocManager (can be combined).
50 // Document template flags
53 wxTEMPLATE_VISIBLE
= 1,
54 wxTEMPLATE_INVISIBLE
= 2,
55 wxDEFAULT_TEMPLATE_FLAGS
= wxTEMPLATE_VISIBLE
58 #define wxMAX_FILE_HISTORY 9
60 class WXDLLIMPEXP_CORE wxDocument
: public wxEvtHandler
63 wxDocument(wxDocument
*parent
= NULL
);
64 virtual ~wxDocument();
67 void SetFilename(const wxString
& filename
, bool notifyViews
= false);
68 wxString
GetFilename() const { return m_documentFile
; }
70 void SetTitle(const wxString
& title
) { m_documentTitle
= title
; }
71 wxString
GetTitle() const { return m_documentTitle
; }
73 void SetDocumentName(const wxString
& name
) { m_documentTypeName
= name
; }
74 wxString
GetDocumentName() const { return m_documentTypeName
; }
76 // access the flag indicating whether this document had been already saved,
77 // SetDocumentSaved() is only used internally, don't call it
78 bool GetDocumentSaved() const { return m_savedYet
; }
79 void SetDocumentSaved(bool saved
= true) { m_savedYet
= saved
; }
81 // return true if the document hasn't been modified since the last time it
82 // was saved (implying that it returns false if it was never saved, even if
83 // the document is not modified)
84 bool AlreadySaved() const { return !IsModified() && GetDocumentSaved(); }
88 virtual bool SaveAs();
89 virtual bool Revert();
91 #if wxUSE_STD_IOSTREAM
92 virtual wxSTD ostream
& SaveObject(wxSTD ostream
& stream
);
93 virtual wxSTD istream
& LoadObject(wxSTD istream
& stream
);
95 virtual wxOutputStream
& SaveObject(wxOutputStream
& stream
);
96 virtual wxInputStream
& LoadObject(wxInputStream
& stream
);
99 // Called by wxWidgets
100 virtual bool OnSaveDocument(const wxString
& filename
);
101 virtual bool OnOpenDocument(const wxString
& filename
);
102 virtual bool OnNewDocument();
103 virtual bool OnCloseDocument();
105 // Prompts for saving if about to close a modified document. Returns true
106 // if ok to close the document (may have saved in the meantime, or set
107 // modified to false)
108 virtual bool OnSaveModified();
110 // if you override, remember to call the default
111 // implementation (wxDocument::OnChangeFilename)
112 virtual void OnChangeFilename(bool notifyViews
);
114 // Called by framework if created automatically by the default document
115 // manager: gives document a chance to initialise and (usually) create a
117 virtual bool OnCreate(const wxString
& path
, long flags
);
119 // By default, creates a base wxCommandProcessor.
120 virtual wxCommandProcessor
*OnCreateCommandProcessor();
121 virtual wxCommandProcessor
*GetCommandProcessor() const
122 { return m_commandProcessor
; }
123 virtual void SetCommandProcessor(wxCommandProcessor
*proc
)
124 { m_commandProcessor
= proc
; }
126 // Called after a view is added or removed. The default implementation
127 // deletes the document if this is there are no more views.
128 virtual void OnChangedViewList();
130 virtual bool DeleteContents();
132 virtual bool Draw(wxDC
&);
133 virtual bool IsModified() const { return m_documentModified
; }
134 virtual void Modify(bool mod
) { m_documentModified
= mod
; }
136 virtual bool AddView(wxView
*view
);
137 virtual bool RemoveView(wxView
*view
);
138 wxList
& GetViews() { return m_documentViews
; }
139 const wxList
& GetViews() const { return m_documentViews
; }
140 wxView
*GetFirstView() const;
142 virtual void UpdateAllViews(wxView
*sender
= NULL
, wxObject
*hint
= NULL
);
143 virtual void NotifyClosing();
145 // Remove all views (because we're closing the document)
146 virtual bool DeleteAllViews();
149 virtual wxDocManager
*GetDocumentManager() const;
150 virtual wxDocTemplate
*GetDocumentTemplate() const
151 { return m_documentTemplate
; }
152 virtual void SetDocumentTemplate(wxDocTemplate
*temp
)
153 { m_documentTemplate
= temp
; }
155 // Get the document name to be shown to the user: the title if there is
156 // any, otherwise the filename if the document was saved and, finally,
157 // "unnamed" otherwise
158 virtual wxString
GetUserReadableName() const;
160 #if WXWIN_COMPATIBILITY_2_8
161 // use GetUserReadableName() instead
162 wxDEPRECATED_BUT_USED_INTERNALLY(
163 virtual bool GetPrintableName(wxString
& buf
) const
165 #endif // WXWIN_COMPATIBILITY_2_8
167 // Returns a window that can be used as a parent for document-related
168 // dialogs. Override if necessary.
169 virtual wxWindow
*GetDocumentWindow() const;
172 wxList m_documentViews
;
173 wxString m_documentFile
;
174 wxString m_documentTitle
;
175 wxString m_documentTypeName
;
176 wxDocTemplate
* m_documentTemplate
;
177 bool m_documentModified
;
178 wxDocument
* m_documentParent
;
179 wxCommandProcessor
* m_commandProcessor
;
182 // Called by OnSaveDocument and OnOpenDocument to implement standard
183 // Save/Load behavior. Re-implement in derived class for custom
185 virtual bool DoSaveDocument(const wxString
& file
);
186 virtual bool DoOpenDocument(const wxString
& file
);
188 // the default implementation of GetUserReadableName()
189 wxString
DoGetUserReadableName() const;
192 DECLARE_ABSTRACT_CLASS(wxDocument
)
193 DECLARE_NO_COPY_CLASS(wxDocument
)
196 class WXDLLIMPEXP_CORE wxView
: public wxEvtHandler
202 wxDocument
*GetDocument() const { return m_viewDocument
; }
203 virtual void SetDocument(wxDocument
*doc
);
205 wxString
GetViewName() const { return m_viewTypeName
; }
206 void SetViewName(const wxString
& name
) { m_viewTypeName
= name
; }
208 wxWindow
*GetFrame() const { return m_viewFrame
; }
209 void SetFrame(wxWindow
*frame
) { m_viewFrame
= frame
; }
211 virtual void OnActivateView(bool activate
,
213 wxView
*deactiveView
);
214 virtual void OnDraw(wxDC
*dc
) = 0;
215 virtual void OnPrint(wxDC
*dc
, wxObject
*info
);
216 virtual void OnUpdate(wxView
*sender
, wxObject
*hint
= NULL
);
217 virtual void OnClosingDocument() {}
218 virtual void OnChangeFilename();
220 // Called by framework if created automatically by the default document
221 // manager class: gives view a chance to initialise
222 virtual bool OnCreate(wxDocument
*WXUNUSED(doc
), long WXUNUSED(flags
))
225 // Checks if the view is the last one for the document; if so, asks user
226 // to confirm save data (if modified). If ok, deletes itself and returns
228 virtual bool Close(bool deleteWindow
= true);
230 // Override to do cleanup/veto close
231 virtual bool OnClose(bool deleteWindow
);
233 // A view's window can call this to notify the view it is (in)active.
234 // The function then notifies the document manager.
235 virtual void Activate(bool activate
);
237 wxDocManager
*GetDocumentManager() const
238 { return m_viewDocument
->GetDocumentManager(); }
240 #if wxUSE_PRINTING_ARCHITECTURE
241 virtual wxPrintout
*OnCreatePrintout();
245 // hook the document into event handlers chain here
246 virtual bool TryValidator(wxEvent
& event
);
248 wxDocument
* m_viewDocument
;
249 wxString m_viewTypeName
;
250 wxWindow
* m_viewFrame
;
253 DECLARE_ABSTRACT_CLASS(wxView
)
254 DECLARE_NO_COPY_CLASS(wxView
)
257 // Represents user interface (and other) properties of documents and views
258 class WXDLLIMPEXP_CORE wxDocTemplate
: public wxObject
261 friend class WXDLLIMPEXP_FWD_CORE wxDocManager
;
264 // Associate document and view types. They're for identifying what view is
265 // associated with what template/document type
266 wxDocTemplate(wxDocManager
*manager
,
267 const wxString
& descr
,
268 const wxString
& filter
,
271 const wxString
& docTypeName
,
272 const wxString
& viewTypeName
,
273 wxClassInfo
*docClassInfo
= NULL
,
274 wxClassInfo
*viewClassInfo
= NULL
,
275 long flags
= wxDEFAULT_TEMPLATE_FLAGS
);
277 virtual ~wxDocTemplate();
279 // By default, these two member functions dynamically creates document and
280 // view using dynamic instance construction. Override these if you need a
281 // different method of construction.
282 virtual wxDocument
*CreateDocument(const wxString
& path
, long flags
= 0);
283 virtual wxView
*CreateView(wxDocument
*doc
, long flags
= 0);
285 // Helper method for CreateDocument; also allows you to do your own document
287 virtual bool InitDocument(wxDocument
* doc
,
288 const wxString
& path
,
291 wxString
GetDefaultExtension() const { return m_defaultExt
; }
292 wxString
GetDescription() const { return m_description
; }
293 wxString
GetDirectory() const { return m_directory
; }
294 wxDocManager
*GetDocumentManager() const { return m_documentManager
; }
295 void SetDocumentManager(wxDocManager
*manager
)
296 { m_documentManager
= manager
; }
297 wxString
GetFileFilter() const { return m_fileFilter
; }
298 long GetFlags() const { return m_flags
; }
299 virtual wxString
GetViewName() const { return m_viewTypeName
; }
300 virtual wxString
GetDocumentName() const { return m_docTypeName
; }
302 void SetFileFilter(const wxString
& filter
) { m_fileFilter
= filter
; }
303 void SetDirectory(const wxString
& dir
) { m_directory
= dir
; }
304 void SetDescription(const wxString
& descr
) { m_description
= descr
; }
305 void SetDefaultExtension(const wxString
& ext
) { m_defaultExt
= ext
; }
306 void SetFlags(long flags
) { m_flags
= flags
; }
308 bool IsVisible() const { return (m_flags
& wxTEMPLATE_VISIBLE
) != 0; }
310 wxClassInfo
* GetDocClassInfo() const { return m_docClassInfo
; }
311 wxClassInfo
* GetViewClassInfo() const { return m_viewClassInfo
; }
313 virtual bool FileMatchesTemplate(const wxString
& path
);
317 wxString m_fileFilter
;
318 wxString m_directory
;
319 wxString m_description
;
320 wxString m_defaultExt
;
321 wxString m_docTypeName
;
322 wxString m_viewTypeName
;
323 wxDocManager
* m_documentManager
;
325 // For dynamic creation of appropriate instances.
326 wxClassInfo
* m_docClassInfo
;
327 wxClassInfo
* m_viewClassInfo
;
329 // Called by CreateDocument and CreateView to create the actual
330 // document/view object.
332 // By default uses the ClassInfo provided to the constructor. Override
333 // these functions to provide a different method of creation.
334 virtual wxDocument
*DoCreateDocument();
335 virtual wxView
*DoCreateView();
338 DECLARE_CLASS(wxDocTemplate
)
339 DECLARE_NO_COPY_CLASS(wxDocTemplate
)
342 // One object of this class may be created in an application, to manage all
343 // the templates and documents.
344 class WXDLLIMPEXP_CORE wxDocManager
: public wxEvtHandler
347 // NB: flags are unused, don't pass wxDOC_XXX to this ctor
348 wxDocManager(long flags
= 0, bool initialize
= true);
349 virtual ~wxDocManager();
351 virtual bool Initialize();
353 // Handlers for common user commands
354 void OnFileClose(wxCommandEvent
& event
);
355 void OnFileCloseAll(wxCommandEvent
& event
);
356 void OnFileNew(wxCommandEvent
& event
);
357 void OnFileOpen(wxCommandEvent
& event
);
358 void OnFileRevert(wxCommandEvent
& event
);
359 void OnFileSave(wxCommandEvent
& event
);
360 void OnFileSaveAs(wxCommandEvent
& event
);
361 void OnPrint(wxCommandEvent
& event
);
362 void OnPreview(wxCommandEvent
& event
);
363 void OnUndo(wxCommandEvent
& event
);
364 void OnRedo(wxCommandEvent
& event
);
366 // Handlers for UI update commands
367 void OnUpdateFileOpen(wxUpdateUIEvent
& event
);
368 void OnUpdateDisableIfNoDoc(wxUpdateUIEvent
& event
);
369 void OnUpdateFileNew(wxUpdateUIEvent
& event
);
370 void OnUpdateFileSave(wxUpdateUIEvent
& event
);
371 void OnUpdateUndo(wxUpdateUIEvent
& event
);
372 void OnUpdateRedo(wxUpdateUIEvent
& event
);
374 // called when file format detection didn't work, can be overridden to do
375 // something in this case
376 virtual void OnOpenFileFailure() { }
378 virtual wxDocument
*CreateDocument(const wxString
& path
, long flags
= 0);
380 // wrapper around CreateDocument() with a more clear name
381 wxDocument
*CreateNewDocument()
382 { return CreateDocument(wxString(), wxDOC_NEW
); }
384 virtual wxView
*CreateView(wxDocument
*doc
, long flags
= 0);
385 virtual void DeleteTemplate(wxDocTemplate
*temp
, long flags
= 0);
386 virtual bool FlushDoc(wxDocument
*doc
);
387 virtual wxDocTemplate
*MatchTemplate(const wxString
& path
);
388 virtual wxDocTemplate
*SelectDocumentPath(wxDocTemplate
**templates
,
389 int noTemplates
, wxString
& path
, long flags
, bool save
= false);
390 virtual wxDocTemplate
*SelectDocumentType(wxDocTemplate
**templates
,
391 int noTemplates
, bool sort
= false);
392 virtual wxDocTemplate
*SelectViewType(wxDocTemplate
**templates
,
393 int noTemplates
, bool sort
= false);
394 virtual wxDocTemplate
*FindTemplateForPath(const wxString
& path
);
396 void AssociateTemplate(wxDocTemplate
*temp
);
397 void DisassociateTemplate(wxDocTemplate
*temp
);
399 wxDocument
*GetCurrentDocument() const;
401 void SetMaxDocsOpen(int n
) { m_maxDocsOpen
= n
; }
402 int GetMaxDocsOpen() const { return m_maxDocsOpen
; }
404 // Add and remove a document from the manager's list
405 void AddDocument(wxDocument
*doc
);
406 void RemoveDocument(wxDocument
*doc
);
408 // closes all currently open documents
409 bool CloseDocuments(bool force
= true);
411 // closes the specified document
412 bool CloseDocument(wxDocument
* doc
, bool force
= false);
414 // Clear remaining documents and templates
415 bool Clear(bool force
= true);
417 // Views or windows should inform the document manager
418 // when a view is going in or out of focus
419 virtual void ActivateView(wxView
*view
, bool activate
= true);
420 virtual wxView
*GetCurrentView() const { return m_currentView
; }
422 wxList
& GetDocuments() { return m_docs
; }
423 wxList
& GetTemplates() { return m_templates
; }
425 // Return the default name for a new document (by default returns strings
426 // in the form "unnamed <counter>" but can be overridden)
427 virtual wxString
MakeNewDocumentName();
429 // Make a frame title (override this to do something different)
430 virtual wxString
MakeFrameTitle(wxDocument
* doc
);
432 virtual wxFileHistory
*OnCreateFileHistory();
433 virtual wxFileHistory
*GetFileHistory() const { return m_fileHistory
; }
435 // File history management
436 virtual void AddFileToHistory(const wxString
& file
);
437 virtual void RemoveFileFromHistory(size_t i
);
438 virtual size_t GetHistoryFilesCount() const;
439 virtual wxString
GetHistoryFile(size_t i
) const;
440 virtual void FileHistoryUseMenu(wxMenu
*menu
);
441 virtual void FileHistoryRemoveMenu(wxMenu
*menu
);
443 virtual void FileHistoryLoad(const wxConfigBase
& config
);
444 virtual void FileHistorySave(wxConfigBase
& config
);
445 #endif // wxUSE_CONFIG
447 virtual void FileHistoryAddFilesToMenu();
448 virtual void FileHistoryAddFilesToMenu(wxMenu
* menu
);
450 wxString
GetLastDirectory() const;
451 void SetLastDirectory(const wxString
& dir
) { m_lastDirectory
= dir
; }
453 // Get the current document manager
454 static wxDocManager
* GetDocumentManager() { return sm_docManager
; }
456 #if WXWIN_COMPATIBILITY_2_8
457 // deprecated, override GetDefaultName() instead
458 wxDEPRECATED_BUT_USED_INTERNALLY(
459 virtual bool MakeDefaultName(wxString
& buf
)
463 #if WXWIN_COMPATIBILITY_2_6
464 // deprecated, use GetHistoryFilesCount() instead
465 wxDEPRECATED( size_t GetNoHistoryFiles() const );
466 #endif // WXWIN_COMPATIBILITY_2_6
469 // hook the currently active view into event handlers chain here
470 virtual bool TryValidator(wxEvent
& event
);
472 // return the command processor for the current document, if any
473 wxCommandProcessor
*GetCurrentCommandProcessor() const;
475 // this method tries to find an active view harder than GetCurrentView():
476 // if the latter is NULL, it also checks if we don't have just a single
477 // view and returns it then
478 wxView
*GetActiveView() const;
481 int m_defaultDocumentNameCounter
;
485 wxView
* m_currentView
;
486 wxFileHistory
* m_fileHistory
;
487 wxString m_lastDirectory
;
488 static wxDocManager
* sm_docManager
;
490 DECLARE_EVENT_TABLE()
491 DECLARE_DYNAMIC_CLASS(wxDocManager
)
492 DECLARE_NO_COPY_CLASS(wxDocManager
)
495 #if WXWIN_COMPATIBILITY_2_6
496 inline size_t wxDocManager::GetNoHistoryFiles() const
498 return GetHistoryFilesCount();
500 #endif // WXWIN_COMPATIBILITY_2_6
502 // ----------------------------------------------------------------------------
503 // A default child frame
504 // ----------------------------------------------------------------------------
506 class WXDLLIMPEXP_CORE wxDocChildFrame
: public wxFrame
509 wxDocChildFrame(wxDocument
*doc
,
513 const wxString
& title
,
514 const wxPoint
& pos
= wxDefaultPosition
,
515 const wxSize
& size
= wxDefaultSize
,
516 long type
= wxDEFAULT_FRAME_STYLE
,
517 const wxString
& name
= wxFrameNameStr
);
518 virtual ~wxDocChildFrame(){}
520 void OnActivate(wxActivateEvent
& event
);
521 void OnCloseWindow(wxCloseEvent
& event
);
523 wxDocument
*GetDocument() const { return m_childDocument
; }
524 wxView
*GetView() const { return m_childView
; }
525 void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
526 void SetView(wxView
*view
) { m_childView
= view
; }
527 bool Destroy() { m_childView
= NULL
; return wxFrame::Destroy(); }
530 // hook the child view into event handlers chain here
531 virtual bool TryValidator(wxEvent
& event
);
533 wxDocument
* m_childDocument
;
537 DECLARE_CLASS(wxDocChildFrame
)
538 DECLARE_EVENT_TABLE()
539 DECLARE_NO_COPY_CLASS(wxDocChildFrame
)
542 // ----------------------------------------------------------------------------
543 // A default parent frame
544 // ----------------------------------------------------------------------------
546 class WXDLLIMPEXP_CORE wxDocParentFrame
: public wxFrame
550 wxDocParentFrame(wxDocManager
*manager
,
553 const wxString
& title
,
554 const wxPoint
& pos
= wxDefaultPosition
,
555 const wxSize
& size
= wxDefaultSize
,
556 long style
= wxDEFAULT_FRAME_STYLE
,
557 const wxString
& name
= wxFrameNameStr
);
559 bool Create(wxDocManager
*manager
,
562 const wxString
& title
,
563 const wxPoint
& pos
= wxDefaultPosition
,
564 const wxSize
& size
= wxDefaultSize
,
565 long style
= wxDEFAULT_FRAME_STYLE
,
566 const wxString
& name
= wxFrameNameStr
);
568 wxDocManager
*GetDocumentManager() const { return m_docManager
; }
570 void OnExit(wxCommandEvent
& event
);
571 void OnMRUFile(wxCommandEvent
& event
);
572 void OnCloseWindow(wxCloseEvent
& event
);
575 // hook the document manager into event handling chain here
576 virtual bool TryValidator(wxEvent
& event
);
578 wxDocManager
*m_docManager
;
581 typedef wxFrame base_type
;
582 DECLARE_CLASS(wxDocParentFrame
)
583 DECLARE_EVENT_TABLE()
584 DECLARE_NO_COPY_CLASS(wxDocParentFrame
)
587 // ----------------------------------------------------------------------------
588 // Provide simple default printing facilities
589 // ----------------------------------------------------------------------------
591 #if wxUSE_PRINTING_ARCHITECTURE
592 class WXDLLIMPEXP_CORE wxDocPrintout
: public wxPrintout
595 wxDocPrintout(wxView
*view
= NULL
, const wxString
& title
= wxT("Printout"));
597 // implement wxPrintout methods
598 virtual bool OnPrintPage(int page
);
599 virtual bool HasPage(int page
);
600 virtual bool OnBeginDocument(int startPage
, int endPage
);
601 virtual void GetPageInfo(int *minPage
, int *maxPage
,
602 int *selPageFrom
, int *selPageTo
);
604 virtual wxView
*GetView() { return m_printoutView
; }
607 wxView
* m_printoutView
;
610 DECLARE_DYNAMIC_CLASS(wxDocPrintout
)
611 DECLARE_NO_COPY_CLASS(wxDocPrintout
)
613 #endif // wxUSE_PRINTING_ARCHITECTURE
615 // ----------------------------------------------------------------------------
616 // File history management
617 // ----------------------------------------------------------------------------
619 class WXDLLIMPEXP_CORE wxFileHistory
: public wxObject
622 wxFileHistory(size_t maxFiles
= 9, wxWindowID idBase
= wxID_FILE1
);
625 virtual void AddFileToHistory(const wxString
& file
);
626 virtual void RemoveFileFromHistory(size_t i
);
627 virtual int GetMaxFiles() const { return (int)m_fileMaxFiles
; }
628 virtual void UseMenu(wxMenu
*menu
);
630 // Remove menu from the list (MDI child may be closing)
631 virtual void RemoveMenu(wxMenu
*menu
);
634 virtual void Load(const wxConfigBase
& config
);
635 virtual void Save(wxConfigBase
& config
);
636 #endif // wxUSE_CONFIG
638 virtual void AddFilesToMenu();
639 virtual void AddFilesToMenu(wxMenu
* menu
); // Single menu
642 virtual wxString
GetHistoryFile(size_t i
) const { return m_fileHistory
[i
]; }
643 virtual size_t GetCount() const { return m_fileHistory
.GetCount(); }
645 const wxList
& GetMenus() const { return m_fileMenus
; }
648 void SetBaseId(wxWindowID baseId
) { m_idBase
= baseId
; }
649 wxWindowID
GetBaseId() const { return m_idBase
; }
651 #if WXWIN_COMPATIBILITY_2_6
652 // deprecated, use GetCount() instead
653 wxDEPRECATED( size_t GetNoHistoryFiles() const );
654 #endif // WXWIN_COMPATIBILITY_2_6
658 wxArrayString m_fileHistory
;
660 // Menus to maintain (may need several for an MDI app)
663 // Max files to maintain
664 size_t m_fileMaxFiles
;
667 // The ID of the first history menu item (Doesn't have to be wxID_FILE1)
670 DECLARE_DYNAMIC_CLASS(wxFileHistory
)
671 DECLARE_NO_COPY_CLASS(wxFileHistory
)
674 #if WXWIN_COMPATIBILITY_2_6
675 inline size_t wxFileHistory::GetNoHistoryFiles() const
677 return m_fileHistory
.GetCount();
679 #endif // WXWIN_COMPATIBILITY_2_6
681 // For compatibility with existing file formats:
682 // converts from/to a stream to/from a temporary file.
683 #if wxUSE_STD_IOSTREAM
684 bool WXDLLIMPEXP_CORE
685 wxTransferFileToStream(const wxString
& filename
, wxSTD ostream
& stream
);
686 bool WXDLLIMPEXP_CORE
687 wxTransferStreamToFile(wxSTD istream
& stream
, const wxString
& filename
);
689 bool WXDLLIMPEXP_CORE
690 wxTransferFileToStream(const wxString
& filename
, wxOutputStream
& stream
);
691 bool WXDLLIMPEXP_CORE
692 wxTransferStreamToFile(wxInputStream
& stream
, const wxString
& filename
);
693 #endif // wxUSE_STD_IOSTREAM
696 // these flags are not used anywhere by wxWidgets and kept only for an unlikely
697 // case of existing user code using them for its own purposes
698 #ifdef WXWIN_COMPATIBILITY_2_8
703 wxDEFAULT_DOCMAN_FLAGS
= wxDOC_SDI
705 #endif // WXWIN_COMPATIBILITY_2_8
707 #endif // wxUSE_DOC_VIEW_ARCHITECTURE