Merge "Added TextLabel and TextField tests" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / popup / popup-impl.h
index 747df4c..f695c74 100755 (executable)
@@ -1,27 +1,34 @@
 #ifndef __DALI_TOOLKIT_INTERNAL_POPUP_H__
 #define __DALI_TOOLKIT_INTERNAL_POPUP_H__
 
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/popup/popup.h>
 #include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
+#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 
 namespace Dali
 {
@@ -43,7 +50,7 @@ typedef IntrusivePtr<PopupStyle> PopupStylePtr;
 /**
  * @copydoc Toolkit::Popup
  */
-class Popup : public ControlImpl
+class Popup : public Control
 {
 public:
 
@@ -78,14 +85,9 @@ public:
   void SetTitle( const std::string& text );
 
   /**
-   * @copydoc Toolkit::Popup::SetTitle( TextView titleActor )
-   */
-  void SetTitle( Toolkit::TextView titleActor );
-
-  /**
    * @copydoc Toolkit::Popup::GetTitle
    */
-  Toolkit::TextView GetTitle() const;
+  std::string GetTitle() const;
 
   /**
    * @copydoc Toolkit::Popup::AddButton
@@ -117,7 +119,6 @@ public:
    */
   void HideTail();
 
-
   /**
    * Sets the style of the popup
    * @param[in] style The style of the popup
@@ -130,6 +131,11 @@ public:
    */
   PopupStylePtr GetStyle() const;
 
+  /**
+   * @copydoc Toolkit::Popup::MarkDirtyForRelayout
+   */
+  void MarkDirtyForRelayout();
+
 protected:
 
   /**
@@ -179,12 +185,12 @@ public: // Signals
   /**
    * @copydoc Dali::Toolkit::Popup::OutsideTouchedSignal()
    */
-  Toolkit::Popup::TouchedOutsideSignalV2& OutsideTouchedSignal();
+  Toolkit::Popup::TouchedOutsideSignalType& OutsideTouchedSignal();
 
   /**
    * @copydoc Dali::Toolkit::Popup::HiddenSignal()
    */
-  Toolkit::Popup::HiddenSignalV2& HiddenSignal();
+  Toolkit::Popup::HiddenSignalType& HiddenSignal();
 
   /**
    * Connects a callback function with the object's signals.
@@ -240,18 +246,23 @@ private:
   virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
 
   /**
-   * From ControlImpl; called after a child has been added to the owning actor.
+   * From Control; called after a child has been added to the owning actor.
    * @param[in] child The child which has been added.
    */
   virtual void OnControlChildAdd( Actor& child );
 
   /**
-   * @copydoc Toolkit::ControlImpl::OnRelaidOut()
+   * @copydoc Control::OnRelayOut()
+   */
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+  /**
+   * @copydoc Control::OnSetResizePolicy()
    */
-  virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container );
+  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
 
   /**
-   * @copydoc Toolkit::ControlImpl::OnKeyEvent()
+   * @copydoc Control::OnKeyEvent()
    */
   virtual bool OnKeyEvent(const KeyEvent& event);
 
@@ -273,7 +284,12 @@ private:
   /**
    * @copydoc Control::GetNextKeyboardFocusableActor()
    */
-  Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
+  Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
+
+  /**
+   * Create the root actor for the footer
+   */
+  void CreateFooter();
 
 private:
 
@@ -298,14 +314,14 @@ private:
   bool mShowing;                          ///< Popup is showing or not
 
   Layer mLayer;                           ///< Popup Layer (i.e. Dim backing and PopupBg reside in this)
-  Actor mPopupBg;                         ///< Popup Background (i.e. dialog reside in this)
+  Toolkit::TableView mPopupLayout;        ///< Popup layout (i.e. dialog reside in this)
   ImageActor mBacking;                    ///< Backing actor (dim effect)
 
   Actor mPreviousFocusedActor;            ///< Store the previous focused actor to restore the focus when popup hide
 
   Actor mBackgroundImage;                 ///< Stores the background image.
   Actor mButtonAreaImage;                 ///< Stores the button background image.
-  Toolkit::TextView mTitle;               ///< Stores the text title.
+  Toolkit::TextLabel mTitle;               ///< Stores the text title.
   Actor mContent;                         ///< Stores popup's content.
   Actor mBottomBg;                        ///< bottom button bar background. ImageActor is replaced with Actor due to hidden image.
   Actor mTailImage;                       ///< Stores the tail image
@@ -318,8 +334,8 @@ private:
 
   LayoutInfo mLayoutInfo;                 ///< Stores sizes of all popup components.
 
-  Toolkit::Popup::TouchedOutsideSignalV2 mTouchedOutsideSignalV2;
-  Toolkit::Popup::HiddenSignalV2 mHiddenSignalV2;
+  Toolkit::Popup::TouchedOutsideSignalType mTouchedOutsideSignal;
+  Toolkit::Popup::HiddenSignalType mHiddenSignal;
 
   Property::Index mPropertyTitle;         ///< Property index for Title.
   Property::Index mPropertyState;         ///< Property index for popup state.