28
28
#include <sigc++/sigc++.h>
30
#include "AbstractPlacesGroup.h"
30
31
#include "IconTexture.h"
32
#include "Introspectable.h"
31
33
#include "StaticCairoText.h"
34
#include "UBusWrapper.h"
38
class AbstractPaintLayer;
36
class PlacesGroup : public nux::View
44
class PlacesGroup : public dash::AbstractPlacesGroup, public debug::Introspectable
38
NUX_DECLARE_OBJECT_TYPE(PlacesGroup, nux::View);
46
NUX_DECLARE_OBJECT_TYPE(PlacesGroup, dash::AbstractPlacesGroup);
47
55
nux::StaticCairoText* GetLabel();
48
56
nux::StaticCairoText* GetExpandLabel();
50
void SetChildView(nux::View* view);
58
void SetChildView(nux::View* view);
51
59
nux::View* GetChildView();
53
61
void SetChildLayout(nux::Layout* layout);
57
65
void SetCounts(guint n_visible_items_in_unexpand_mode, guint n_total_items);
59
67
void SetExpanded(bool is_expanded);
62
int GetHeaderHeight();
64
void SetDrawSeparator(bool draw_it);
68
bool GetExpanded() const;
70
int GetHeaderHeight() const;
71
bool HeaderIsFocusable() const;
72
nux::View* GetHeaderFocusableView() const;
66
74
sigc::signal<void, PlacesGroup*> expanded;
77
long ComputeContentSize();
78
void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw);
79
void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw);
80
void PostDraw (nux::GraphicsEngine &graphics_engine, bool force_draw);
70
83
virtual bool AcceptKeyNavFocus();
86
virtual std::string GetName() const;
87
virtual void AddProperties(GVariantBuilder* builder);
75
void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
76
void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
77
void PostDraw (nux::GraphicsEngine &GfxContext, bool force_draw);
79
91
static gboolean OnIdleRelayout(PlacesGroup* self);
93
bool HeaderHasKeyFocus() const;
94
bool ShouldBeHighlighted() const;
81
96
void RecvMouseClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
82
97
void RecvMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags);
83
98
void RecvMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags);
84
99
void OnLabelActivated(nux::Area* label);
85
void OnLabelFocusChanged(nux::Area* label);
100
void OnLabelFocusChanged(nux::Area* label, bool has_focus, nux::KeyNavDirection direction);
86
101
void RefreshLabel();
89
104
nux::VLayout* _group_layout;
105
nux::View* _header_view;
90
106
nux::HLayout* _header_layout;
91
107
nux::HLayout* _text_layout;
108
nux::HLayout* _expand_label_layout;
92
109
nux::HLayout* _expand_layout;
93
110
nux::View* _child_view;
111
nux::AbstractPaintLayer* _focus_layer;
95
113
IconTexture* _icon;
96
114
nux::StaticCairoText* _name;