(StyleManager) Add style monitor signal into StyleManager
[platform/core/uifw/dali-toolkit.git] / capi / dali-toolkit / public-api / controls / control-impl.h
index 1a690e9..840af0a 100644 (file)
@@ -24,7 +24,6 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
 
 namespace Dali DALI_IMPORT_API
 {
@@ -32,6 +31,8 @@ namespace Dali DALI_IMPORT_API
 namespace Toolkit
 {
 
+class StyleManager;
+
 namespace Internal DALI_INTERNAL
 {
 class RelayoutControllerImpl;
@@ -97,6 +98,15 @@ public:
   virtual bool OnAccessibilityPan(PanGesture gesture);
 
   /**
+   * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
+   * touch event.
+   *
+   * @param[in] touchEvent The touch event.
+   * @return true if the touch event has been consumed by this control
+   */
+  virtual bool OnAccessibilityTouch(const TouchEvent& touchEvent);
+
+  /**
    * @brief This method should be overridden by deriving classes when they wish to respond
    * the accessibility up and down action (i.e. value change of slider control).
    *
@@ -289,11 +299,34 @@ private: // For derived classes to override
   virtual void OnInitialize() { }
 
   /**
-   * @brief Callback for when the theme changes.
+   * @brief This method should be overridden by deriving classes when
+   * they wish to be notified when the style manager changes the theme.
+   *
+   * @param[in] styleManager  The StyleManager object.
    */
   virtual void OnThemeChange( Toolkit::StyleManager styleManager );
 
   /**
+   * @brief This method should be overridden by deriving classes when
+   * they wish to be notified when the style changes the default font.
+   *
+   * @param[in] defaultFontChange  Information denoting whether the default font has changed.
+   * @param[in] defaultFontSizeChange Information denoting whether the default font size has changed.
+   */
+  virtual void OnFontChange( bool defaultFontChange, bool defaultFontSizeChange ){ }
+
+  /**
+   * @deprecated Use OnFontChange() instead.
+   * Before the using of StyleManager, the StyleChange only deals with font change.
+   *
+   * @brief This method should be overridden by deriving classes when
+   * they wish to be notified when the style changes.
+   *
+   * @param[in] change  Information denoting what has changed.
+   */
+  virtual void OnStyleChange( StyleChange change ) { }
+
+  /**
    * @brief Called whenever a pinch gesture is detected on this control.
    *
    * This can be overridden by deriving classes when pinch detection
@@ -508,14 +541,22 @@ private:
    */
   void DoActivatedAction(const PropertyValueContainer& attributes);
 
+  /**
+   * @brief This method is the callback for the StyleChangeSignal from StyleManager
+   *
+   * @param[in] styleManager The StyleManager Object
+   * @param[in] change  Information denoting what has changed.
+   */
+  void DoStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+
 protected: // Construction
 
   // Flags for the constructor
   enum ControlBehaviour
   {
-    CONTROL_BEHAVIOUR_NONE        = 0x0,
-    REQUIRES_TOUCH_EVENTS         = 0x1,     ///< True if the OnTouchEvent() callback is required.
-    REQUIRES_THEME_CHANGE_SIGNALS = 0x2      ///< True if this control should listen to theme change signals
+    CONTROL_BEHAVIOUR_NONE         = 0x0,
+    REQUIRES_TOUCH_EVENTS          = 0x1,     ///< True if the OnTouchEvent() callback is required.
+    REQUIRES_STYLE_CHANGE_SIGNALS  = 0x2      ///< True if needs to monitor style change signals such as theme/font change
   };
 
   /**