X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=public_api%2Fwidget_view%2Fwidget_view.h;h=2ac21f3b7fa95f04f7565f1b0ebdb81d1199497e;hb=481c642fd2ca8df23615a8924de69ecae5ab55b0;hp=014d9c7bb7ac4f7160c2c81875305b02139f54c7;hpb=dfd1992b7693e9019c0af6779c70093e43b28325;p=platform%2Fcore%2Fuifw%2Fwidget-viewer-dali.git diff --git a/public_api/widget_view/widget_view.h b/public_api/widget_view/widget_view.h index 014d9c7..2ac21f3 100644 --- a/public_api/widget_view/widget_view.h +++ b/public_api/widget_view/widget_view.h @@ -2,20 +2,20 @@ #define __DALI_WIDGET_VIEW_WIDGET_VIEW_H__ /* + * Samsung API * Copyright (c) 2016 Samsung Electronics Co., Ltd. * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Flora License, Version 1.1 (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 + * 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, + * 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 @@ -41,6 +41,16 @@ class WidgetView; * @brief WidgetView is a class for displaying the widget image and controlling the widget. * Input events that WidgetView gets are delivered to the widget. * + * Signals + * | %Signal Name | Method | + * |-----------------------------|----------------------------------------| + * | widgetAdded | @ref WidgetAddedSignal() | + * | widgetDeleted | @ref WidgetDeletedSignal() | + * | widgetCreationAborted | @ref WidgetCreationAbortedSignal() | + * | widgetContentUpdated | @ref WidgetContentUpdatedSignal() | + * | widgetUpdatePeriodChanged | @ref WidgetUpdatePeriodChangedSignal() | + * | widgetFaulted | @ref WidgetFaultedSignal() | + * * @since_tizen 3.0 */ class DALI_IMPORT_API WidgetView : public Toolkit::Control @@ -48,6 +58,92 @@ class DALI_IMPORT_API WidgetView : public Toolkit::Control public: /** + * @brief The start and end property ranges for this control. + * @SINCE_1_0.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 + }; + + /** + * @brief An enumeration of properties belonging to the WidgetView class. + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @SINCE_1_0.0 + */ + struct Property + { + /** + * @brief An enumeration of properties belonging to the WidgetView class. + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer + * @SINCE_1_0.0 + */ + enum + { + // Event side properties + + /** + * @brief name "widgetId", Get the id of the widget, type string, read-only + * @SINCE_1_0.0 + */ + WIDGET_ID = PROPERTY_START_INDEX, + + /** + * @brief name "instanceId", type string, read-only + * @SINCE_1_0.0 + */ + INSTANCE_ID, + + /** + * @brief name "contentInfo", type string, read-only + * @SINCE_1_0.0 + */ + CONTENT_INFO, + + /** + * @brief name "title", type string, read-only + * @SINCE_1_0.0 + */ + TITLE, + + /** + * @brief name "updatePeriod", type float, read-only + * @SINCE_1_0.0 + */ + UPDATE_PERIOD, + + /** + * @brief name "preview", type boolean if it is a show/hide flag, map otherwise + * @SINCE_1_0.0 + */ + PREVIEW, + + /** + * @brief name "loadingText", type boolean if it is a show/hide flag, map otherwise + * @SINCE_1_0.0 + */ + LOADING_TEXT, + + /** + * @brief name "widgetStateFaulted", type boolean + * @SINCE_1_0.0 + */ + WIDGET_STATE_FAULTED, + + /** + * @brief name "permanentDelete", type boolean + * @SINCE_1_0.0 + */ + PERMANENT_DELETE, + + }; + }; + + + /** * @brief Create widget view. * * @since_tizen 3.0 @@ -57,10 +153,10 @@ public: * @param[in] contentInfo Contents that will be given to the widget instance. * @param[in] width The widget width. * @param[in] height The widget height. - * @param[in] period The period of updating contents of the widget. + * @param[in] updatePeriod The period of updating contents of the widget. * @return A handle to WidgetView. */ - static WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, double period ); + static WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, float updatePeriod ); /** * @brief Downcast a handle to WidgetView handle. @@ -106,76 +202,24 @@ public: ~WidgetView(); /** - * @brief Get the id of the widget. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return The widget id on success, otherwise an empty string. - */ - const std::string& GetWidgetId() const; - - /** - * @brief Get the instance id of the widget. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return The instance id on success, otherwise an empty string. - */ - const std::string& GetInstanceId() const; - - /** - * @brief Get the content string of the widget. - * This string can be used for creating contents of widget again after reboot a device or recovered from crash(abnormal status). - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return The content string to be recognize content of the widget or an empty string if there is no specific content string. - */ - const std::string& GetContentInfo(); - - /** - * @brief Get the summarized string of the widget content for accessibility. - * If the accessibility feature is turned on, a viewer can use this text to describe the widget. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return The title string to be used for summarizing the widget or an empty string if there is no summarized text for content of given widget. - */ - const std::string& GetTitle(); - - /** - * @brief Get the update period of the widget. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return The update period of the widget. - */ - double GetPeriod() const; - - /** - * @brief Shows the widget. + * @brief Pauses a given widget. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @note Use this function instead of Dali::Actor::SetVisible() to restart updating widget content. + * @return true on success, false otherwise. */ - void Show(); + bool PauseWidget(); /** - * @brief Hides the widget. + * @brief Resume a given widget. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @note Use this function instead of Dali::Actor::SetVisible() to stop updating widget content. + * @return true on success, false otherwise. */ - void Hide(); + bool ResumeWidget(); /** * @brief Cancels touch event procedure. @@ -190,98 +234,83 @@ public: bool CancelTouchEvent(); /** - * @brief Sets whether to enable or disable the preview of the widget + * @brief Activate a widget in faulted state. + * A widget in faulted state MUST be activated before adding the widget. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @param[in] enable Whether to enable the preview of the widget or not */ - void SetPreviewEnabled( bool enabled ); + void ActivateFaultedWidget(); - /** - * @brief Checks if the preview of the widget has been enabled or not. - * - * @since_tizen 3.0 - * @privlevel public - * @privilege %http://tizen.org/privilege/widget.viewer - * @return Whether the preview of the widget is enabled - */ - bool GetPreviewEnabled() const; +public: //Signals + + typedef Signal< void ( WidgetView ) > WidgetViewSignalType; ///< WidgetView signal type @since_tizen 3.0 /** - * @brief Sets whether to enable or disable the state message of the widget + * @brief This signal is emitted when the widget is added. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @param[in] enable Whether to enable the state message of the widget or not + * @return The signal to connect to. */ - void SetStateTextEnabled( bool enabled ); + WidgetViewSignalType& WidgetAddedSignal(); /** - * @brief Checks if the state message of the widget has been enabled or not. + * @brief This signal is emitted when the widget is deleted. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @return Whether the state message of the widget is enabled + * @return The signal to connect to. */ - bool GetStateTextEnabled() const; + WidgetViewSignalType& WidgetDeletedSignal(); /** - * @brief Activate a widget in faulted state. - * A widget in faulted state MUST be activated before adding the widget. + * @brief This signal is emitted when the widget creation is aborted. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer + * @return The signal to connect to. */ - void ActivateFaultedWidget(); + WidgetViewSignalType& WidgetCreationAbortedSignal(); /** - * @brief Check whether the widget is faulted. + * @brief This signal is emitted when the widget content is updated. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @return true for faulted state, otherwise false. + * @return The signal to connect to. */ - bool IsWidgetFaulted(); + WidgetViewSignalType& WidgetContentUpdatedSignal(); /** - * @brief Set the deletion mode. + * @brief This signal is emitted when the widget update period is changed. * * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/widget.viewer - * @param[in] permanentDelete Pass true if you want to delete this widget instance permanently, or pass false if you want to keep it and it will be re-created soon. - */ - void SetPermanentDelete( bool permanentDelete ); - -public: //Signals - - typedef Signal< void ( WidgetView ) > WidgetViewSignalType; ///< WidgetView signal type @since_tizen 3.0 - - /** - * @brief This signal is emitted when the widget is added. - * - * @since_tizen 3.0 * @return The signal to connect to. */ - WidgetViewSignalType& WidgetAddedSignal(); + WidgetViewSignalType& WidgetUpdatePeriodChangedSignal(); /** - * @brief This signal is emitted when the widget is deleted. + * @brief This signal is emitted when the widget process is not running. * * @since_tizen 3.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/widget.viewer * @return The signal to connect to. */ - WidgetViewSignalType& WidgetDeletedSignal(); + WidgetViewSignalType& WidgetFaultedSignal(); public: // Not intended for application developers /** + * @internal * @brief Creates a handle using the WidgetView::Internal implementation. * * @since_tizen 3.0 @@ -290,6 +319,7 @@ public: // Not intended for application developers DALI_INTERNAL WidgetView( Internal::WidgetView& implementation ); /** + * @internal * @brief Allows the creation of this control from an Internal::CustomActor pointer. * * @since_tizen 3.0