[4.0] Changed internal property to public-api and added public-api 99/155399/2
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Fri, 29 Sep 2017 11:39:50 +0000 (20:39 +0900)
committerTaeyoon Lee <taeyoon0.lee@samsung.com>
Fri, 13 Oct 2017 05:44:17 +0000 (05:44 +0000)
 - TerminateWidget()
 - RETRY_TEXT, EFFECT

Change-Id: Ie4c26270906bbda68517924472a9f055cdfd5277

widget_viewer_dali/internal/widget_view/widget_view_impl.cpp
widget_viewer_dali/internal/widget_view/widget_view_impl.h
widget_viewer_dali/public_api/widget_view/widget_view.cpp
widget_viewer_dali/public_api/widget_view/widget_view.h

index b86aac75c3f433020a846ca7c395e87d0339dcef..f34c02609d0c65efea9d9e22e2f47cc473351149 100644 (file)
@@ -80,16 +80,15 @@ DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "preview", MAP, PREVIE
 DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "loadingText", MAP, LOADING_TEXT )
 DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "widgetStateFaulted", BOOLEAN, WIDGET_STATE_FAULTED )
 DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "permanentDelete", BOOLEAN, PERMANENT_DELETE )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "retryText", MAP, RETRY_TEXT )
+DALI_PROPERTY_REGISTRATION( Dali::WidgetView, WidgetView, "effect", MAP, EFFECT )
 
-// Internal property
-// ToDo it should be changed public property.
-const int TERMINATE_WIDGET = Dali::WidgetView::WidgetView::Property::PERMANENT_DELETE+1;
-const int RETRY_TEXT = TERMINATE_WIDGET+1;
-const int WIDGET_IMAGE = RETRY_TEXT+1;
+// Internal property for compatibility.
+const int TERMINATE_WIDGET = Dali::WidgetView::WidgetView::Property::EFFECT+1;
+const int WIDGET_IMAGE = TERMINATE_WIDGET+1;
 
 Dali::PropertyRegistration internalProperty1( typeRegistration, "terminateWidget", TERMINATE_WIDGET, Property::BOOLEAN, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty );
-Dali::PropertyRegistration internalProperty2( typeRegistration, "retryText", RETRY_TEXT, Property::MAP, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty );
-Dali::PropertyRegistration internalProperty3( typeRegistration, "widgetImage", WIDGET_IMAGE, Property::MAP, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty );
+Dali::PropertyRegistration internalProperty2( typeRegistration, "widgetImage", WIDGET_IMAGE, Property::MAP, Dali::WidgetView::Internal::WidgetView::SetProperty, Dali::WidgetView::Internal::WidgetView::GetProperty );
 
 // Signals
 DALI_SIGNAL_REGISTRATION( Dali::WidgetView, WidgetView, "widgetAdded", SIGNAL_WIDGET_ADDED )
@@ -541,15 +540,21 @@ void WidgetView::RemoveWidgetImage()
   DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::RemoveWidgetImage: Widget image is removed.\n" );
 }
 
-void WidgetView::TerminateWidget()
+bool WidgetView::TerminateWidget()
 {
   if( !mWidgetId.empty() && !mInstanceId.empty() )
   {
-    widget_instance_terminate( mInstanceId.c_str() );
+    int ret = 0;
+    ret = widget_instance_terminate( mInstanceId.c_str() );
 
     if( mPermanentDelete )
     {
-      widget_instance_destroy( mInstanceId.c_str() );
+      ret = widget_instance_destroy( mInstanceId.c_str() );
+    }
+
+    if( ret < 0 )
+    {
+      return false;
     }
 
     Dali::WidgetView::WidgetView handle( GetOwner() );
@@ -560,10 +565,12 @@ void WidgetView::TerminateWidget()
     mInstanceId.clear();
 
     CloseRemoteSurface();
+    return true;
   }
 
   DALI_LOG_INFO( gWidgetViewLogging, Debug::Verbose, "WidgetView::TerminateWidget: Widget is terminated/destroyed and deleted signal is emitted.\n" );
 
+  return false;
 }
 
 void WidgetView::SendWidgetEvent( int event )
@@ -727,22 +734,31 @@ void WidgetView::SetProperty( BaseObject* object, Property::Index index, const P
         }
         break;
       }
-      case TERMINATE_WIDGET:
+      case Dali::WidgetView::WidgetView::Property::RETRY_TEXT:
       {
-        bool del = false;
-        if( value.Get( del ) && del )
+        Property::Map map;
+
+        if( value.Get( map ) )
         {
-          impl.TerminateWidget();
+          impl.SetRetryTextPropertyMap( map );
         }
         break;
       }
-      case RETRY_TEXT:
+      case Dali::WidgetView::WidgetView::Property::EFFECT:
       {
         Property::Map map;
-
         if( value.Get( map ) )
         {
-          impl.SetRetryTextPropertyMap( map );
+          impl.SetWidgetImagePropertyMap( map );
+        }
+        break;
+      }
+      case TERMINATE_WIDGET:
+      {
+        bool del = false;
+        if( value.Get( del ) && del )
+        {
+          impl.TerminateWidget();
         }
         break;
       }
index f772df04b67cb23949b0ffc95d9e7f97e24b76ed..7009bf4b5216726628ad756b9801c5bdbbc26a42 100644 (file)
@@ -158,7 +158,7 @@ public: // Internal API
 
   void ShowRetryState( bool show );
 
-  void TerminateWidget();
+  bool TerminateWidget();
 
   void MouseIn( const Dali::TouchData& event );
 
index 064b7cd52644b16b0466796d32eb2fcd2c14d80c..f05212036b43a772619901958e4b5c3f626401e8 100644 (file)
@@ -69,6 +69,11 @@ bool WidgetView::ResumeWidget()
   return Dali::WidgetView::GetImplementation( *this ).ResumeWidget();
 }
 
+bool WidgetView::TerminateWidget()
+{
+  return Dali::WidgetView::GetImplementation( *this ).TerminateWidget();
+}
+
 bool WidgetView::CancelTouchEvent()
 {
   return Dali::WidgetView::GetImplementation( *this ).CancelTouchEvent();
index 2ac21f3b7fa95f04f7565f1b0ebdb81d1199497e..283009e21ae68ec5942e5cbbb49da1ec9ae0c838 100644 (file)
@@ -59,19 +59,19 @@ public:
 
   /**
    * @brief The start and end property ranges for this control.
-   * @SINCE_1_0.0
+   * @since_tizen 3.0
    */
   enum PropertyRange
   {
-    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,  ///< @SINCE_1_0.0
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,              ///< Reserve property indices @SINCE_1_0.0
+    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,  ///< @since_tizen 3.0
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,              ///< Reserve property indices @since_tizen 3.0
   };
 
   /**
    * @brief An enumeration of properties belonging to the WidgetView class.
    * @privlevel public
    * @privilege %http://tizen.org/privilege/widget.viewer
-   * @SINCE_1_0.0
+   * @since_tizen 3.0
    */
   struct Property
   {
@@ -79,7 +79,7 @@ public:
      * @brief An enumeration of properties belonging to the WidgetView class.
      * @privlevel public
      * @privilege %http://tizen.org/privilege/widget.viewer
-     * @SINCE_1_0.0
+     * @since_tizen 3.0
      */
     enum
     {
@@ -87,58 +87,70 @@ public:
 
       /**
        * @brief name "widgetId", Get the id of the widget, type string, read-only
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       WIDGET_ID = PROPERTY_START_INDEX,
 
       /**
        * @brief name "instanceId", type string, read-only
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       INSTANCE_ID,
 
       /**
        * @brief name "contentInfo", type string, read-only
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       CONTENT_INFO,
 
       /**
        * @brief name "title", type string, read-only
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       TITLE,
 
       /**
        * @brief name "updatePeriod", type float, read-only
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       UPDATE_PERIOD,
 
       /**
        * @brief name "preview", type boolean if it is a show/hide flag, map otherwise
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       PREVIEW,
 
       /**
        * @brief name "loadingText", type boolean if it is a show/hide flag, map otherwise
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       LOADING_TEXT,
 
       /**
-       * @brief name "widgetStateFaulted", type boolean
-       * @SINCE_1_0.0
+       * @brief name "widgetStateFaulted", type boolean, read-only
+       * @since_tizen 3.0
        */
       WIDGET_STATE_FAULTED,
 
       /**
        * @brief name "permanentDelete", type boolean
-       * @SINCE_1_0.0
+       * @since_tizen 3.0
        */
       PERMANENT_DELETE,
 
+      /**
+       * @brief name "retryText", type Property::MAP
+       * @since_tizen 4.0
+       */
+      RETRY_TEXT,
+
+      /**
+       * @brief name "effect", type Property::MAP
+       * @since_tizen 4.0
+       */
+      EFFECT
+
     };
   };
 
@@ -243,6 +255,16 @@ public:
    */
   void ActivateFaultedWidget();
 
+  /**
+   * @brief Terminates a widget instance.
+   *
+   * @since_tizen 4.0
+   * @privlevel public
+   * @privilege %http://tizen.org/privilege/widget.viewer
+   * @return true on success, false otherwise.
+   */
+  bool TerminateWidget();
+
 public: //Signals
 
   typedef Signal< void ( WidgetView ) > WidgetViewSignalType;   ///< WidgetView signal type @since_tizen 3.0