React to window delete events & handle SIGTERM, SIGHUP
[platform/core/uifw/dali-adaptor.git] / adaptors / common / window-impl.h
index 32068da..d1403b5 100644 (file)
@@ -59,15 +59,17 @@ class Window : public Dali::BaseObject, public Indicator::Observer, public LifeC
 {
 public:
   typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
+  typedef Signal< void () > SignalType;
 
   /**
    * Create a new Window. This should only be called once by the Application class
    * @param[in] windowPosition The position and size of the window
    * @param[in] name The window title
+   * @param[in] className The window class name
    * @param[in] isTransparent Whether window is transparent
    * @return A newly allocated Window
    */
-  static Window* New(const PositionSize& posSize, const std::string& name, bool isTransparent = false);
+  static Window* New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent = false);
 
   /**
    * Pass the adaptor back to the overlay. This allows the window to access Core's overlay.
@@ -82,11 +84,6 @@ public:
   RenderSurface* GetSurface();
 
   /**
-   * @copydoc Dali::Window::SetIndicatorStyle()
-   */
-  void SetIndicatorStyle( Dali::Window::IndicatorStyle style );
-
-  /**
    * @copydoc Dali::Window::ShowIndicator()
    */
   void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode );
@@ -122,11 +119,6 @@ public:
   void Activate();
 
   /**
-   * @copydoc Dali::Window::GetOrientation()
-   */
-  OrientationPtr GetOrientation();
-
-  /**
    * @copydoc Dali::Window::AddAvailableOrientation()
    */
   void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
@@ -186,7 +178,7 @@ private:
   /**
    * Second stage initialization
    */
-  void Initialize(const PositionSize& posSize, const std::string& name);
+  void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className);
 
   /**
    * Shows / hides the indicator bar.
@@ -255,23 +247,29 @@ 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.
    */
   IndicatorSignalType& IndicatorVisibilityChangedSignal() { return mIndicatorVisibilityChangedSignal; }
 
+  /**
+   * This signal is emitted when the window is requesting to be deleted
+   */
+  SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; }
+
 private:
 
   typedef std::vector<Indicator*> DiscardedIndicators;
 
   RenderSurface*                   mSurface;
-  Dali::Window::IndicatorStyle     mIndicatorStyle;     ///< indicator style
   Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
   bool                             mIndicatorIsShown:1; ///< private state
   bool                             mShowRotatedIndicatorOnClose:1;
   bool                             mStarted:1;
   bool                             mIsTransparent:1;
   bool                             mWMRotationAppSet:1;
+  bool                             mEcoreEventHander:1;
   Indicator*                       mIndicator;
   Dali::Window::WindowOrientation  mIndicatorOrientation;
   Dali::Window::WindowOrientation  mNextIndicatorOrientation;
@@ -289,6 +287,7 @@ private:
 
   // Signals
   IndicatorSignalType mIndicatorVisibilityChangedSignal;
+  SignalType          mDeleteRequestSignal;
 };
 
 } // namespace Adaptor