Deskbar.h revision f8811591
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
12class BMessenger;
13class BView;
14struct entry_ref;
15
16
17enum deskbar_location {
18	B_DESKBAR_TOP,
19	B_DESKBAR_BOTTOM,
20	B_DESKBAR_LEFT_TOP,
21	B_DESKBAR_RIGHT_TOP,
22	B_DESKBAR_LEFT_BOTTOM,
23	B_DESKBAR_RIGHT_BOTTOM
24};
25
26
27class BDeskbar {
28public:
29								BDeskbar();
30								~BDeskbar();
31
32			bool				IsRunning() const;
33
34	// Location methods
35			BRect				Frame() const;
36			deskbar_location	Location(bool* _isExpanded = NULL) const;
37			status_t			SetLocation(deskbar_location location,
38									bool expanded = false);
39
40	// Other state methods
41			bool				IsExpanded() const;
42			status_t			Expand(bool expand);
43
44	// Item querying methods
45			status_t			GetItemInfo(int32 id, const char** _name) const;
46			status_t			GetItemInfo(const char* name, int32* _id) const;
47			bool				HasItem(int32 id) const;
48			bool				HasItem(const char* name) const;
49			uint32				CountItems() const;
50
51	// Item modification methods
52			status_t			AddItem(BView* archivableView,
53									int32* _id = NULL);
54			status_t			AddItem(entry_ref* addOn, int32* _id = NULL);
55			status_t			RemoveItem(int32 id);
56			status_t			RemoveItem(const char* name);
57
58private:
59			BMessenger*			fMessenger;
60			uint32				_reserved[12];
61};
62
63
64#endif	// _DESKBAR_H
65