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,2017 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

Copyright © 1997-2016 Jeroen van der Zijp