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 // Document manager flags
50 wxDEFAULT_DOCMAN_FLAGS
= wxDOC_SDI
53 // Document template flags
56 wxTEMPLATE_VISIBLE
= 1,
58 wxDEFAULT_TEMPLATE_FLAGS
= wxTEMPLATE_VISIBLE
61 #define wxMAX_FILE_HISTORY 9
63 class WXDLLIMPEXP_CORE wxDocument
: public wxEvtHandler
66 wxDocument(wxDocument
*parent
= (wxDocument
*) NULL
);
67 virtual ~wxDocument();
70 void SetFilename(const wxString
& filename
, bool notifyViews
= false);
71 wxString
GetFilename() const { return m_documentFile
; }
73 void SetTitle(const wxString
& title
) { m_documentTitle
= title
; }
74 wxString
GetTitle() const { return m_documentTitle
; }
76 void SetDocumentName(const wxString
& name
) { m_documentTypeName
= name
; }
77 wxString
GetDocumentName() const { return m_documentTypeName
; }
79 bool GetDocumentSaved() const { return m_savedYet
; }
80 void SetDocumentSaved(bool saved
= true) { m_savedYet
= saved
; }
84 virtual bool SaveAs();
85 virtual bool Revert();
87 #if wxUSE_STD_IOSTREAM
88 virtual wxSTD ostream
& SaveObject(wxSTD ostream
& stream
);
89 virtual wxSTD istream
& LoadObject(wxSTD istream
& stream
);
91 virtual wxOutputStream
& SaveObject(wxOutputStream
& stream
);
92 virtual wxInputStream
& LoadObject(wxInputStream
& stream
);
95 // Called by wxWidgets
96 virtual bool OnSaveDocument(const wxString
& filename
);
97 virtual bool OnOpenDocument(const wxString
& filename
);
98 virtual bool OnNewDocument();
99 virtual bool OnCloseDocument();
101 // Prompts for saving if about to close a modified document. Returns true
102 // if ok to close the document (may have saved in the meantime, or set
103 // modified to false)
104 virtual bool OnSaveModified();
106 // Called by framework if created automatically by the default document
107 // manager: gives document a chance to initialise and (usually) create a
109 virtual bool OnCreate(const wxString
& path
, long flags
);
111 // By default, creates a base wxCommandProcessor.
112 virtual wxCommandProcessor
*OnCreateCommandProcessor();
113 virtual wxCommandProcessor
*GetCommandProcessor() const { return m_commandProcessor
; }
114 virtual void SetCommandProcessor(wxCommandProcessor
*proc
) { m_commandProcessor
= proc
; }
116 // Called after a view is added or removed. The default implementation
117 // deletes the document if this is there are no more views.
118 virtual void OnChangedViewList();
120 virtual bool DeleteContents();
122 virtual bool Draw(wxDC
&);
123 virtual bool IsModified() const { return m_documentModified
; }
124 virtual void Modify(bool mod
) { m_documentModified
= mod
; }
126 virtual bool AddView(wxView
*view
);
127 virtual bool RemoveView(wxView
*view
);
128 wxList
& GetViews() { return m_documentViews
; }
129 const wxList
& GetViews() const { return m_documentViews
; }
130 wxView
*GetFirstView() const;
132 virtual void UpdateAllViews(wxView
*sender
= (wxView
*) NULL
, wxObject
*hint
= (wxObject
*) NULL
);
133 virtual void NotifyClosing();
135 // Remove all views (because we're closing the document)
136 virtual bool DeleteAllViews();
139 virtual wxDocManager
*GetDocumentManager() const;
140 virtual wxDocTemplate
*GetDocumentTemplate() const { return m_documentTemplate
; }
141 virtual void SetDocumentTemplate(wxDocTemplate
*temp
) { m_documentTemplate
= temp
; }
143 // Get the document name to be shown to the user: the title if there is
144 // any, otherwise the filename if the document was saved and, finally,
145 // "unnamed" otherwise
146 virtual wxString
GetUserReadableName() const;
148 #if WXWIN_COMPATIBILITY_2_8
149 // use GetUserReadableName() instead
150 wxDEPRECATED_BUT_USED_INTERNALLY(
151 virtual bool GetPrintableName(wxString
& buf
) const
153 #endif // WXWIN_COMPATIBILITY_2_8
155 // Returns a window that can be used as a parent for document-related
156 // dialogs. Override if necessary.
157 virtual wxWindow
*GetDocumentWindow() const;
160 wxList m_documentViews
;
161 wxString m_documentFile
;
162 wxString m_documentTitle
;
163 wxString m_documentTypeName
;
164 wxDocTemplate
* m_documentTemplate
;
165 bool m_documentModified
;
166 wxDocument
* m_documentParent
;
167 wxCommandProcessor
* m_commandProcessor
;
170 // Called by OnSaveDocument and OnOpenDocument to implement standard
171 // Save/Load behavior. Re-implement in derived class for custom
173 virtual bool DoSaveDocument(const wxString
& file
);
174 virtual bool DoOpenDocument(const wxString
& file
);
176 // the default implementation of GetUserReadableName()
177 wxString
DoGetUserReadableName() const;
180 DECLARE_ABSTRACT_CLASS(wxDocument
)
181 DECLARE_NO_COPY_CLASS(wxDocument
)
184 class WXDLLIMPEXP_CORE wxView
: public wxEvtHandler
187 // wxView(wxDocument *doc = (wxDocument *) NULL);
191 wxDocument
*GetDocument() const { return m_viewDocument
; }
192 virtual void SetDocument(wxDocument
*doc
);
194 wxString
GetViewName() const { return m_viewTypeName
; }
195 void SetViewName(const wxString
& name
) { m_viewTypeName
= name
; }
197 wxWindow
*GetFrame() const { return m_viewFrame
; }
198 void SetFrame(wxWindow
*frame
) { m_viewFrame
= frame
; }
200 virtual void OnActivateView(bool activate
, wxView
*activeView
, wxView
*deactiveView
);
201 virtual void OnDraw(wxDC
*dc
) = 0;
202 virtual void OnPrint(wxDC
*dc
, wxObject
*info
);
203 virtual void OnUpdate(wxView
*sender
, wxObject
*hint
= (wxObject
*) NULL
);
204 virtual void OnClosingDocument() {}
205 virtual void OnChangeFilename();
207 // Called by framework if created automatically by the default document
208 // manager class: gives view a chance to initialise
209 virtual bool OnCreate(wxDocument
*WXUNUSED(doc
), long WXUNUSED(flags
)) { return true; }
211 // Checks if the view is the last one for the document; if so, asks user
212 // to confirm save data (if modified). If ok, deletes itself and returns
214 virtual bool Close(bool deleteWindow
= true);
216 // Override to do cleanup/veto close
217 virtual bool OnClose(bool deleteWindow
);
219 // Extend event processing to search the document's event table
220 virtual bool ProcessEvent(wxEvent
& event
);
222 // A view's window can call this to notify the view it is (in)active.
223 // The function then notifies the document manager.
224 virtual void Activate(bool activate
);
226 wxDocManager
*GetDocumentManager() const
227 { return m_viewDocument
->GetDocumentManager(); }
229 #if wxUSE_PRINTING_ARCHITECTURE
230 virtual wxPrintout
*OnCreatePrintout();
234 wxDocument
* m_viewDocument
;
235 wxString m_viewTypeName
;
236 wxWindow
* m_viewFrame
;
239 DECLARE_ABSTRACT_CLASS(wxView
)
240 DECLARE_NO_COPY_CLASS(wxView
)
243 // Represents user interface (and other) properties of documents and views
244 class WXDLLIMPEXP_CORE wxDocTemplate
: public wxObject
247 friend class WXDLLIMPEXP_FWD_CORE wxDocManager
;
250 // Associate document and view types. They're for identifying what view is
251 // associated with what template/document type
252 wxDocTemplate(wxDocManager
*manager
,
253 const wxString
& descr
,
254 const wxString
& filter
,
257 const wxString
& docTypeName
,
258 const wxString
& viewTypeName
,
259 wxClassInfo
*docClassInfo
= (wxClassInfo
*) NULL
,
260 wxClassInfo
*viewClassInfo
= (wxClassInfo
*)NULL
,
261 long flags
= wxDEFAULT_TEMPLATE_FLAGS
);
263 virtual ~wxDocTemplate();
265 // By default, these two member functions dynamically creates document and
266 // view using dynamic instance construction. Override these if you need a
267 // different method of construction.
268 virtual wxDocument
*CreateDocument(const wxString
& path
, long flags
= 0);
269 virtual wxView
*CreateView(wxDocument
*doc
, long flags
= 0);
271 // Helper method for CreateDocument; also allows you to do your own document
273 virtual bool InitDocument(wxDocument
* doc
, const wxString
& path
, long flags
= 0);
275 wxString
GetDefaultExtension() const { return m_defaultExt
; }
276 wxString
GetDescription() const { return m_description
; }
277 wxString
GetDirectory() const { return m_directory
; }
278 wxDocManager
*GetDocumentManager() const { return m_documentManager
; }
279 void SetDocumentManager(wxDocManager
*manager
) { m_documentManager
= manager
; }
280 wxString
GetFileFilter() const { return m_fileFilter
; }
281 long GetFlags() const { return m_flags
; }
282 virtual wxString
GetViewName() const { return m_viewTypeName
; }
283 virtual wxString
GetDocumentName() const { return m_docTypeName
; }
285 void SetFileFilter(const wxString
& filter
) { m_fileFilter
= filter
; }
286 void SetDirectory(const wxString
& dir
) { m_directory
= dir
; }
287 void SetDescription(const wxString
& descr
) { m_description
= descr
; }
288 void SetDefaultExtension(const wxString
& ext
) { m_defaultExt
= ext
; }
289 void SetFlags(long flags
) { m_flags
= flags
; }
291 bool IsVisible() const { return ((m_flags
& wxTEMPLATE_VISIBLE
) == wxTEMPLATE_VISIBLE
); }
293 wxClassInfo
* GetDocClassInfo() const { return m_docClassInfo
; }
294 wxClassInfo
* GetViewClassInfo() const { return m_viewClassInfo
; }
296 virtual bool FileMatchesTemplate(const wxString
& path
);
300 wxString m_fileFilter
;
301 wxString m_directory
;
302 wxString m_description
;
303 wxString m_defaultExt
;
304 wxString m_docTypeName
;
305 wxString m_viewTypeName
;
306 wxDocManager
* m_documentManager
;
308 // For dynamic creation of appropriate instances.
309 wxClassInfo
* m_docClassInfo
;
310 wxClassInfo
* m_viewClassInfo
;
312 // Called by CreateDocument and CreateView to create the actual document/view object.
313 // By default uses the ClassInfo provided to the constructor. Override these functions
314 // to provide a different method of creation.
315 virtual wxDocument
*DoCreateDocument();
316 virtual wxView
*DoCreateView();
319 DECLARE_CLASS(wxDocTemplate
)
320 DECLARE_NO_COPY_CLASS(wxDocTemplate
)
323 // One object of this class may be created in an application, to manage all
324 // the templates and documents.
325 class WXDLLIMPEXP_CORE wxDocManager
: public wxEvtHandler
328 wxDocManager(long flags
= wxDEFAULT_DOCMAN_FLAGS
, bool initialize
= true);
329 virtual ~wxDocManager();
331 virtual bool Initialize();
333 // Handlers for common user commands
334 void OnFileClose(wxCommandEvent
& event
);
335 void OnFileCloseAll(wxCommandEvent
& event
);
336 void OnFileNew(wxCommandEvent
& event
);
337 void OnFileOpen(wxCommandEvent
& event
);
338 void OnFileRevert(wxCommandEvent
& event
);
339 void OnFileSave(wxCommandEvent
& event
);
340 void OnFileSaveAs(wxCommandEvent
& event
);
341 void OnPrint(wxCommandEvent
& event
);
342 void OnPreview(wxCommandEvent
& event
);
343 void OnUndo(wxCommandEvent
& event
);
344 void OnRedo(wxCommandEvent
& event
);
346 // Handlers for UI update commands
347 void OnUpdateFileOpen(wxUpdateUIEvent
& event
);
348 void OnUpdateFileClose(wxUpdateUIEvent
& event
);
349 void OnUpdateFileRevert(wxUpdateUIEvent
& event
);
350 void OnUpdateFileNew(wxUpdateUIEvent
& event
);
351 void OnUpdateFileSave(wxUpdateUIEvent
& event
);
352 void OnUpdateFileSaveAs(wxUpdateUIEvent
& event
);
353 void OnUpdateUndo(wxUpdateUIEvent
& event
);
354 void OnUpdateRedo(wxUpdateUIEvent
& event
);
356 void OnUpdatePrint(wxUpdateUIEvent
& event
);
357 void OnUpdatePreview(wxUpdateUIEvent
& event
);
359 // Extend event processing to search the view's event table
360 virtual bool ProcessEvent(wxEvent
& event
);
362 // called when file format detection didn't work, can be overridden to do
363 // something in this case
364 virtual void OnOpenFileFailure() { }
366 virtual wxDocument
*CreateDocument(const wxString
& path
, long flags
= 0);
367 virtual wxView
*CreateView(wxDocument
*doc
, long flags
= 0);
368 virtual void DeleteTemplate(wxDocTemplate
*temp
, long flags
= 0);
369 virtual bool FlushDoc(wxDocument
*doc
);
370 virtual wxDocTemplate
*MatchTemplate(const wxString
& path
);
371 virtual wxDocTemplate
*SelectDocumentPath(wxDocTemplate
**templates
,
372 int noTemplates
, wxString
& path
, long flags
, bool save
= false);
373 virtual wxDocTemplate
*SelectDocumentType(wxDocTemplate
**templates
,
374 int noTemplates
, bool sort
= false);
375 virtual wxDocTemplate
*SelectViewType(wxDocTemplate
**templates
,
376 int noTemplates
, bool sort
= false);
377 virtual wxDocTemplate
*FindTemplateForPath(const wxString
& path
);
379 void AssociateTemplate(wxDocTemplate
*temp
);
380 void DisassociateTemplate(wxDocTemplate
*temp
);
382 wxDocument
*GetCurrentDocument() const;
384 void SetMaxDocsOpen(int n
) { m_maxDocsOpen
= n
; }
385 int GetMaxDocsOpen() const { return m_maxDocsOpen
; }
387 // Add and remove a document from the manager's list
388 void AddDocument(wxDocument
*doc
);
389 void RemoveDocument(wxDocument
*doc
);
391 // closes all currently open documents
392 bool CloseDocuments(bool force
= true);
394 // closes the specified document
395 bool CloseDocument(wxDocument
* doc
, bool force
= false);
397 // Clear remaining documents and templates
398 bool Clear(bool force
= true);
400 // Views or windows should inform the document manager
401 // when a view is going in or out of focus
402 virtual void ActivateView(wxView
*view
, bool activate
= true);
403 virtual wxView
*GetCurrentView() const;
405 wxList
& GetDocuments() { return m_docs
; }
406 wxList
& GetTemplates() { return m_templates
; }
408 // Return the default name for a new document (by default returns strings
409 // in the form "unnamed <counter>" but can be overridden)
410 virtual wxString
MakeNewDocumentName();
412 // Make a frame title (override this to do something different)
413 virtual wxString
MakeFrameTitle(wxDocument
* doc
);
415 virtual wxFileHistory
*OnCreateFileHistory();
416 virtual wxFileHistory
*GetFileHistory() const { return m_fileHistory
; }
418 // File history management
419 virtual void AddFileToHistory(const wxString
& file
);
420 virtual void RemoveFileFromHistory(size_t i
);
421 virtual size_t GetHistoryFilesCount() const;
422 virtual wxString
GetHistoryFile(size_t i
) const;
423 virtual void FileHistoryUseMenu(wxMenu
*menu
);
424 virtual void FileHistoryRemoveMenu(wxMenu
*menu
);
426 virtual void FileHistoryLoad(const wxConfigBase
& config
);
427 virtual void FileHistorySave(wxConfigBase
& config
);
428 #endif // wxUSE_CONFIG
430 virtual void FileHistoryAddFilesToMenu();
431 virtual void FileHistoryAddFilesToMenu(wxMenu
* menu
);
433 wxString
GetLastDirectory() const { return m_lastDirectory
; }
434 void SetLastDirectory(const wxString
& dir
) { m_lastDirectory
= dir
; }
436 // Get the current document manager
437 static wxDocManager
* GetDocumentManager() { return sm_docManager
; }
439 #if WXWIN_COMPATIBILITY_2_8
440 // deprecated, override GetDefaultName() instead
441 wxDEPRECATED_BUT_USED_INTERNALLY(
442 virtual bool MakeDefaultName(wxString
& buf
)
446 #if WXWIN_COMPATIBILITY_2_6
447 // deprecated, use GetHistoryFilesCount() instead
448 wxDEPRECATED( size_t GetNoHistoryFiles() const );
449 #endif // WXWIN_COMPATIBILITY_2_6
453 int m_defaultDocumentNameCounter
;
457 wxView
* m_currentView
;
458 wxFileHistory
* m_fileHistory
;
459 wxString m_lastDirectory
;
460 static wxDocManager
* sm_docManager
;
462 DECLARE_EVENT_TABLE()
463 DECLARE_DYNAMIC_CLASS(wxDocManager
)
464 DECLARE_NO_COPY_CLASS(wxDocManager
)
467 #if WXWIN_COMPATIBILITY_2_6
468 inline size_t wxDocManager::GetNoHistoryFiles() const
470 return GetHistoryFilesCount();
472 #endif // WXWIN_COMPATIBILITY_2_6
474 // ----------------------------------------------------------------------------
475 // A default child frame
476 // ----------------------------------------------------------------------------
478 class WXDLLIMPEXP_CORE wxDocChildFrame
: public wxFrame
481 wxDocChildFrame(wxDocument
*doc
,
485 const wxString
& title
,
486 const wxPoint
& pos
= wxDefaultPosition
,
487 const wxSize
& size
= wxDefaultSize
,
488 long type
= wxDEFAULT_FRAME_STYLE
,
489 const wxString
& name
= wxT("frame"));
490 virtual ~wxDocChildFrame(){}
492 // Extend event processing to search the view's event table
493 virtual bool ProcessEvent(wxEvent
& event
);
495 void OnActivate(wxActivateEvent
& event
);
496 void OnCloseWindow(wxCloseEvent
& event
);
498 wxDocument
*GetDocument() const { return m_childDocument
; }
499 wxView
*GetView() const { return m_childView
; }
500 void SetDocument(wxDocument
*doc
) { m_childDocument
= doc
; }
501 void SetView(wxView
*view
) { m_childView
= view
; }
502 bool Destroy() { m_childView
= (wxView
*)NULL
; return wxFrame::Destroy(); }
505 wxDocument
* m_childDocument
;
509 DECLARE_CLASS(wxDocChildFrame
)
510 DECLARE_EVENT_TABLE()
511 DECLARE_NO_COPY_CLASS(wxDocChildFrame
)
514 // ----------------------------------------------------------------------------
515 // A default parent frame
516 // ----------------------------------------------------------------------------
518 class WXDLLIMPEXP_CORE wxDocParentFrame
: public wxFrame
522 wxDocParentFrame(wxDocManager
*manager
,
525 const wxString
& title
,
526 const wxPoint
& pos
= wxDefaultPosition
,
527 const wxSize
& size
= wxDefaultSize
,
528 long style
= wxDEFAULT_FRAME_STYLE
,
529 const wxString
& name
= wxFrameNameStr
);
531 bool Create(wxDocManager
*manager
,
534 const wxString
& title
,
535 const wxPoint
& pos
= wxDefaultPosition
,
536 const wxSize
& size
= wxDefaultSize
,
537 long style
= wxDEFAULT_FRAME_STYLE
,
538 const wxString
& name
= wxFrameNameStr
);
540 // Extend event processing to search the document manager's event table
541 virtual bool ProcessEvent(wxEvent
& event
);
543 wxDocManager
*GetDocumentManager() const { return m_docManager
; }
545 void OnExit(wxCommandEvent
& event
);
546 void OnMRUFile(wxCommandEvent
& event
);
547 void OnCloseWindow(wxCloseEvent
& event
);
550 wxDocManager
*m_docManager
;
553 typedef wxFrame base_type
;
554 DECLARE_CLASS(wxDocParentFrame
)
555 DECLARE_EVENT_TABLE()
556 DECLARE_NO_COPY_CLASS(wxDocParentFrame
)
559 // ----------------------------------------------------------------------------
560 // Provide simple default printing facilities
561 // ----------------------------------------------------------------------------
563 #if wxUSE_PRINTING_ARCHITECTURE
564 class WXDLLIMPEXP_CORE wxDocPrintout
: public wxPrintout
567 wxDocPrintout(wxView
*view
= (wxView
*) NULL
, const wxString
& title
= wxT("Printout"));
568 bool OnPrintPage(int page
);
569 bool HasPage(int page
);
570 bool OnBeginDocument(int startPage
, int endPage
);
571 void GetPageInfo(int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
573 virtual wxView
*GetView() { return m_printoutView
; }
576 wxView
* m_printoutView
;
579 DECLARE_DYNAMIC_CLASS(wxDocPrintout
)
580 DECLARE_NO_COPY_CLASS(wxDocPrintout
)
582 #endif // wxUSE_PRINTING_ARCHITECTURE
584 // ----------------------------------------------------------------------------
585 // File history management
586 // ----------------------------------------------------------------------------
588 class WXDLLIMPEXP_CORE wxFileHistory
: public wxObject
591 wxFileHistory(size_t maxFiles
= 9, wxWindowID idBase
= wxID_FILE1
);
592 virtual ~wxFileHistory();
595 virtual void AddFileToHistory(const wxString
& file
);
596 virtual void RemoveFileFromHistory(size_t i
);
597 virtual int GetMaxFiles() const { return (int)m_fileMaxFiles
; }
598 virtual void UseMenu(wxMenu
*menu
);
600 // Remove menu from the list (MDI child may be closing)
601 virtual void RemoveMenu(wxMenu
*menu
);
604 virtual void Load(const wxConfigBase
& config
);
605 virtual void Save(wxConfigBase
& config
);
606 #endif // wxUSE_CONFIG
608 virtual void AddFilesToMenu();
609 virtual void AddFilesToMenu(wxMenu
* menu
); // Single menu
612 virtual wxString
GetHistoryFile(size_t i
) const { return m_fileHistory
[i
]; }
613 virtual size_t GetCount() const { return m_fileHistory
.GetCount(); }
615 const wxList
& GetMenus() const { return m_fileMenus
; }
618 void SetBaseId(wxWindowID baseId
) { m_idBase
= baseId
; }
619 wxWindowID
GetBaseId() const { return m_idBase
; }
621 #if WXWIN_COMPATIBILITY_2_6
622 // deprecated, use GetCount() instead
623 wxDEPRECATED( size_t GetNoHistoryFiles() const );
624 #endif // WXWIN_COMPATIBILITY_2_6
628 wxArrayString m_fileHistory
;
630 // Menus to maintain (may need several for an MDI app)
633 // Max files to maintain
634 size_t m_fileMaxFiles
;
637 // The ID of the first history menu item (Doesn't have to be wxID_FILE1)
640 DECLARE_DYNAMIC_CLASS(wxFileHistory
)
641 DECLARE_NO_COPY_CLASS(wxFileHistory
)
644 #if WXWIN_COMPATIBILITY_2_6
645 inline size_t wxFileHistory::GetNoHistoryFiles() const
647 return m_fileHistory
.GetCount();
649 #endif // WXWIN_COMPATIBILITY_2_6
651 #if wxUSE_STD_IOSTREAM
652 // For compatibility with existing file formats:
653 // converts from/to a stream to/from a temporary file.
654 bool WXDLLIMPEXP_CORE
wxTransferFileToStream(const wxString
& filename
, wxSTD ostream
& stream
);
655 bool WXDLLIMPEXP_CORE
wxTransferStreamToFile(wxSTD istream
& stream
, const wxString
& filename
);
657 // For compatibility with existing file formats:
658 // converts from/to a stream to/from a temporary file.
659 bool WXDLLIMPEXP_CORE
wxTransferFileToStream(const wxString
& filename
, wxOutputStream
& stream
);
660 bool WXDLLIMPEXP_CORE
wxTransferStreamToFile(wxInputStream
& stream
, const wxString
& filename
);
661 #endif // wxUSE_STD_IOSTREAM
663 #endif // wxUSE_DOC_VIEW_ARCHITECTURE