--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 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.
+//
+
+/**
+ * @file FShellIAppWidgetViewEventListener.h
+ * @brief This is the header file for the %IAppWidgetViewEventListener interface.
+ *
+ * This header file contains the declarations of the %IAppWidgetViewEventListener interface.
+ */
+
+#ifndef _FSHELL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_
+#define _FSHELL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_
+
+#include <FBaseRtIEventListener.h>
+
+namespace Tizen { namespace Shell
+{
+
+class LiveboxView;
+
+/*
+ * @interface IAppWidgetViewEventListener
+ * @brief This interface defines a listener for the AppWidgetView that receives AppWidgetProvider removed event.
+ *
+ * @since 2.1
+ *
+ * The %IAppWidgetViewEventListener interface defines a listener for the AppWidgetView that receives AppWidgetProvider removed event.
+ */
+class _OSP_EXPORT_ IAppWidgetViewEventListener
+ : public Tizen::Base::Runtime::IEventListener
+{
+public:
+ /*\r
+ * This polymorphic destructor should be overridden if required.\r
+ * This way, the destructors of the derived classes are called when the destructor of this interface is called.\r
+ *\r
+ * @since 2.1\r
+ */
+ virtual ~IAppWidgetViewEventListener(void) {}
+
+ /*\r
+ * Called when a LiveboxProvider instance is about to be removed. @n\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @param[in] liveboxView The source of the event\r
+ */\r
+ virtual void OnAppWidgetProviderRemoved(LiveboxView& liveboxView) = 0;
+
+protected:
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related,\r
+ // and consistency-related issues in the application.\r
+ //\r
+ // Following method is reserved and may change its name at any time without prior notice.\r
+ //\r
+ virtual void IAppWidgetViewEventListener_Reserved1(void) {}\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related,\r
+ // and consistency-related issues in the application.\r
+ //\r
+ // Following method is reserved and may change its name at any time without prior notice.\r
+ //\r
+ virtual void IAppWidgetViewEventListener_Reserved2(void) {}\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related,\r
+ // and consistency-related issues in the application.\r
+ //\r
+ // Following method is reserved and may change its name at any time without prior notice.\r
+ //\r
+ virtual void IAppWidgetViewEventListener_Reserved3(void) {}\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related,\r
+ // and consistency-related issues in the application.\r
+ //\r
+ // Following method is reserved and may change its name at any time without prior notice.\r
+ //\r
+ virtual void IAppWidgetViewEventListener_Reserved4(void) {}\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related,\r
+ // and consistency-related issues in the application.\r
+ //\r
+ // Following method is reserved and may change its name at any time without prior notice.\r
+ //\r
+ virtual void IAppWidgetViewEventListener_Reserved5(void) {}
+};
+
+}} // Tizen::Shell
+
+#endif /* _FSHELL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_ */
namespace Tizen { namespace Shell
{
+class IAppWidgetViewEventListener;
+class LiveboxProviderInfo;
+
/**
* @class LiveboxView
* @brief This class provides the view control for a LiveboxViewer.
*/\r
result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& userInfo);
+ /*
+ * Gets a LiveboxProviderInfo of the specified Livebox provider.
+ *
+ * @since 2.1
+ *
+ * @return A pointer to the LiveboxProviderInfo of the specified LiveboxProvider@n
+ * else @c null if an error occurs
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_APP_NOT_INSTALLED The application is not installed.
+ * @exception E_OBJ_NOT_FOUND The specified Livebox provider is not found.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ LiveboxProviderInfo* GetAppWidgetProviderInfoN(void) const;
+
+ /*\r
+ * Adds an IAppWidgetViewEventListener instance. @n\r
+ *\r
+ * @since 2.1\r
+ * @return An error code\r
+ * @param[in] listener The listener to add @n\r
+ * The listener must be allocated at heap, not stack.\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OBJ_ALREADY_EXIST The listener has already been added.\r
+ * @see RemoveAppWidgetViewEventListener()\r
+ */\r
+ result AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
+
+ /*\r
+ * Removes an IAppWidgetViewEventListener instance. @n\r
+ * The removed listener cannot listen to the events when they are fired.\r
+ *\r
+ * @since 2.1\r
+ * @return An error code\r
+ * @param[in] listener The listener to remove @n\r
+ * The listener should be referring to previously allocated instance which is passed as an argument to AddAppWidgetViewEventListener().\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OBJ_NOT_FOUND The specified listener cannot be found.\r
+ * @see AddAppWidgetViewEventListener()\r
+ */\r
+ result RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
+
protected:
//
// This method is for internal use only. Using this method can cause behavioral, security-related,
return r;
}
+LiveboxProviderInfo*
+LiveboxView::GetAppWidgetProviderInfoN(void) const
+{
+ const _LiveboxViewImpl* pImpl = _LiveboxViewImpl::GetInstance(*this);
+ SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ LiveboxProviderInfo* pProviderInfo = pImpl->GetAppWidgetProviderInfoN();
+ result r = GetLastResult();\r
+ SysTryReturn(NID_UI_CTRL, pProviderInfo, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pProviderInfo;
+}
+
+result
+LiveboxView::AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener)
+{
+ _LiveboxViewImpl* pImpl = _LiveboxViewImpl::GetInstance(*this);
+ SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = pImpl->AddAppWidgetViewEventListener(listener);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return r;
+}
+
+result
+LiveboxView::RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener)
+{
+ _LiveboxViewImpl* pImpl = _LiveboxViewImpl::GetInstance(*this);
+ SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = pImpl->RemoveAppWidgetViewEventListener(listener);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return r;
+}
+
}} // Tizen::Shell
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 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.
+//
+
+/**
+ * @file FShell_IAppWidgetViewEventListener.h
+ * @brief This is the header file for the %_IAppWidgetViewEventListener interface.
+ *
+ * This header file contains the declarations of the %_IAppWidgetViewEventListener interface.
+ */
+
+#ifndef _FSHELL_INTERNAL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_
+#define _FSHELL_INTERNAL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_
+
+#include <FBaseRtIEventListener.h>
+
+namespace Tizen { namespace Shell
+{
+
+class _LiveboxView;
+
+/*
+ * @interface _IAppWidgetViewEventListener
+ * @brief This interface defines a listener for the AppWidgetView that receives AppWidgetProvider removed event.
+ *
+ * @since 2.1
+ *
+ * The %_IAppWidgetViewEventListener interface defines a listener for the AppWidgetView that receives AppWidgetProvider removed event.
+ */
+class _OSP_EXPORT_ _IAppWidgetViewEventListener
+ : public Tizen::Base::Runtime::IEventListener
+{
+public:
+ /*\r
+ * This polymorphic destructor should be overridden if required.\r
+ * This way, the destructors of the derived classes are called when the destructor of this interface is called.\r
+ *\r
+ * @since 2.1\r
+ */
+ virtual ~_IAppWidgetViewEventListener(void) {}
+
+ /*\r
+ * Called when a LiveboxProvider instance is about to be removed. @n\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @param[in] liveboxView The source of the event\r
+ */\r
+ virtual void OnAppWidgetProviderRemoved(_LiveboxView& liveboxView) = 0;
+};
+
+}} // Tizen::Shell
+
+#endif /* _FSHELL_INTERNAL_IAPP_WIDGET_VIEW_EVENT_LISTENER_H_ */
* software keypad related events.
*/
class _ILiveboxPopupViewEventListener
- : virtual public Tizen::Base::Runtime::IEventListener
+ : public Tizen::Base::Runtime::IEventListener
{
public:
/**
#include <new>
#include <livebox.h>
+#include <FBaseColLinkedListT.h>
#include <FBaseSysLog.h>
#include <FBaseString.h>
#include <FGrpBitmap.h>
#include <FGrp_BitmapImpl.h>
#include <FMedia_ImageDecoder.h>
#include "FUi_TouchFlickGestureDetector.h"
+#include "FShell_IAppWidgetViewEventListener.h"
+#include "FShell_LiveboxManagerImpl.h"
#include "FShell_LiveboxView.h"
#include "FShell_LiveboxViewPresenter.h"
#include "FShell_LiveboxPopupView.h"
using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
, __resizeFromRemote(false)
, __updated(false)
, __pixmap(-1)
+ , __pAppWidgetViewEventListenerList(new (std::nothrow) LinkedListT<_IAppWidgetViewEventListener*>)
{
__pLiveboxViewManager = _LiveboxViewManager::GetInstance();
SysTryReturnVoidResult(NID_UI_CTRL, __pLiveboxViewManager, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
return r;
}
+LiveboxProviderInfo*\r
+_LiveboxView::GetAppWidgetProviderInfoN(void) const\r
+{\r
+ LiveboxProviderInfo* pProviderInfo = _LiveboxManagerImpl::GetInstance()->GetLiveboxProviderInfoN(GetAppId(), GetProviderName());\r
+ result r = GetLastResult();\r
+ SysTryReturn(NID_UI_CTRL, pProviderInfo, null, r, "[%s] Propagating.", GetErrorMessage(r));\r
+ \r
+ return pProviderInfo;\r
+}\r
+\r
+result
+_LiveboxView::AddAppWidgetViewEventListener(_IAppWidgetViewEventListener& listener)
+{
+ bool exist = __pAppWidgetViewEventListenerList->Contains(&listener);
+ SysTryReturn(NID_UI_CTRL, exist, E_OBJ_ALREADY_EXIST, E_OBJ_ALREADY_EXIST, "[%s] Propagating.", GetErrorMessage(E_OBJ_ALREADY_EXIST));
+
+ __pAppWidgetViewEventListenerList->Add(&listener);
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxView::RemoveAppWidgetViewEventListener(_IAppWidgetViewEventListener& listener)
+{
+ result r = __pAppWidgetViewEventListenerList->Remove(&listener);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
+
+ return E_SUCCESS;
+}
+
_LiveboxPopupView*
_LiveboxView::GetLiveboxPopup(void) const
{
return __pLiveboxViewPresenter->GetLiveboxId();
}
+String
+_LiveboxView::GetProviderName(void) const
+{
+ return __pLiveboxViewPresenter->GetProviderName();
+}
+
Bitmap*
_LiveboxView::GetAppIconBitmap(void) const
{
#include <Ecore.h>
#include <Ecore_X.h>
#include <FAppTypes.h>
+#include <FBaseColIListT.h>
#include "FUi_Control.h"
#include "FUi_ITouchFlickGestureEventListener.h"
#include "FUiAnim_VisualElement.h"
namespace Tizen { namespace Shell
{
-
+class LiveboxProviderInfo;
+class _IAppWidgetViewEventListener;
class _LiveboxViewPresenter;
class _LiveboxPopupView;
virtual ~_LiveboxView(void);
result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& userInfo);
+ LiveboxProviderInfo* GetAppWidgetProviderInfoN(void) const;\r
+ result AddAppWidgetViewEventListener(_IAppWidgetViewEventListener& listener);
+ result RemoveAppWidgetViewEventListener(_IAppWidgetViewEventListener& listener);
_LiveboxPopupView* GetLiveboxPopup(void) const;
Tizen::Base::String GetAppId(void) const;
Tizen::Base::String GetLiveboxId(void) const;
+ Tizen::Base::String GetProviderName(void) const;
Tizen::Graphics::Bitmap* GetAppIconBitmap(void) const;
Tizen::Graphics::Bitmap* GetBitmap(void) const;
bool IsUpdated(void) const;
}
};
std::unique_ptr<Ecore_Event_Handler, _EcoreEventHandlerDeleter> __pPixmapEventHandler;
+ std::unique_ptr<Tizen::Base::Collection::IListT<_IAppWidgetViewEventListener*> > __pAppWidgetViewEventListenerList;
}; // _LiveboxView
}} // Tizen::Shell
#include <new>
#include <unique_ptr.h>
+#include <FBaseColIEnumeratorT.h>
+#include <FBaseColLinkedListT.h>
#include <FBaseSysLog.h>
#include <FBaseString.h>
#include <FGrpPoint.h>
+#include <FShellIAppWidgetViewEventListener.h>
#include "FShell_LiveboxViewImpl.h"
using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
namespace Tizen { namespace Shell
_LiveboxViewImpl::_LiveboxViewImpl(LiveboxView* pPublic, _LiveboxView* pCore)
: _ContainerImpl(pPublic, pCore)
+ , __pAppWidgetViewEventListenerList(new (std::nothrow) LinkedListT<IAppWidgetViewEventListener*>)
{
}
_LiveboxViewImpl::~_LiveboxViewImpl(void)
{
+ GetCore().RemoveAppWidgetViewEventListener(*this);
}
const char*
return static_cast<_LiveboxView&>(_ControlImpl::GetCore());
}
+void
+_LiveboxViewImpl::OnAppWidgetProviderRemoved(_LiveboxView& liveboxView)
+{
+ unique_ptr<IEnumeratorT<IAppWidgetViewEventListener*> > pEnumerator(__pAppWidgetViewEventListenerList->GetEnumeratorN());
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ IAppWidgetViewEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ if (pListener)
+ {
+ pListener->OnAppWidgetProviderRemoved(GetPublic());
+ }
+ }
+ }
+}
+
result
_LiveboxViewImpl::Initialize(const AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const String& userInfo)
{
result r = GetCore().Initialize(appId, providerName, rect, userInfo);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetCore().AddAppWidgetViewEventListener(*this);
+
return r;
}
+LiveboxProviderInfo*\r
+_LiveboxViewImpl::GetAppWidgetProviderInfoN(void) const\r
+{\r
+ LiveboxProviderInfo* pProviderInfo = GetCore().GetAppWidgetProviderInfoN();
+ result r = GetLastResult();\r
+ SysTryReturn(NID_UI_CTRL, pProviderInfo, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pProviderInfo;\r
+}\r
+\r
+result
+_LiveboxViewImpl::AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener)
+{
+ bool exist = __pAppWidgetViewEventListenerList->Contains(&listener);
+ SysTryReturn(NID_UI_CTRL, exist, E_OBJ_ALREADY_EXIST, E_OBJ_ALREADY_EXIST, "[%s] Propagating.", GetErrorMessage(E_OBJ_ALREADY_EXIST));
+
+ __pAppWidgetViewEventListenerList->Add(&listener);
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxViewImpl::RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener)
+{
+ result r = __pAppWidgetViewEventListenerList->Remove(&listener);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
+
+ return E_SUCCESS;
+}
+
}} // Tizen::Shell
#ifndef _FSHELL_INTERNAL_LIVEBOX_VIEW_IMPL_H_
#define _FSHELL_INTERNAL_LIVEBOX_VIEW_IMPL_H_
+#include <unique_ptr.h>
#include <FAppTypes.h>
#include <FShellLiveboxView.h>
#include "FUi_ContainerImpl.h"
+#include "FShell_IAppWidgetViewEventListener.h"
#include "FShell_LiveboxView.h"
namespace Tizen { namespace Base
class _LiveboxViewImpl
: public Tizen::Ui::_ContainerImpl
+ , public _IAppWidgetViewEventListener
{
public:
static _LiveboxViewImpl* CreateLiveboxViewImplN(LiveboxView& liveBoxView);
virtual _LiveboxView& GetCore(void);
result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& userInfo);
+ LiveboxProviderInfo* GetAppWidgetProviderInfoN(void) const;\r
+ result AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
+ result RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
protected:
_LiveboxViewImpl(LiveboxView* pPublic, _LiveboxView* pCore);
private:
_LiveboxViewImpl(const _LiveboxViewImpl& rhs);
_LiveboxViewImpl& operator =(const _LiveboxViewImpl& rhs);
+
+ virtual void OnAppWidgetProviderRemoved(_LiveboxView& liveboxView);
+
+private:
+ std::unique_ptr<Tizen::Base::Collection::IListT<IAppWidgetViewEventListener*> > __pAppWidgetViewEventListenerList;
}; // _LiveboxViewImpl
}} // Tizen::Shell
return __liveboxId;
}
-Tizen::Base::String
+String
_LiveboxViewModel::GetProviderName(void) const
{
return __providerName;
return __pLiveboxViewModel->GetLiveboxId();
}
+String
+_LiveboxViewPresenter::GetProviderName(void) const
+{
+ return __pLiveboxViewModel->GetProviderName();
+}
String
_LiveboxViewPresenter::GetDisplayName(void) const
result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
Tizen::App::AppId GetAppId(void) const;
Tizen::Base::String GetLiveboxId(void) const;
+ Tizen::Base::String GetProviderName(void) const;
Tizen::Base::String GetDisplayName(void) const;
Tizen::Base::String GetAppIconPath(void) const;