xref: /haiku/src/apps/icon-o-matic/document/Document.h (revision 55b40aa53a835472ec7952b138ae4256203d02e4)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef DOCUMENT_H
10 #define DOCUMENT_H
11 
12 #include <String.h>
13 
14 #include "Observable.h"
15 #include "RWLocker.h"
16 
17 struct entry_ref;
18 
19 class CommandStack;
20 class Icon;
21 class Selection;
22 
23 class Document : public RWLocker,
24 				 public Observable {
25  public:
26 								Document(const char* name = NULL);
27 	virtual						~Document();
28 
29 	inline	::CommandStack*		CommandStack() const
30 									{ return fCommandStack; }
31 
32 	inline	::Selection*		Selection() const
33 									{ return fSelection; }
34 
35 			void				SetName(const char* name);
36 			const char*			Name() const;
37 
38 			void				SetRef(const entry_ref& ref);
39 	inline	const entry_ref*	Ref() const
40 									{ return fRef; }
41 			void				SetExportRef(const entry_ref& ref);
42 	inline	const entry_ref*	ExportRef() const
43 									{ return fExportRef; }
44 
45 			void				SetIcon(::Icon* icon);
46 	inline	::Icon*				Icon() const
47 									{ return fIcon; }
48 
49 			void				MakeEmpty();
50 
51  private:
52 			::Icon*				fIcon;
53 			::CommandStack*		fCommandStack;
54 			::Selection*		fSelection;
55 
56 			BString				fName;
57 			entry_ref*			fRef;
58 			entry_ref*			fExportRef;
59 };
60 
61 #endif // DOCUMENT_H
62