1 #ifndef __DALI_WIDGET_VIEW_INTERNAL_WIDGET_VIEW_H__
2 #define __DALI_WIDGET_VIEW_INTERNAL_WIDGET_VIEW_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <public_api/widget_view/widget_view.h>
25 #include <dali-toolkit/public-api/controls/control-impl.h>
26 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
27 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
28 #include <pepper-dali/public-api/object-view/object-view.h>
40 class WidgetView : public Toolkit::Internal::Control
45 * @copydoc Dali::WidgetView::WidgetView::New
47 static Dali::WidgetView::WidgetView New( const std::string& widgetId, const std::string& contentInfo, int width, int height, double period );
50 * @copydoc Dali::WidgetView::WidgetView::GetWidgetId
52 const std::string& GetWidgetId() const;
55 * @copydoc Dali::WidgetView::WidgetView::GetInstanceId
57 const std::string& GetInstanceId() const;
60 * @copydoc Dali::WidgetView::WidgetView::GetContentInfo
62 const std::string& GetContentInfo();
65 * @copydoc Dali::WidgetView::WidgetView::GetTitle
67 const std::string& GetTitle();
70 * @copydoc Dali::WidgetView::WidgetView::GetPeriod
72 double GetPeriod() const;
75 * @copydoc Dali::WidgetView::WidgetView::CancelTouchEvent
77 bool CancelTouchEvent();
80 * @copydoc Dali::WidgetView::WidgetView::SetPreviewEnabled
82 void SetPreviewEnabled( bool enabled );
85 * @copydoc Dali::WidgetView::WidgetView::GetPreviewEnabled
87 bool GetPreviewEnabled() const;
90 * @copydoc Dali::WidgetView::WidgetView::SetStateTextEnabled
92 void SetStateTextEnabled( bool enabled );
95 * @copydoc Dali::WidgetView::WidgetView::GetStateTextEnabled
97 bool GetStateTextEnabled() const;
100 * @copydoc Dali::WidgetView::WidgetView::ActivateFaultedWidget
102 void ActivateFaultedWidget();
105 * @copydoc Dali::WidgetView::WidgetView::IsWidgetFaulted
107 bool IsWidgetFaulted();
110 * @copydoc Dali::WidgetView::WidgetView::SetPermanentDelete
112 void SetPermanentDelete( bool permanentDelete );
114 void AddObjectView( Pepper::ObjectView objectView );
115 void RemoveObjectView();
119 Dali::WidgetView::WidgetView::WidgetViewSignalType& WidgetAddedSignal();
120 Dali::WidgetView::WidgetView::WidgetViewSignalType& WidgetDeletedSignal();
125 * Construct a new WidgetView.
130 * Construct a new WidgetView.
132 WidgetView( const std::string& widgetId, const std::string& contentInfo, int width, int height, double period );
135 * A reference counted object may only be deleted by calling Unreference()
137 virtual ~WidgetView();
139 private: // From Control
142 * @copydoc Toolkit::Control::OnInitialize()
144 virtual void OnInitialize();
149 WidgetView( const WidgetView& );
152 WidgetView& operator= ( const WidgetView& );
156 Pepper::ObjectView mObjectView; ///< Widget content
157 Toolkit::ImageView mPreviewImage; ///< Preview image
158 Toolkit::TextLabel mStateText; ///< State text
160 std::string mWidgetId;
161 std::string mInstanceId;
162 std::string mContentInfo;
172 bool mPreviewEnabled;
173 bool mStateTextEnabled;
174 bool mPermanentDelete;
177 Dali::WidgetView::WidgetView::WidgetViewSignalType mWidgetAddedSignal;
178 Dali::WidgetView::WidgetView::WidgetViewSignalType mWidgetDeletedSignal;
181 } // namespace Internal
183 // Helpers for public-api forwarding methods
185 inline Internal::WidgetView& GetImplementation( WidgetView& widgetView )
187 DALI_ASSERT_ALWAYS( widgetView );
189 Dali::RefObject& handle = widgetView.GetImplementation();
191 return static_cast<Internal::WidgetView&>( handle );
194 inline const Internal::WidgetView& GetImplementation( const WidgetView& widgetView )
196 DALI_ASSERT_ALWAYS( widgetView );
198 const Dali::RefObject& handle = widgetView.GetImplementation();
200 return static_cast<const Internal::WidgetView&>( handle );
203 } // namespace WidgetView
207 #endif // __DALI_WIDGET_VIEW_INTERNAL_WIDGET_VIEW_H__