xref: /haiku/headers/os/interface/Deskbar.h (revision 2ae568931fcac7deb9f1e6ff4e47213fbfe4029b)
1 //------------------------------------------------------------------------------
2 //	Copyright (c) 2001-2002, OpenBeOS
3 //
4 //	Permission is hereby granted, free of charge, to any person obtaining a
5 //	copy of this software and associated documentation files (the "Software"),
6 //	to deal in the Software without restriction, including without limitation
7 //	the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 //	and/or sell copies of the Software, and to permit persons to whom the
9 //	Software is furnished to do so, subject to the following conditions:
10 //
11 //	The above copyright notice and this permission notice shall be included in
12 //	all copies or substantial portions of the Software.
13 //
14 //	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 //	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 //	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 //	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 //	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 //	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 //	DEALINGS IN THE SOFTWARE.
21 //
22 //	File Name:		Deskbar.h
23 //	Author:			Jeremy Rand (jrand@magma.ca)
24 //	Description:	BDeskbar allows one to control the deskbar from an
25 //                  application.
26 //------------------------------------------------------------------------------
27 
28 #ifndef	_DESKBAR_H
29 #define	_DESKBAR_H
30 
31 // Standard Includes -----------------------------------------------------------
32 
33 // System Includes -------------------------------------------------------------
34 #include <BeBuild.h>
35 #include <Rect.h>
36 
37 // Project Includes ------------------------------------------------------------
38 
39 // Local Includes --------------------------------------------------------------
40 
41 // Local Defines ---------------------------------------------------------------
42 
43 // Globals ---------------------------------------------------------------------
44 
45 class BMessenger;
46 class BView;
47 
48 // enum for deskbar locations --------------------------------------------------
49 enum deskbar_location {
50 	B_DESKBAR_TOP,
51 	B_DESKBAR_BOTTOM,
52 	B_DESKBAR_LEFT_TOP,
53 	B_DESKBAR_RIGHT_TOP,
54 	B_DESKBAR_LEFT_BOTTOM,
55 	B_DESKBAR_RIGHT_BOTTOM
56 };
57 
58 
59 // BDeskbar class -------------------------------------------------------------
60 class BDeskbar
61 {
62 public:
63 	BDeskbar();
64 	~BDeskbar();
65 
66 // Location member functions
67 	BRect Frame(void) const;
68 	deskbar_location Location(bool *isExpanded = NULL) const;
69 	status_t SetLocation(deskbar_location location, bool expanded = false);
70 	bool IsExpanded(void) const;
71 	status_t Expand(bool expand);
72 
73 // Item querying member functions
74 	status_t GetItemInfo(int32 id, const char **name) const;
75 	status_t GetItemInfo(const char *name, int32 *id) const;
76 	bool HasItem(int32 id) const;
77 	bool HasItem(const char *name) const;
78 	uint32 CountItems(void) const;
79 
80 // Item modification member functions
81 	status_t AddItem(BView *archivableView, int32 *id = NULL);
82 	status_t AddItem(entry_ref *addon, int32 *id = NULL);
83 	status_t RemoveItem(int32 id);
84 	status_t RemoveItem(const char *name);
85 
86 private:
87 	BMessenger *fMessenger;
88 	uint32			_reserved[12];
89 };
90 //------------------------------------------------------------------------------
91 
92 #endif	// _DESKBAR_H
93 
94