1/*
2 * Copyright 2006-2007, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stephan A��mus <superstippi@gmx.de>
7 */
8#ifndef DOCUMENT_H
9#define DOCUMENT_H
10
11
12#include "IconBuild.h"
13#include "Observable.h"
14#include "RWLocker.h"
15
16#include <String.h>
17
18
19struct entry_ref;
20
21_BEGIN_ICON_NAMESPACE
22	class Icon;
23_END_ICON_NAMESPACE
24
25class CommandStack;
26class DocumentSaver;
27class Selection;
28
29class Document : public RWLocker,
30				 public Observable {
31 public:
32								Document(const char* name = NULL);
33	virtual						~Document();
34
35	inline	::CommandStack*		CommandStack() const
36									{ return fCommandStack; }
37
38	inline	::Selection*		Selection() const
39									{ return fSelection; }
40
41			void				SetName(const char* name);
42			const char*			Name() const;
43
44			void				SetNativeSaver(::DocumentSaver* saver);
45	inline	::DocumentSaver*	NativeSaver() const
46									{ return fNativeSaver; }
47
48			void				SetExportSaver(::DocumentSaver* saver);
49	inline	::DocumentSaver*	ExportSaver() const
50									{ return fExportSaver; }
51
52			void				SetIcon(_ICON_NAMESPACE Icon* icon);
53	inline	_ICON_NAMESPACE Icon* Icon() const
54									{ return fIcon; }
55
56			void				MakeEmpty(bool includingSavers = true);
57
58			bool				IsEmpty() const;
59
60 private:
61			_ICON_NAMESPACE Icon* fIcon;
62			::CommandStack*		fCommandStack;
63			::Selection*		fSelection;
64
65			BString				fName;
66
67			::DocumentSaver*	fNativeSaver;
68			::DocumentSaver*	fExportSaver;
69};
70
71#endif // DOCUMENT_H
72