add IndicatorVisibilityChangedSignal 73/32573/2
authorYoonsang Lee <ysang114.lee@samsung.com>
Fri, 19 Dec 2014 06:16:38 +0000 (15:16 +0900)
committerYoonsang Lee <ysang114.lee@samsung.com>
Wed, 24 Dec 2014 08:06:08 +0000 (17:06 +0900)
Change-Id: Ib6279516bac7b1215f7576ea472100757ad9fcfc

add IndicatorVisibilityChangedSignal

Change-Id: I3e7dff4c6775cd57de0c47a51470b5ef77798f0a

adaptors/common/indicator-impl.cpp
adaptors/common/indicator-impl.h
adaptors/common/window-impl.h
adaptors/public-api/adaptor-framework/window.cpp
adaptors/public-api/adaptor-framework/window.h
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/window-impl-x.cpp

index 3ab89fb52d4001fb51c9a59e44b1e086c1779ad4..a5e0e9252d29c05ed1228d406c5e3b29af2163f4 100644 (file)
@@ -1305,6 +1305,11 @@ void Indicator::OnAnimationFinished(Dali::Animation& animation)
   if( !mIsShowing )
   {
     mIndicatorActor.SetVisible( false );
+
+    if( mObserver != NULL )
+    {
+      mObserver->IndicatorVisibilityChanged( mIsShowing ); // is showing?
+    }
   }
 }
 
index 09ced038b224cdca0af1886f36dd722164636135..92fec4d81f933a7dea2aa07b60b2e95cb224e949 100644 (file)
@@ -84,6 +84,12 @@ public:
      * @param[in] indicator The indicator that has finished uploading.
      */
     virtual void IndicatorClosed(Indicator* indicator) = 0;
+
+    /**
+     * Notify the observer when the indicator visible status is changed.
+     * @param[in] isShowing Whether the indicator is visible.
+     */
+    virtual void IndicatorVisibilityChanged( bool isVisible ) = 0;
   };
 
 protected:
index 0ba73f9b350fa6fff60f22c77be0b949481a5d47..86b82ed8cea35a946158ddff5390c7ef8fc25edc 100644 (file)
@@ -59,6 +59,8 @@ typedef IntrusivePtr<Orientation> OrientationPtr;
 class Window : public Dali::BaseObject, public Indicator::Observer, public LifeCycleObserver
 {
 public:
+  typedef Dali::Window::IndicatorSignalV2 IndicatorSignalV2;
+
   /**
    * Create a new Window. This should only be called once by the Application class
    * @param[in] windowPosition The position and size of the window
@@ -222,6 +224,11 @@ private: // Indicator::Observer interface
    */
   virtual void IndicatorClosed(Indicator* indicator);
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorVisibilityChanged()
+   */
+  virtual void IndicatorVisibilityChanged( bool isVisible );
+
 private: // Adaptor::Observer interface
 
   /**
@@ -249,6 +256,12 @@ private: // Adaptor::Observer interface
    */
   virtual void OnDestroy();
 
+public: // Signals
+  /**
+   * The user should connect to this signal to get a timing when indicator was shown / hidden.
+   */
+  IndicatorSignalV2& IndicatorVisibilityChangedSignal() { return mIndicatorVisibilityChangedSignalV2; }
+
 private:
 
   typedef std::vector<Indicator*> DiscardedIndicators;
@@ -275,6 +288,9 @@ private:
   OrientationPtr                               mOrientation;
   std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
   Dali::Window::WindowOrientation              mPreferredOrientation;
+
+  // Signals
+  IndicatorSignalV2 mIndicatorVisibilityChangedSignalV2;
 };
 
 } // namespace Adaptor
index 97998d08bcb69e5c832f8cf256d4590cf079e0be..04eac7c3f5c22237241802982150730d79fca315 100644 (file)
@@ -60,6 +60,11 @@ void Window::ShowIndicator( IndicatorVisibleMode visibleMode )
   GetImplementation(*this).ShowIndicator( visibleMode );
 }
 
+Window::IndicatorSignalV2& Window::IndicatorVisibilityChangedSignal()
+{
+  return GetImplementation(*this).IndicatorVisibilityChangedSignal();
+}
+
 void Window::SetIndicatorBgOpacity( IndicatorBgOpacity opacity )
 {
   GetImplementation(*this).SetIndicatorBgOpacity( opacity );
index 94e749e6b177d3544f0532f9aedc5d2581b316b5..f360f083ee19e01efe413660c5d7e1cb8c74fbb4 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/any.h>
+#include <dali/public-api/signals/dali-signal-v2.h>
 
 namespace Dali
 {
@@ -49,6 +50,9 @@ class Orientation;
  */
 class DALI_IMPORT_API Window : public BaseHandle
 {
+public:
+  typedef SignalV2< void (bool) > IndicatorSignalV2;
+
 public:
 
   // Enumerations
@@ -240,6 +244,12 @@ public:
 
   Any GetNativeHandle() const;
 
+public: // Signals
+  /**
+   * The user should connect to this signal to get a timing when indicator was shown / hidden.
+   */
+  IndicatorSignalV2& IndicatorVisibilityChangedSignal();
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by Dali::Application::GetWindow().
index e4f9f8ff2c724936df5ec1d7e85f1aeac95081cb..528a9bc2797ecd87ebedfbb31984a444f4c41f3f 100644 (file)
@@ -310,6 +310,11 @@ void Window::IndicatorClosed( Indicator* indicator )
   }
 }
 
+void Window::IndicatorVisibilityChanged(bool isVisible)
+{
+  mIndicatorVisibilityChangedSignalV2.Emit(isVisible);
+}
+
 void Window::SetIndicatorActorRotation()
 {
   DALI_LOG_TRACE_METHOD( gWindowLogFilter );
index 88493f33673610371c2fa467773f3d83ff2b8d71..b617086379f40c79e53fab52b9035ecc4cd42e3b 100644 (file)
@@ -487,6 +487,11 @@ void Window::IndicatorClosed( Indicator* indicator )
   }
 }
 
+void Window::IndicatorVisibilityChanged(bool isVisible)
+{
+  mIndicatorVisibilityChangedSignalV2.Emit(isVisible);
+}
+
 void Window::SetIndicatorActorRotation()
 {
   DALI_LOG_TRACE_METHOD( gWindowLogFilter );