1 /* 2 * Copyright 2006-2007, 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 struct entry_ref; 15 16 17 enum 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 class BDeskbar { 27 public: 28 BDeskbar(); 29 ~BDeskbar(); 30 31 bool IsRunning() const; 32 33 // Location member functions 34 BRect Frame() const; 35 deskbar_location Location(bool* _isExpanded = NULL) const; 36 status_t SetLocation(deskbar_location location, 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, const char** _name) const; 42 status_t GetItemInfo(const char* name, int32* _id) const; 43 bool HasItem(int32 id) const; 44 bool HasItem(const char* name) const; 45 uint32 CountItems() const; 46 47 // Item modification member functions 48 status_t AddItem(BView* archivableView, int32* _id = NULL); 49 status_t AddItem(entry_ref* addOn, int32* _id = NULL); 50 status_t RemoveItem(int32 id); 51 status_t RemoveItem(const char* name); 52 53 private: 54 BMessenger* fMessenger; 55 uint32 _reserved[12]; 56 }; 57 58 #endif // _DESKBAR_H 59