Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXDocument.h
1 /********************************************************************************
2 * *
3 * D o c u m e n t O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2022 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXDOCUMENT_H
22 #define FXDOCUMENT_H
23 
24 #ifndef FXOBJECT_H
25 #include "FXObject.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 // Forward
32 class FXWindow;
33 
34 
36 class FXAPI FXDocument : public FXObject {
37  FXDECLARE(FXDocument)
38 private:
39  FXString title; // Title to appear above windows
40  FXString filename; // File name to save to
41  FXbool modified; // Document has been modified
42 public:
43  long onUpdTitle(FXObject*,FXSelector,void*);
44  long onUpdFilename(FXObject*,FXSelector,void*);
45 public:
46  enum {
47  ID_TITLE=10000, // Don't interfere with viewer's message id's
48  ID_FILENAME,
49  ID_LAST
50  };
51 public:
52 
54  FXDocument();
55 
57  FXbool isModified() const { return modified; }
58 
60  void setModified(FXbool mdfy=true){ modified=mdfy; }
61 
63  void setTitle(const FXString& name);
64 
66  const FXString& getTitle() const { return title; }
67 
69  void setFilename(const FXString& path);
70 
72  const FXString& getFilename() const { return filename; }
73 
75  virtual void save(FXStream& store) const;
76 
78  virtual void load(FXStream& store);
79 
81  virtual ~FXDocument();
82  };
83 
84 }
85 
86 #endif
void setModified(FXbool mdfy=true)
Set its modified state.
Definition: FXDocument.h:60
Abstract base class for documents.
Definition: FXDocument.h:36
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXbool isModified() const
Return true if document is modified.
Definition: FXDocument.h:57
Definition: FX4Splitter.h:28
const FXString & getFilename() const
Get document filename.
Definition: FXDocument.h:72
const FXString & getTitle() const
Get document title.
Definition: FXDocument.h:66
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp