xref: /haiku/headers/os/interface/Deskbar.h (revision 9d6d3fcf5fe8308cd020cecf89dede440346f8c4)
1 /*
2  * Copyright 2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_DESKBAR_H
6 #define	_DESKBAR_H
7 
8 
9 #include <BeBuild.h>
10 #include <Rect.h>
11 
12 class BMessenger;
13 class BView;
14 
15 
16 enum deskbar_location {
17 	B_DESKBAR_TOP,
18 	B_DESKBAR_BOTTOM,
19 	B_DESKBAR_LEFT_TOP,
20 	B_DESKBAR_RIGHT_TOP,
21 	B_DESKBAR_LEFT_BOTTOM,
22 	B_DESKBAR_RIGHT_BOTTOM
23 };
24 
25 class BDeskbar {
26 	public:
27 		BDeskbar();
28 		~BDeskbar();
29 
30 		bool IsRunning() const;
31 
32 		// Location member functions
33 		BRect Frame() const;
34 		deskbar_location Location(bool* _isExpanded = NULL) const;
35 		status_t SetLocation(deskbar_location location, bool expanded = false);
36 		bool IsExpanded() const;
37 		status_t Expand(bool expand);
38 
39 		// Item querying member functions
40 		status_t GetItemInfo(int32 id, const char** _name) const;
41 		status_t GetItemInfo(const char* name, int32* _id) const;
42 		bool HasItem(int32 id) const;
43 		bool HasItem(const char* name) const;
44 		uint32 CountItems() const;
45 
46 		// Item modification member functions
47 		status_t AddItem(BView* archivableView, int32* _id = NULL);
48 		status_t AddItem(entry_ref* addOn, int32* _id = NULL);
49 		status_t RemoveItem(int32 id);
50 		status_t RemoveItem(const char* name);
51 
52 	private:
53 		BMessenger*	fMessenger;
54 		uint32		_reserved[12];
55 };
56 
57 #endif	// _DESKBAR_H
58