41 // |
41 // |
42 |
42 |
43 #include <hbstyle.h> |
43 #include <hbstyle.h> |
44 #include "hbwidget.h" |
44 #include "hbwidget.h" |
45 #include "hbwidgetbase_p.h" |
45 #include "hbwidgetbase_p.h" |
|
46 #include "hbstyle_p.h" |
46 |
47 |
47 #ifdef HB_TESTABILITY |
|
48 #include <hbtestabilitysignal_p.h> |
48 #include <hbtestabilitysignal_p.h> |
49 #endif //HB_TESTABILITY |
49 |
|
50 #include <QPointer> |
50 |
51 |
51 class HbWidget; |
52 class HbWidget; |
52 class HbStyle; |
53 class HbStyle; |
53 class HbTestabilitySignal_p; |
54 class HbTestabilitySignal_p; |
|
55 class HbFocusGroup; |
54 class QGraphicsItem; |
56 class QGraphicsItem; |
55 class HbFocusGroup; |
|
56 |
|
57 namespace HbStyleRulesCacheId { |
|
58 const char hbStyleRulesForNodeCache[] = "__Hb__Style__Rules__For__Node__Cache__"; |
|
59 } |
|
60 |
57 |
61 class HB_CORE_PRIVATE_EXPORT HbWidgetPrivate: public HbWidgetBasePrivate |
58 class HB_CORE_PRIVATE_EXPORT HbWidgetPrivate: public HbWidgetBasePrivate |
62 { |
59 { |
63 Q_DECLARE_PUBLIC(HbWidget) |
60 Q_DECLARE_PUBLIC(HbWidget) |
64 |
61 |
65 public: |
62 public: |
66 HbWidgetPrivate(); |
63 HbWidgetPrivate(); |
67 virtual ~HbWidgetPrivate(); |
64 virtual ~HbWidgetPrivate(); |
68 QGraphicsItem *focusPrimitive(HbWidget::FocusHighlight highlightType) const; |
65 QGraphicsItem *focusPrimitive(HbWidget::FocusHighlight highlightType) const; |
72 void updateCurrentFocusChild(); |
69 void updateCurrentFocusChild(); |
73 HbFocusGroup *getFocusGroup(bool propagate = true) const; |
70 HbFocusGroup *getFocusGroup(bool propagate = true) const; |
74 bool delegateFocus(QFocusEvent *event) const; |
71 bool delegateFocus(QFocusEvent *event) const; |
75 |
72 |
76 void updateBackgroundItemSize(); |
73 void updateBackgroundItemSize(); |
|
74 void setVisibleBackground(QGraphicsItem* background); |
77 |
75 |
78 void setBackgroundItem(HbStyle::Primitive type, int zValue = -1); |
76 void setBackgroundItem(HbStylePrivate::Primitive type, int zValue = -1); |
|
77 void setFocusHighlight(HbStyle::Primitive type, HbWidget::FocusHighlight focusHighlight); |
|
78 HbStyle::Primitive focusHighlight(HbWidget::FocusHighlight focusHighlight); |
|
79 void storeBackgroundItem(QGraphicsItem *&storeItem, QGraphicsItem *item, int zValue = -1); |
|
80 |
|
81 // derived classes should use this method to show and hide focus highlight |
|
82 void setFocusHighlightVisible(HbWidget::FocusHighlight focusHighlight, bool enable); |
|
83 |
|
84 |
79 HbWidget *q_ptr; |
85 HbWidget *q_ptr; |
80 HbStyle *style; |
86 HbStyle *style; |
81 |
87 |
82 #ifdef HB_TESTABILITY |
88 HbTestabilitySignal_p *testabilitySignal; |
83 HbTestabilitySignal_p *testabilitySignal; |
89 HbStylePrivate::Primitive backgroundPrimitiveType; |
84 #endif //HB_TESTABILITY |
90 quint32 polished :1; |
85 |
|
86 HbStyle::Primitive backgroundPrimitiveType; |
|
87 bool polished; |
|
88 bool polishPending; |
91 bool polishPending; |
89 bool themingPending; |
92 bool themingPending; |
90 bool repolishOutstanding; |
93 bool repolishOutstanding; |
91 bool mHandlingRepolishSynchronously; |
94 bool mHandlingRepolishSynchronously; |
92 bool notifyScene; |
95 bool notifyScene; |
93 int pluginBaseId; |
96 int pluginBaseId; |
94 HbFocusGroup *focusGroup; |
97 HbFocusGroup *focusGroup; |
95 HbStyle::Primitive focusActiveType; |
98 HbStylePrivate::Primitive focusActiveType; |
96 HbStyle::Primitive focusResidualType; |
99 HbStylePrivate::Primitive focusResidualType; |
97 bool highlightExpired; |
100 bool highlightExpired; |
|
101 |
98 private: |
102 private: |
|
103 void init(); |
|
104 void notifySceneForPolish(bool polishWidget = true); |
99 mutable QGraphicsItem *backgroundItem; |
105 mutable QGraphicsItem *backgroundItem; |
100 mutable QGraphicsItem *focusActiveItem; |
106 mutable QGraphicsItem *focusActiveItem; |
101 mutable QGraphicsItem *focusResidualItem; |
107 mutable QGraphicsItem *focusResidualItem; |
|
108 mutable QGraphicsItem *visibleBackground; |
102 }; |
109 }; |
103 |
110 |
104 |
111 |
105 |
|
106 |
|
107 #endif // HBWIDGET_P_H |
112 #endif // HBWIDGET_P_H |