HaikuDepot: notify work status from main window
[haiku.git] / src / apps / icon-o-matic / document / Document.h
blob6051350be51ffb7145527e740a81aad1eb0a9db1
1 /*
2 * Copyright 2006-2007, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
8 #ifndef DOCUMENT_H
9 #define DOCUMENT_H
12 #include "IconBuild.h"
13 #include "Observable.h"
14 #include "RWLocker.h"
16 #include <String.h>
19 struct entry_ref;
21 _BEGIN_ICON_NAMESPACE
22 class Icon;
23 _END_ICON_NAMESPACE
25 class CommandStack;
26 class DocumentSaver;
27 class Selection;
29 class Document : public RWLocker,
30 public Observable {
31 public:
32 Document(const char* name = NULL);
33 virtual ~Document();
35 inline ::CommandStack* CommandStack() const
36 { return fCommandStack; }
38 inline ::Selection* Selection() const
39 { return fSelection; }
41 void SetName(const char* name);
42 const char* Name() const;
44 void SetNativeSaver(::DocumentSaver* saver);
45 inline ::DocumentSaver* NativeSaver() const
46 { return fNativeSaver; }
48 void SetExportSaver(::DocumentSaver* saver);
49 inline ::DocumentSaver* ExportSaver() const
50 { return fExportSaver; }
52 void SetIcon(_ICON_NAMESPACE Icon* icon);
53 inline _ICON_NAMESPACE Icon* Icon() const
54 { return fIcon; }
56 void MakeEmpty(bool includingSavers = true);
58 bool IsEmpty() const;
60 private:
61 _ICON_NAMESPACE Icon* fIcon;
62 ::CommandStack* fCommandStack;
63 ::Selection* fSelection;
65 BString fName;
67 ::DocumentSaver* fNativeSaver;
68 ::DocumentSaver* fExportSaver;
71 #endif // DOCUMENT_H