[3.0] Replaced deprecated touch api in indicator
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / common / ecore-indicator-impl.h
index 47a2ac5..544e92b 100644 (file)
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pan-gesture-detector.h>
 #include <dali/public-api/rendering/renderer.h>
+#include <dali/public-api/images/image.h>
+#include <dali/public-api/object/any.h>
 
 // INTERNAL INCLUDES
 #include <base/interfaces/indicator-interface.h>
+#include <native-image-source.h>
 #include <indicator-buffer.h>
 #include <ecore-server-connection.h>
 #include <shared-file.h>
@@ -193,6 +196,12 @@ public:  // Dali::Internal::Adaptor::IndicicatorInterface
    */
   virtual bool SendMessage( int messageDomain, int messageId, const void *data, int size );
 
+  /**
+   * Update native indicator image
+   * @param[in] source Native indicator image source
+   */
+  void UpdateIndicatorImage( Dali::Any source );
+
 private:
   /**
    * Initialize the indicator actors
@@ -211,13 +220,19 @@ private:
   void SetForegroundImage( Dali::Texture texture );
 
   /**
+   * Set the texture to be rendered as indicator foreground
+   * @param[in] image The foreground image.
+   */
+  void SetForegroundNativeImage( Dali::Image image );
+
+  /**
    * Touch event callback.
-   * It should pass the valid touch event to indicator server
+   * It should pass the valid touch data to indicator server
    *
    * @param[in] indicator  The indicator actor that was touched
-   * @param[in] touchEvent The touch event
+   * @param[in] touchData The touch data
    */
-  bool OnTouched(Dali::Actor indicator, const TouchEvent& touchEvent);
+  bool OnTouched(Dali::Actor indicator, const TouchData& touchData);
 
   /**
    * Pan gesture callback.
@@ -232,9 +247,9 @@ private:
    * Touch event callback on stage.
    * If stage is touched, hide showing indicator image
    *
-   * @param[in] touchEvent The touch event
+   * @param[in] touchEvent The touch data
    */
-  void OnStageTouched(const Dali::TouchEvent& touchEvent);
+  void OnStageTouched(const Dali::TouchData& touchData);
 
   /**
    * Connect to the indicator service
@@ -289,6 +304,17 @@ private:
   void LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent );
 
   /**
+   * Update top margin of the stage as much as indicator height
+   */
+  void UpdateTopMargin();
+
+  /**
+   * Setup native indicator image
+   * @param[in] epcEvent The event containing the image data information
+   */
+  void SetupNativeIndicatorImage( Ecore_Ipc_Event_Server_Data *epcEvent );
+
+  /**
    * Update the visibility and position of the actors
    */
   void UpdateVisibility();
@@ -350,6 +376,11 @@ private:
    */
   void OnAnimationFinished( Dali::Animation& animation );
 
+  /**
+   * Set up native indicator image
+   */
+  void SetupNativeIndicatorImage();
+
 private: // Implementation of ServerConnection::Observer
   /**
    * @copydoc Dali::Internal::Adaptor::ServerConnection::Observer::DataReceived()
@@ -404,6 +435,7 @@ private:
 
   IndicatorBufferPtr               mIndicatorBuffer;     ///< class which handles indicator rendering
   PixmapId                         mPixmap;              ///< Pixmap including indicator content
+  Dali::NativeImageSourcePtr       mNativeImageSource;
   Dali::Renderer                   mForegroundRenderer;  ///< Renderer renders the indicator foreground
   Dali::Renderer                   mBackgroundRenderer;  ///< Renderer renders the indicator background
 
@@ -444,6 +476,7 @@ private:
   Impl* mImpl; ///< Created on construction and destroyed on destruction.
 
   bool                             mBackgroundVisible;   ///< Indicate whether background is visible
+  int                              mTopMargin;   ///< Top margin of the stage for indicator
 };
 
 } // Adaptor