xref: /haiku/headers/os/interface/Deskbar.h (revision 99d027cd0238c1d86da86d7c3f4200509ccc61a6)
1 /*
2  * Copyright 2006-2009, 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 <Rect.h>
10 
11 class BMessenger;
12 class BView;
13 struct entry_ref;
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,
36 									bool expanded = false);
37 			bool				IsExpanded() const;
38 			status_t			Expand(bool expand);
39 
40 	// Item querying member functions
41 			status_t			GetItemInfo(int32 id,
42 									const char** _name) const;
43 			status_t			GetItemInfo(const char* name,
44 									int32* _id) const;
45 			bool				HasItem(int32 id) const;
46 			bool				HasItem(const char* name) const;
47 			uint32				CountItems() const;
48 
49 	// Item modification member functions
50 			status_t			AddItem(BView* archivableView,
51 									int32* _id = NULL);
52 			status_t			AddItem(entry_ref* addOn, int32* _id = NULL);
53 			status_t			RemoveItem(int32 id);
54 			status_t			RemoveItem(const char* name);
55 
56 private:
57 			BMessenger*			fMessenger;
58 			uint32				_reserved[12];
59 };
60 
61 #endif	// _DESKBAR_H
62