2006-10-29 19:45:16 +03:00
|
|
|
/*
|
2018-11-03 00:39:02 +03:00
|
|
|
* Copyright 2006-2018, Haiku, Inc. All rights reserved.
|
2009-08-27 15:12:41 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
2006-10-29 19:45:16 +03:00
|
|
|
*/
|
2002-09-24 08:11:55 +04:00
|
|
|
#ifndef _DESKBAR_H
|
|
|
|
#define _DESKBAR_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <Rect.h>
|
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
|
2002-09-24 08:11:55 +04:00
|
|
|
class BMessenger;
|
|
|
|
class BView;
|
2007-10-16 00:13:55 +04:00
|
|
|
struct entry_ref;
|
2002-09-24 08:11:55 +04:00
|
|
|
|
2006-10-29 19:45:16 +03:00
|
|
|
|
2002-09-24 08:11:55 +04:00
|
|
|
enum deskbar_location {
|
|
|
|
B_DESKBAR_TOP,
|
|
|
|
B_DESKBAR_BOTTOM,
|
|
|
|
B_DESKBAR_LEFT_TOP,
|
|
|
|
B_DESKBAR_RIGHT_TOP,
|
|
|
|
B_DESKBAR_LEFT_BOTTOM,
|
|
|
|
B_DESKBAR_RIGHT_BOTTOM
|
|
|
|
};
|
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
|
2006-10-29 19:45:16 +03:00
|
|
|
class BDeskbar {
|
2009-08-26 14:45:36 +04:00
|
|
|
public:
|
|
|
|
BDeskbar();
|
|
|
|
~BDeskbar();
|
|
|
|
|
|
|
|
bool IsRunning() const;
|
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
// Location methods
|
2009-08-26 14:45:36 +04:00
|
|
|
BRect Frame() const;
|
|
|
|
deskbar_location Location(bool* _isExpanded = NULL) const;
|
|
|
|
status_t SetLocation(deskbar_location location,
|
|
|
|
bool expanded = false);
|
2017-11-27 07:28:49 +03:00
|
|
|
|
|
|
|
// Other state methods
|
2009-08-26 14:45:36 +04:00
|
|
|
bool IsExpanded() const;
|
|
|
|
status_t Expand(bool expand);
|
|
|
|
|
2017-11-27 08:59:44 +03:00
|
|
|
bool IsAlwaysOnTop() const;
|
|
|
|
status_t SetAlwaysOnTop(bool alwaysOnTop);
|
|
|
|
|
|
|
|
bool IsAutoRaise() const;
|
|
|
|
status_t SetAutoRaise(bool autoRaise);
|
|
|
|
|
|
|
|
bool IsAutoHide() const;
|
|
|
|
status_t SetAutoHide(bool autoHide);
|
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
// Item querying methods
|
|
|
|
status_t GetItemInfo(int32 id, const char** _name) const;
|
|
|
|
status_t GetItemInfo(const char* name, int32* _id) const;
|
2009-08-26 14:45:36 +04:00
|
|
|
bool HasItem(int32 id) const;
|
|
|
|
bool HasItem(const char* name) const;
|
|
|
|
uint32 CountItems() const;
|
2018-11-03 00:39:02 +03:00
|
|
|
float MaxItemWidth() const;
|
|
|
|
float MaxItemHeight() const;
|
2009-08-26 14:45:36 +04:00
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
// Item modification methods
|
2009-08-26 14:45:36 +04:00
|
|
|
status_t AddItem(BView* archivableView,
|
|
|
|
int32* _id = NULL);
|
|
|
|
status_t AddItem(entry_ref* addOn, int32* _id = NULL);
|
|
|
|
status_t RemoveItem(int32 id);
|
|
|
|
status_t RemoveItem(const char* name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMessenger* fMessenger;
|
|
|
|
uint32 _reserved[12];
|
2002-09-24 08:11:55 +04:00
|
|
|
};
|
|
|
|
|
2017-11-27 07:28:49 +03:00
|
|
|
|
2002-09-24 08:11:55 +04:00
|
|
|
#endif // _DESKBAR_H
|