--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 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.
+//
+
+/**
+ * @file FShellIILiveboxAddRequestListener.h
+ * @brief This is the header file for the %ILiveboxAddRequestListener interface.
+ *
+ * This header file contains the declarations of the %ILiveboxAddRequestListener interface.
+ */
+
+#ifndef _FSHELL_ILIVEBOX_ADD_REQUEST_LISTENER_H_
+#define _FSHELL_ILIVEBOX_ADD_REQUEST_LISTENER_H_
+
+#include <FBaseString.h>
+#include <FAppTypes.h>
+
+namespace Tizen { namespace Shell
+{
+
+/**
+ * @interface ILiveboxAddRequestListener
+ * @brief This interface defines a listener for a Livebox viewer(eg, Home screen, Lock screen) that receives request to add Livebox
+ *
+ * @since 2.1
+ *
+ * The %ILiveboxAddRequestListener interface defines a listener for a Livebox viewer(eg, Home screen, Lock screen) that receives request to add Livebox
+ */
+class _OSP_EXPORT_ ILiveboxAddRequestListener
+{
+public:
+ /**
+ * This polymorphic destructor should be overridden if required.
+ * This way, the destructors of the derived classes are called when the destructor of this interface is called.
+ *
+ * @since 2.1
+ */
+ virtual ~ILiveboxAddRequestListener() {}
+
+ /**
+ * Called when requested to add a Livebox @n
+ * The Livebox viewer application such as the Home screen can get callback request to add a Livebox by implementing this listener. @n
+ *
+ * @param[in] appId The application ID of the application providing Livebox
+ * @param[in] providerName The name of Livebox provider to be added
+ * @param[in] text Alternative text for the Livebox
+ * @param[in] userInfo User information for the Livebox provider
+ * @see LiveboxManager::AddLivebox()
+ */
+ virtual void OnLiveboxAddRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo) = 0;
+};
+
+}} // Tizen::Shell
+
+#endif /* _FSHELL_ILIVEBOX_ADD_REQUEST_LISTENER_H_ */
#define _FSHELL_ILIVEBOX_POPUP_PROVIDER_FACTORY_H_
#include <FBaseString.h>
-#include <FBaseColIList.h>
#include <FShellLiveboxPopupProvider.h>
namespace Tizen { namespace Shell
{
+class LiveboxPopupProvider;
+
/**
* @interface ILiveboxPopupProviderFactory
* @brief This interface defines the factory for the %LiveboxPopupProvider creation
#define _FSHELL_ILIVEBOX_PROVIDER_FACTORY_H_
#include <FBaseString.h>
-#include <FShellLiveboxProvider.h>
namespace Tizen { namespace Shell
{
+class LiveboxProvider;
+
/**
* @interface ILiveboxProviderFactory
* @brief This interface defines the factory for the %LiveboxProvider creation
*
* @since 2.1
*
- * @param[in] name The Livebox provider name
+ * @param[in] providerName The Livebox provider name
* @param[in] width The width of the Livebox
* @param[in] height The height of the Livebox
* @param[in] userInfo User information that specifed when the Livebox is added
*/
- virtual LiveboxProvider* CreateInstance(const Tizen::Base::String& name, int width, int height, const Tizen::Base::String& userInfo) = 0;
+ virtual LiveboxProvider* CreateInstance(const Tizen::Base::String& providerName, int width, int height, const Tizen::Base::String& userInfo) = 0;
protected:
//
+++ /dev/null
-//
-// Open Service Platform
-// Copyright (c) 2012 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.
-//
-
-/**
- * @file FShell.h
- * @brief This is the header file for the %Shell namespace.
- *
- * This header file contains the declarations of the %Shell namespace.
- */
-
-#ifndef _FSHELL_LIVEBOX_H_
-#define _FSHELL_LIVEBOX_H_
-
-#include <FShellLiveboxManager.h>
-#include <FShellLiveboxProvider.h>
-#include <FShellLiveboxPopupProvider.h>
-#include <FShellILiveboxProviderFactory.h>
-#include <FShellILiveboxPopupProviderFactory.h>
-#include <FShellLiveboxFrame.h>
-#include <FShellLiveboxPopup.h>
-#include <FShellLiveboxView.h>
-
-namespace Tizen { namespace Shell
-{
-
-} } // Tizen::Shell
-
-#endif // _FSHELL_LIVEBOX_H_
*
* @since 2.1
* @return An error code
- * @param[in] layout The layout for both the portrait and landscape mode
+ * @param[in] layout The layout for both the portrait and landscape mode
* @param[in] size The new width and height
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
#ifndef _FSHELL_LIVEBOX_MANAGER_H_
#define _FSHELL_LIVEBOX_MANAGER_H_
+#include <unique_ptr.h>
#include <FBaseString.h>
#include <FAppTypes.h>
-#include <FGrpDimension.h>
-#include <FShellLiveboxProviderInfo.h>
-#include <FShellILiveboxProviderFactory.h>
-#include <FShellILiveboxPopupProviderFactory.h>
+#include <FShellIILiveboxAddRequestListener.h>
namespace Tizen { namespace Base { namespace Collection { class IList; } } }
namespace Tizen { namespace Shell
{
-/**
- * @interface ILiveboxRequestEventListener
- * @brief This interface defines a listener for a Livebox viewer(eg, Home screen, Lock screen) that receives request to add Livebox
- *
- * @since 2.1
- *
- * The %ILiveboxRequestEventListener interface defines a listener for a Livebox viewer(eg, Home screen, Lock screen) that receives request to add Livebox
- */
-class _OSP_EXPORT_ ILiveboxRequestEventListener
-{
-public:
- /**
- * This polymorphic destructor should be overridden if required.
- * This way, the destructors of the derived classes are called when the destructor of this interface is called.
- *
- * @since 2.1
- */
- virtual ~ILiveboxRequestEventListener() {}
-
- /**
- * Called when requested to add a Livebox @n
- * The client can get callback request to add a Livebox by implementing this listener. @n
- *
- * @param[in] appId The application ID of the application providing Livebox
- * @param[in] providerName The name of Livebox provider to be added
- * @param[in] userInfo User information for the Livebox provider
- * @param[in] text Alternative text for the Livebox
- * @see LiveboxManager::AddLivebox()
- */
- virtual void OnLiveboxAddRequested(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& userInfo, const Tizen::Base::String& text) = 0;
-};
-
+class LiveboxProviderInfo;
/**
* @class LiveboxManager
- * @brief Manages all the Livebox providers.
+ * @brief Manages static information of all the Liveboxes and provides APIs for Livebox viewer(Such as the Home screen).
*
* @since 2.1
*
* @final This class is not intended for extension.
*
- * The %LiveboxManager class manages all the Livebox providers.
- * The livebox manager manages static and run time Livebox information.
+ * The %LiveboxManager class manages static information of all the Liveboxes and deliveries request to add Livebox.
*/
class _OSP_EXPORT_ LiveboxManager
: public Tizen::Base::Object
* else @c null if an error occurs
*
* @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
- Tizen::Base::Collection::IList* GetLiveboxProviderInfosN();
+ Tizen::Base::Collection::IList* GetLiveboxProviderInfoListN();
/**
* Gets a list of installed LiveboxProviderInfo
* @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.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
LiveboxProviderInfo* GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
/**
- * Request Livebox service to trigger specified Livebox update
- *
- * @since 2.1
- *
- * @param[in] appId The appId that provides Livebox
- * @param[in] providerName The name of the Livebox provider
- *
- * @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.
- * @exception E_INVALID_OPERATION The application isn't permitted to request to update Livebox of other application package.@n
- * To get permission, current application package should have same signature with the other.
- * @exception E_SYSTEM A system error has occurred.
- */
- result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument = L"");
-
-
- /**
- * Request add Livebox to a Livebox viewer(eg, Home screen, Lock screen)
- *
- * @since 2.1
- * @privlevel user
- * @privilege http://tizen.org/privilege/liveboxmanager.install
- *
- * @param[in] targetAppId The ID of the application that the specified Livebox will be added to
- * @param[in] providerAppId The ID of the application providing Livebox
- * @param[in] providerName The name of Livebox provider to be added
- * @param[in] text Text to represent the Livebox
- * @param[in] userInfo User information for the Livebox provider
- *
- * @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.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @exception E_INVALID_OPERATION The application isn't permitted to request add Livebox of other application package.
- * @exception E_UNSUPPORTED_OPERATION The specifed Livebox provider doesn't support this operation.
- * @exception E_SYSTEM A system error has occurred.
- *
- * @remark Only Livebox provider that is packaged with the caller application can be added by this API.
- * @see SetLiveboxRequestEventHandler
- */
- result AddLivebox(const Tizen::App::AppId& targetAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo);
-
- /**
- * Sets a Livebox request event listener. @n
- * The listener gets notified when requested to add Livebox
+ * Sets a Livebox request listener. @n
+ * The listener gets notified when the request is recieved. @n
+ * To unset the listener, pass a @c null value to the pListener parameter.
*
* @since 2.1
*
* @return An error code
- * @param[in] listener The listener to receive the Livebox request event
- * @exception E_SUCCESS The method is successful.
- * @exception E_OBJ_ALREADY_EXIST The listener is already set.
- * @exception E_SYSTEM A system error has occurred.
- *
- * @see ILiveboxRequestEventListener
- *
- */
- result SetLiveboxRequestEventHandler(ILiveboxRequestEventListener& listener);
-
- /**
- * Sets a LiveboxProvider factory. @n
- * The factory is called when LiveboxProvider is need to be created.
- * This function should be called in App::OnAppInitializing(), to receive event correctly.
- * Implementing LiveboxProviderFactory is mandatory to provide Livebox functionality.
+ * @param[in] pListener The pointer to the listener to receive request to add Livebox
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
*
- * @since 2.1
- *
- * @return An error code
- * @param[in] factory The factory to create concrete LiveboxProvider
- * @exception E_SUCCESS The method is successful.
- * @exception E_OBJ_ALREADY_EXIST The listener is already set.
- * @exception E_SYSTEM A system error has occurred.
- * @see ILiveboxProviderFactory
+ * @see ILiveboxAddRequestListener
+ * @remark Platform does not have the ownership of this pointer, So caller should manage the listener object properly.
*/
- result SetLiveboxProviderFactory(ILiveboxProviderFactory& factory);
-
- /**
- * Sets a LiveboxPopupProvider factory. @n
- * The factory is called when LiveboxPopupProvider is need to be created.
- * This function should be called in App::OnAppInitializing(), to receive event correctly.
- * Implementing LiveboxPopupProviderFactory is mandatory to provide LiveboxPopup functionality.
- *
- * @since 2.1
- *
- * @return An error code
- * @param[in] factory The factory to create concrete LiveboxPopupProvider
- * @exception E_SUCCESS The method is successful.
- * @exception E_OBJ_ALREADY_EXIST The listener is already set.
- * @exception E_SYSTEM A system error has occurred.
- * @see ILiveboxPopupProviderFactory
- */
- result SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory);
-
+ result SetLiveboxAddRequestListener(ILiveboxAddRequestListener* pListener);
private:
- /**
- * This default constructor is intentionally declared as private to implement the %Singleton semantic.
- *
- * @since 2.1
- */
+ //
+ // This default constructor is intentionally declared as private to implement the %Singleton semantic.
+ //
+ // @since 2.1
+ //
LiveboxManager();
- /**
- * This destructor is intentionally declared as private to implement the %Singleton semantic.
- *
- * @since 2.1
- */
+ //
+ // This destructor is intentionally declared as private to implement the %Singleton semantic.
+ //
+ // @since 2.1
+ //
virtual ~LiveboxManager();
- /**
- * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
- *
- * @since 2.1
- */
+ //
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
LiveboxManager& operator =(const LiveboxManager& rhs);
- /**
- * Constructs the instance of this class.
- *
- * @since 2.1
- *
- * @return An error code
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM A system error has occurred.
- */
+ //
+ // Constructs the instance of this class.
+ //
+ // @since 2.1
+ //
+ // @return An error code
+ // @exception E_SUCCESS The method is successful.
+ // @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ //
result Construct();
-public:
- ILiveboxRequestEventListener* __pLiveboxRequestEventListener;//TODO: to impl
-
private:
class _LiveboxManagerImpl* __pLiveboxManagerImpl;
+ friend struct std::default_delete< LiveboxManager >;
};
}} // Tizen::Shell
#define _FSHELL_LIVEBOX_POPUP_PROVIDER_H_
#include <FBaseObject.h>
-#include <FBaseColIList.h>
namespace Tizen { namespace Shell
{
* The %LiveboxPopupProvider class is a base class which represents a Livebox popup provider
*/
class _OSP_EXPORT_ LiveboxPopupProvider
-: public Tizen::Base::Object
+ : public Tizen::Base::Object
{
-public:
+protected:
/**
* This is the default constructor for this class.
*
*/
virtual ~LiveboxPopupProvider();
-protected:
/**
* Called when the Livebox popup provider is required to be created @n
*
*
* @since 2.1
*/
- virtual void OnLiveboxPopupProviderTerminating() = 0;
+ virtual void OnLiveboxPopupProviderTerminating(void) = 0;
/**
* Sets the Livebox popup to the Livebox
* @return An error code
* @param[in] pLiveboxPopup The pointer to LiveboxPopup instance to be set to the Livebox
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_OPERATION The LiveboxFrame to be set is not constructed.
- * @exception E_OBJ_ALREADY_EXIST The LiveboxFrame to be set is already registered with the LiveboxPopupProvider.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_INVALID_ARG The pointer to the LiveboxFrame is null, or not constructed yet.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ *
+ * @remark This function should be called only in OnLiveboxPopupProviderInitializing.
+ * @remark LiveboxPopup instance ownership is transferred to platform. After LiveboxPopupProvider::OnLiveboxPopupProviderTerminating() is called, LiveboxPopup instance is removed automatically. LiveboxPopup instance reuse is not allowed.
*/
result SetLiveboxPopup(Tizen::Shell::LiveboxPopup* pLiveboxPopup);
* @since 2.1
*
* @return The LiveboxPopup instnace, or null if any LiveboxPopup is set yet.
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified input parameter is invalid.
- * @exception E_OBJ_ALREADY_EXIST The frame to be added is already registered with the UI application.
- * @exception E_SYSTEM A system error has occurred.
*/
- Tizen::Shell::LiveboxPopup* GetLiveboxPopup() const;
+ Tizen::Shell::LiveboxPopup* GetLiveboxPopup();
-private:
/**
- * Initializes this instance of %LiveboxPopupProvider
- *
- * @since 2.1
- */
- result Construct(const Tizen::Base::String& instanceId);
-
- /*
- * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ * Get the Livebox popup from the Livebox
*
* @since 2.1
- */
- LiveboxPopupProvider(const LiveboxPopupProvider& rhs);
-
- /*
- * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
*
- * @since 2.1
+ * @return The LiveboxPopup instnace, or null if any LiveboxPopup is set yet.
*/
- LiveboxPopupProvider& operator =(const LiveboxPopupProvider& rhs);
+ const Tizen::Shell::LiveboxPopup* GetLiveboxPopup() const;
protected:
//
virtual void LiveboxPopupProvider_Reserved3(void) {}
private:
+ //
+ // Initializes this instance of %LiveboxPopupProvider
+ //
+ // @since 2.1
+ //
+ result Construct(const Tizen::Base::String& instanceId);
+
+ //
+ // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ LiveboxPopupProvider(const LiveboxPopupProvider& rhs);
+
+ //
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ LiveboxPopupProvider& operator =(const LiveboxPopupProvider& rhs);
+
+private:
class _LiveboxPopupProviderImpl* __pLiveboxPopupProviderImpl;
- friend class _LiveboxManagerImpl;
-};
-} /* namespace Livebox */
-} /* namespace Samsung */
+ friend class _LiveboxProviderManagerImpl;
+
+}; // LiveboxPopupProvider
+
+}} // Tizen::Shell
+
#endif /* _FSHELL_LIVEBOX_POPUP_PROVIDER_H_ */
#define _FSHELL_LIVEBOX_PROVIDER_H_
#include <FBaseObject.h>
-#include <FBaseColIList.h>
namespace Tizen { namespace Shell
{
/**
* Called when the Livebox provider is required to be destroyed @n
- * The client can destroy it's own LiveboxProvider by implementing this pure virtual function
*
* @since 2.1
+ */
+ virtual void OnLiveboxProviderTerminating(void) = 0;
+
+ /**
+ * Called when the correspondent Livebox is removed from Livebox viewer application. (Home or Lock screen, etc)@n
+ * If you stored Livebox provider state to persistent storage such as registry or DB, you can destroy by implementing this pure virtual function.@n
+ *
*
- * @param[in] isLiveboxRemoved If true, correspondent Livebox is removed from Livebox viewer application. (Home or Lock screen, etc)
+ * @since 2.1
+ *
+ * @remark This function is called after OnLiveboxProviderTerminating called.
*/
- virtual void OnLiveboxProviderTerminating(bool isLiveboxRemoved) = 0;
+ virtual void OnLiveboxProviderRemoved(void) = 0;
/**
* Called when the Livebox is required to be updated @n
- * The client can update it's own LiveboxProvider by implementing this pure virtual function
+ * Your Livebox provider can be updated by implementing this pure virtual function.
*
* @since 2.1
*
- * @param[in] argument The argument for updating the Livebox.
- *
- * @Remark This function is called when UpdatePeriod timer is expired or LiveboxManager::RequestUpdate() is called.@n
- * The argument is passsed by LiveboxManager::RequestUpdate() API.
+ * @param[in] userInfo User information to update the Livebox provider@n
+ * This parameter is delivered from LiveboxProvider::RequestUpdate()
+ *
+ * @Remark This function is called when UpdatePeriod timer is expired or LiveboxManager::RequestUpdate() is called.@n
*/
- virtual void OnLiveboxProviderUpdating(const Tizen::Base::String& argument) = 0;
+ virtual void OnLiveboxProviderUpdating(const Tizen::Base::String& userInfo) = 0;
/**
* Sets the LiveboxFrame to the LiveboxProvider
* @return An error code
* @param[in] pLiveboxFrame The LiveboxFrame to be set to the LiveboxProvider
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_OPERATION The LiveboxFrame to be set is not constructed.
- * @exception E_OBJ_ALREADY_EXIST The LiveboxFrame to be set is already registered with the LiveboxProvider.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_INVALID_ARG The pointer to the LiveboxFrame is null, or not constructed yet.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
*
- * @remark This function should be called only in OnLiveboxProviderInitializing
+ * @remark This function should be called only in OnLiveboxProviderInitializing.
+ * @remark LiveboxFrame instance ownership is transferred to platform. After LiveboxProvider::OnLiveboxProviderTerminating() is called, LiveboxPopup instance is removed automatically. LiveboxFrame instance reuse is not allowed.
*/
result SetLiveboxFrame(LiveboxFrame* pLiveboxFrame);
* @since 2.1
*
* @return the LiveboxFrame instnace, or null if any LiveboxFrame isn't set yet.
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified input parameter is invalid.
- * @exception E_OBJ_ALREADY_EXIST The LiveboxFrame to be added is already registered with the UI application.
- * @exception E_SYSTEM A system error has occurred.
*/
- LiveboxFrame* GetLiveboxFrame() const;
-
+ LiveboxFrame* GetLiveboxFrame();
/**
- * Gets the correspondent LiveboxProvider instance for the current LiveboxPopupProvider
- *
- * @since 2.1
- *
- * @return the LiveboxProvider instnace, or null if any exception occured.
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM A system error has occurred.
- */
- LiveboxProvider* GetLiveboxProviderInstance();
-
-private:
-
- /**
- * Initializes this instance of %LiveboxProvider
- *
- * @since 2.1
- */
- result Construct(const Tizen::Base::String& instanceId);
-
- /*
- * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ * Get the LiveboxFrame from the LiveboxProvider
*
* @since 2.1
- */
- LiveboxProvider(const LiveboxProvider& rhs);
-
- /*
- * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
*
- * @since 2.1
+ * @return the LiveboxFrame instnace, or null if any LiveboxFrame isn't set yet.
*/
- LiveboxProvider& operator =(const LiveboxProvider& rhs);
+ const LiveboxFrame* GetLiveboxFrame() const;
protected:
//
//
virtual void LiveboxProvider_Reserved5(void) {}
+private:
+
+ //
+ // Initializes this instance of %LiveboxProvider
+ //
+ // @since 2.1
+ //
+ result Construct(const Tizen::Base::String& instanceId);
+
+ //
+ // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ LiveboxProvider(const LiveboxProvider& rhs);
+
+ //
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ LiveboxProvider& operator =(const LiveboxProvider& rhs);
+
private:
class _LiveboxProviderImpl* __pLiveboxProviderImpl;
- friend class _LiveboxManagerImpl;
+ friend class _LiveboxProviderManagerImpl;
};
}} // Tizen::Shell
#define _FSHELL_LIVEBOX_PROVIDER_INFO_H_
#include <FBaseString.h>
-#include <FBaseCol.h>
-#include <FGrpDimension.h>
#include <FAppTypes.h>
+namespace Tizen { namespace Base { namespace Collection { class IList; } } }
+
namespace Tizen { namespace Shell
{
: public Tizen::Base::Object
{
public:
-
- /**
- * This is the constructor that initializes an instance of %LiveboxProviderInfo with the specified values.
- *
- * @since 2.1
- *
- * @param[in] appId The Id of the application that provides Livebox
- * @param[in] providerName The name of the Livebox provider
- */
- LiveboxProviderInfo(const Tizen::App::AppId& appId, const Tizen::Base::String& name);
-
- /**
- * This is the constructor that initializes an instance of %LiveboxProviderInfo with the specified values.
- *
- * @since 2.1
- */
- LiveboxProviderInfo(const Tizen::Base::String& providerId);
-
/**
- * This is the copy constructor for the %LiveboxProviderInfo class.
+ * Copying of objects using this copy constructor is allowed.
*
* @since 2.1
*
* {
* AppControl* pAc = AppManager::FindAppControl(pProviderInfo->GetConfigurationAppControlAppId(), L"http://tizen.org/appcontrol/operation/livebox/configuration");
- * HashMap map(SingleObjectDeleter);
- * map.Constrcuct();
- * map.Add(L"ProviderName", pProviderInfo->GetProviderName());
+ * HashMap map(SingleObjectDeletor);
+ * map.Construct();
+ * String key = L"ProviderName";
+ * String value = pProviderInfo->GetName();
+ * map.Add(&key, &value );
* pAc.Start(null, null, &map, null);
* }
* @return A pointer to the array list that contains all LiveboxSizeInfo of the LiveboxProvider@n
* else @c null if an error occurs
* @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM A system error has occurred.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
- Tizen::Base::Collection::IList* GetSizeInfosN() const;
+ Tizen::Base::Collection::IList* GetSizeInfoListN() const;
private:
- /**
- * This is the default constructor for this class.
- *
- * @since 2.1
- */
+
+ //
+ // This is the constructor that initializes an instance of %LiveboxProviderInfo with the specified values.
+ // This constructor is intentionally declared as private so that only the platform can create an instance.
+ //
+ // @since 2.1
+ //
+ // @param[in] appId The Id of the application that provides Livebox
+ // @param[in] name The name of the Livebox provider
+ //
+ LiveboxProviderInfo(const Tizen::App::AppId& appId, const Tizen::Base::String& name);
+
+ //
+ // This default constructor is intentionally declared as private so that only the platform can create an instance.
+ //
+ // @since 2.1
+ //
LiveboxProviderInfo();
- /**
- * Assigns the value of the specified instance of %LiveboxProviderInfo to the current instance of %LiveboxProviderInfo.
- *
- * @since 2.1
- *
- * @param[in] rhs An instance of %LiveboxProviderInfo
- */
+ //
+ // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ //
LiveboxProviderInfo& operator =(const LiveboxProviderInfo& rhs);
private:
class _LiveboxProviderInfoImpl* __pLiveboxProviderInfoImpl;
friend class _LiveboxProviderInfoImpl;
-
};
}} // Tizen::Shell
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 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.
+//
+
+/**
+ * @file FShellLiveboxProviderManager.h
+ * @brief This is the header file for the %LiveboxManager class.
+ *
+ * This header file contains the declarations of the %LiveboxProviderManager class.
+ */
+
+#ifndef _FSHELL_LIVEBOX_PROVIDER_MANAGER_H_
+#define _FSHELL_LIVEBOX_PROVIDER_MANAGER_H_
+
+#include <unique_ptr.h>
+#include <FBaseString.h>
+#include <FAppTypes.h>
+#include <FShellILiveboxProviderFactory.h>
+#include <FShellILiveboxPopupProviderFactory.h>
+
+namespace Tizen { namespace Base { namespace Collection { class IList; } } }
+namespace Tizen { namespace Shell
+{
+
+/**
+ * @class LiveboxProviderManager
+ * @brief Manages all the Livebox providers.
+ *
+ * @since 2.1
+ *
+ * @final This class is not intended for extension.
+ *
+ * The %LiveboxManager class manages all the Livebox providers.
+ * The livebox manager manages static and run time Livebox information.
+ */
+class _OSP_EXPORT_ LiveboxProviderManager
+ : public Tizen::Base::Object
+{
+public:
+
+ /**
+ * Gets the Livebox manager instance.
+ *
+ * @since 2.1
+ *
+ * @return A pointer to the %LiveboxManager instance, @n
+ * else @c null if it fails
+ */
+ static LiveboxProviderManager* GetInstance();
+
+ /**
+ * Request Livebox service to trigger specified Livebox update
+ *
+ * @since 2.1
+ *
+ * @param[in] appId The appId that provides Livebox
+ * @param[in] providerName The name of the Livebox provider
+ * @param[in] userInfo User information for the Livebox provider@n
+ * This parameter will be delivered as parameter of LiveboxProvider::OnLiveboxProviderUpdating()
+ *
+ * @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.
+ * @exception E_CERTIFICATE_VERIFICATION_FAILED The application isn't permitted to request to update Livebox of other application package.@n
+ * To get permission, the target application is signed with the same certificate.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ *
+ * @see LiveboxProvider::OnLiveboxProviderUpdating()
+ */
+ result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& userInfo = L"");
+
+ /**
+ * Request a Livebox viewer(eg, Home screen, Lock screen) to add the specified Livebox.
+ *
+ * @since 2.1
+ * @privlevel user
+ * @privilege http://tizen.org/privilege/liveboxmanager
+ *
+ * @param[in] viewerAppId The ID of the viewer application that the specified Livebox will be added to
+ * @param[in] providerAppId The ID of the application providing Livebox
+ * @param[in] providerName The name of Livebox provider to be added
+ * @param[in] text Text to represent the Livebox
+ * @param[in] userInfo User information for the Livebox provider
+ *
+ * @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.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_CERTIFICATE_VERIFICATION_FAILED The application isn't permitted to request add Livebox of other application package.
+ * To get permission, the target application is signed with the same certificate.
+ * @exception E_UNSUPPORTED_OPERATION The specifed Livebox provider doesn't support this operation.@
+ * To request a Livebox viewer to add a Livebox, Livebox provider should support 1x1 size Livebox, but the specified Livebox provider doesn't support 1x1 size.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ *
+ * @remark Only Livebox provider that is packaged with the caller application can be added by this API.
+ * @see SetLiveboxAddRequestListener
+ */
+ result AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo);
+
+ /**
+ * Sets a LiveboxProvider factory. @n
+ * The factory is called when LiveboxProvider is need to be created.
+ * This function should be called in App::OnAppInitializing(), to receive event correctly.
+ * Implementing LiveboxProviderFactory is mandatory to provide Livebox functionality.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] factory The factory to create concrete LiveboxProvider
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ * @see ILiveboxProviderFactory
+ */
+ result SetLiveboxProviderFactory(ILiveboxProviderFactory& factory);
+
+ /**
+ * Sets a LiveboxPopupProvider factory. @n
+ * The factory is called when LiveboxPopupProvider is need to be created.
+ * This function should be called in App::OnAppInitializing(), to receive event correctly.
+ * Implementing LiveboxPopupProviderFactory is mandatory to provide LiveboxPopup functionality.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] factory The factory to create concrete LiveboxPopupProvider
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ * @see ILiveboxPopupProviderFactory
+ */
+ result SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory);
+
+
+private:
+ //
+ // This default constructor is intentionally declared as private to implement the %Singleton semantic.
+ //
+ // @since 2.1
+ //
+ LiveboxProviderManager();
+
+ //
+ // This destructor is intentionally declared as private to implement the %Singleton semantic.
+ //
+ // @since 2.1
+ //
+ virtual ~LiveboxProviderManager();
+
+ /**
+ * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ *
+ * @since 2.1
+ */
+ LiveboxProviderManager& operator =(const LiveboxProviderManager& rhs);
+
+ //
+ // Constructs the instance of this class.
+ //
+ // @since 2.1
+ //
+ // @return An error code
+ // @exception E_SUCCESS The method is successful.
+ // @exception E_SYSTEM A system error has occurred.
+ //
+ result Construct();
+
+private:
+ class _LiveboxProviderManagerImpl* __pLiveboxProviderManagerImpl;
+ friend struct std::default_delete< LiveboxProviderManager >;
+
+}; // LiveboxProviderManager
+
+}} // Tizen::Shell
+
+#endif /* _FSHELL_LIVEBOX_PROVIDER_MANAGER_H_ */
#define _FSHELL_LIVEBOX_SIZE_INFO_H_
#include <FBaseString.h>
-#include <FBaseCol.h>
-#include <FGrpDimension.h>
#include <FAppTypes.h>
+#include <FGrpDimension.h>
namespace Tizen { namespace Shell
{
virtual ~LiveboxSizeInfo();
/**
- * This is the copy constructor for the %LiveboxSizeInfo class.
+ * Copying of objects using this copy constructor is allowed.
*
* @since 2.1
*
LiveboxSizeInfo(const LiveboxSizeInfo& rhs);
/**
- * Assigns the value of the specified instance of %LiveboxSizeInfo to the current instance of %LiveboxSizeInfo.
- *
- * @since 2.1
- *
- * @param[in] rhs An instance of %LiveboxSizeInfo
- */
- LiveboxSizeInfo& operator =(const LiveboxSizeInfo& rhs);
-
- /**
* Gets the size
*
* @since 2.1
Tizen::Base::String GetPreviewImagePath() const;
private:
- /**
- * This is the default constructor for this class.
- *
- * @since 2.1
- */
- LiveboxSizeInfo();
-
- /**
- * This is the constructor that initializes an instance of %LiveboxSizeInfo with the specified values.
- *
- * @since 2.1
- */
+ //
+ // This is the constructor that initializes an instance of %LiveboxSizeInfo with the specified values.
+ // This constructor is intentionally declared as private so that only the platform can create an instance.
+ //
+ // @since 2.1
+ //
+ // @param[in] size One of the size that the Livebox provider supports.
+ // @param[in] previewImagePath The preview image path for the size.
+ //
LiveboxSizeInfo(Tizen::Graphics::Dimension size, const Tizen::Base::String& previewImagePath);
+ //
+ // This default constructor is intentionally declared as private so that only the platform can create an instance.
+ //
+ // @since 2.1
+ //
+ LiveboxSizeInfo();
+
+ //
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @since 2.1
+ //
+ LiveboxSizeInfo& operator =(const LiveboxSizeInfo& rhs);
+
private:
_LiveboxSizeInfoImpl* __pLiveboxSizeInfoImpl;
Version: 1.2.1.0
Release: 1
Group: TO_BE/FILLED_IN
-License: TO BE FILLED IN
+License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: pkgconfig(capi-appfw-application)
FShell_LiveboxProviderInfoImpl.cpp
FShell_LiveboxSizeInfoImpl.cpp
FShell_LiveboxManagerImpl.cpp
+ FShell_LiveboxProviderManagerImpl.cpp
FShell_LiveboxManagerProxy.cpp
FShellLiveboxProvider.cpp
FShellLiveboxPopupProvider.cpp
FShellLiveboxProviderInfo.cpp
FShellLiveboxSizeInfo.cpp
FShellLiveboxManager.cpp
+ FShellLiveboxProviderManager.cpp
FShell_LiveboxManagerIpcMessage.cpp
FShell_LiveboxFrame.cpp
FShell_LiveboxFrameImpl.cpp
#include <FAppPkgPackageInfo.h>
#include <FApp_Types.h>
#include <FApp_AppInfo.h>
-#include <FAppPkg_PackageManagerImpl.h>
-#include <FBase_StringConverter.h>
+
#include <FShellLiveboxManager.h>
#include <FShellLiveboxProviderInfo.h>
return E_SUCCESS;
}
-result
-LiveboxManager::SetLiveboxProviderFactory(ILiveboxProviderFactory& factory)
-{
- return __pLiveboxManagerImpl->SetLiveboxProviderFactory(factory);
-}
-
-result
-LiveboxManager::SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory)
-{
- return __pLiveboxManagerImpl->SetLiveboxPopupProviderFactory(factory);
-}
-
-//result
-//LiveboxManager::HandleRequest(const Tizen::Base::String& operationId, Tizen::Base::String* pCategory, Tizen::Base::Collection::IList* pArgs)
-//{
-// return __pLiveboxManagerImpl->HandleRequest(operationId, pCategory, pArgs);
-//}
-
Tizen::Base::Collection::IList*
-LiveboxManager::GetLiveboxProviderInfosN()
+LiveboxManager::GetLiveboxProviderInfoListN()
{
- return __pLiveboxManagerImpl->GetLiveboxProviderInfosN();
+ return __pLiveboxManagerImpl->GetLiveboxProviderInfoListN();
}
LiveboxProviderInfo*
LiveboxManager::GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
{
// TODO : set configurationAppcontrolAppId
- return new LiveboxProviderInfo(appId, providerName);
+ return __pLiveboxManagerImpl->GetLiveboxProviderInfoN(appId, providerName);
}
-
-/*
result
-LiveboxManager::RequestUpdate()
+LiveboxManager::SetLiveboxAddRequestListener(ILiveboxAddRequestListener* pListener)
{
- Tizen::App::AppId appId(Tizen::App::_AppInfo::GetAppId());
-
- std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(appId));
- int ret = livebox_service_trigger_update(pPackageId.get(), "user,created", "default");
- SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "[E_SYSTEM] Failed to invoke livebox_service_trigger_update, ret (%d)", ret);
-
- return E_SUCCESS;
-}
-*/
-
-result
-LiveboxManager::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
-{
- __pLiveboxManagerImpl->RequestUpdate(appId, providerName);
-
- return E_SUCCESS;
-}
-
-//void
-//LiveboxManager::TerminateAppIfInvalidState()
-//{
-// __pLiveboxManagerImpl->TerminateAppIfInvalidState();
-//}
-
-
-namespace
-{
-int AddLiveboxCallback(int ret, int pid, void *data)
-{
- if( ret != 0)
- {
- SysLog(NID_APP, "Error.(%d)", ret);
- }
-
- return 0;
-}
-}
-
-
-result
-LiveboxManager::AddLivebox(const Tizen::App::AppId& targetAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
-{
- SysTryReturnResult(NID_APP, providerAppId.IsEmpty()==false, E_INVALID_ARG, "The providerAppId is empty.");
- SysTryReturnResult(NID_APP, providerAppId.GetLength() < NATIVE_APP_MAX_APPID_LENGTH, E_INVALID_ARG, "The providerAppId is too long (Maximum %d bytes).", NATIVE_APP_MAX_APPID_LENGTH);
- SysTryReturnResult(NID_APP, _PackageManagerImpl::IsAppInstalled(providerAppId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", providerAppId.GetPointer());
-
- //TODO :: check privilege
- String providerId;
- if( providerAppId.StartsWith(L"com.samsung", 0) == true )
- {
- SysLog(NID_APP, "[E_INVALID_OPERATION] but allowed to test");
- //TODO:return E_INVALID_OPERATION
- providerId = providerAppId;
- }
- else
- {
- String localPackageId = _PackageManagerImpl::GetPackageIdByAppId(Tizen::App::App::GetInstance()->GetAppId());
- String liveboxProviderPackageId = _PackageManagerImpl::GetPackageIdByAppId(providerAppId);
- if( localPackageId != liveboxProviderPackageId)
- {
- SysLog(NID_APP, "[E_INVALID_OPERATION] but allowed to test");
- //TODO:return E_INVALID_OPERATION
- }
- providerId = providerAppId + "." + providerName;
- }
-
- PackageInfo* pPackageInfo = null;
- result r = E_SUCCESS;
-
- pPackageInfo = _PackageManagerImpl::GetInstance()->GetPackageInfoN(providerAppId);
- SysTryReturn(NID_APP, pPackageInfo != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- String iconPath; //= packageInfo.GetAppIconPath();
-
- delete pPackageInfo;
-
- std::unique_ptr<char[]> pProviderId(_StringConverter::CopyToCharArrayN(providerId));
- std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(text));
- std::unique_ptr<char[]> pContent(_StringConverter::CopyToCharArrayN(userInfo));
- std::unique_ptr<char[]> pIcon(_StringConverter::CopyToCharArrayN(iconPath));
-
- int ret = add_to_home_livebox(pProviderId.get(), pName.get(), LAUNCH_BY_PACKAGE, pContent.get(), pIcon.get(), -1.0l, AddLiveboxCallback, this);
- SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "[E_SYSTEM] failed to add_to_home_livebox (%d)", ret);
-
- return E_SUCCESS;
-}
-
-// c style callback for shortcut_set_request_cb
-int LiveboxRequestEventHandler(const char* providerId, const char* text, int type, const char* content_info, const char* icon, int pid, double period, void *data)
-{
- SysTryReturn(NID_APP, providerId, 0, E_SYSTEM, "[E_SYSTEM] providerId is null!");
-
- LiveboxManager* pLiveboxManager = static_cast<LiveboxManager*>(data);
- SysTryReturn(NID_APP, pLiveboxManager, 0, E_SYSTEM, "[E_SYSTEM] pLiveboxManager is null!");
-
- String appId;
- String providerName;
- _LiveboxManagerImpl::ExtractAppIdAndProviderName(providerId, appId, providerName);
-
- //OnLiveboxAddRequested(const Tizen::Base::AppId& appId, const const Tizen::Base::String& providerName, const Tizen::Base::String& userInfo, const const Tizen::Base::String& text, const Tizen::Base::String& iconPath)
- pLiveboxManager->__pLiveboxRequestEventListener->OnLiveboxAddRequested(appId, providerName, content_info, text );
-
- return 0;
-}
-
-result
-LiveboxManager::SetLiveboxRequestEventHandler(ILiveboxRequestEventListener& listener)
-{
- int ret = shortcut_set_request_cb(LiveboxRequestEventHandler, this );
- SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "failed to shortcut_set_request_cb (%d)", ret);
-
- __pLiveboxRequestEventListener = &listener;
- return E_SUCCESS;
+ return __pLiveboxManagerImpl->SetLiveboxAddRequestListener(pListener);
}
}
LiveboxPopup*
-LiveboxPopupProvider::GetLiveboxPopup() const
+LiveboxPopupProvider::GetLiveboxPopup()
{
return __pLiveboxPopupProviderImpl->GetLiveboxPopup();
}
+const LiveboxPopup*
+LiveboxPopupProvider::GetLiveboxPopup() const
+{
+ return const_cast<const LiveboxPopup*>(__pLiveboxPopupProviderImpl->GetLiveboxPopup());
+}
+
}} // Tizen::Shell
}
LiveboxFrame*
-LiveboxProvider::GetLiveboxFrame() const
+LiveboxProvider::GetLiveboxFrame()
{
return __pLiveboxProviderImpl->GetLiveboxFrame();
}
+const LiveboxFrame*
+LiveboxProvider::GetLiveboxFrame() const
+{
+ return const_cast<const LiveboxFrame*>(__pLiveboxProviderImpl->GetLiveboxFrame());
+}
+
}} // Tizen::Shell
}
Tizen::Base::Collection::IList*
-LiveboxProviderInfo::GetSizeInfosN() const
+LiveboxProviderInfo::GetSizeInfoListN() const
{
SysAssert(__pLiveboxProviderInfoImpl);
- return __pLiveboxProviderInfoImpl->GetSizeInfosN();
+ return __pLiveboxProviderInfoImpl->GetSizeInfoListN();
}
}} // Tizen::Shell
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 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.
+//
+
+/**
+ * @file FShellLiveboxProviderManager.cpp
+ * @brief This is the implementation for the LiveboxProviderManager class.
+ */
+
+#include <unique_ptr.h>
+
+#include <shortcut.h>
+#include <livebox-service/livebox-service.h>
+
+#include <FBaseSysLog.h>
+#include <FBaseCol.h>
+#include <FGraphics.h>
+#include <FApp.h>
+#include <FAppPkgPackageInfo.h>
+#include <FApp_Types.h>
+#include <FApp_AppInfo.h>
+#include <FAppPkg_PackageManagerImpl.h>
+#include <FBase_StringConverter.h>
+
+#include <FShellLiveboxProviderManager.h>
+#include <FShellLiveboxProviderInfo.h>
+#include "FShell_LiveboxProviderManagerImpl.h"
+
+using namespace std;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+
+
+namespace Tizen { namespace Shell
+{
+
+LiveboxProviderManager::LiveboxProviderManager()
+ :__pLiveboxProviderManagerImpl(null)
+{
+
+}
+
+LiveboxProviderManager::~LiveboxProviderManager()
+{
+}
+
+LiveboxProviderManager*
+LiveboxProviderManager::GetInstance()
+{
+ static LiveboxProviderManager* pLiveboxManager = null;
+ if( pLiveboxManager == null)
+ {
+ pLiveboxManager = new LiveboxProviderManager;
+ SysTryReturn(NID_APP, pLiveboxManager, null, E_OUT_OF_MEMORY, "E_OUT_OF_MEMORY" );
+
+ result r = pLiveboxManager->Construct();
+// SysTryReturn(NID_APP, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysAssertf(!IsFailed(r), "Failed to construct LiveboxProviderManager!!");
+ SysLog(NID_APP, "LiveboxProviderManager instance is created.");
+ }
+
+ return pLiveboxManager;
+}
+
+result
+LiveboxProviderManager::Construct()
+{
+ SysAssert(__pLiveboxProviderManagerImpl == null);
+
+ SysLog(NID_APP, "Enter.");
+ __pLiveboxProviderManagerImpl = _LiveboxProviderManagerImpl::GetInstance();
+ SysAssertf(__pLiveboxProviderManagerImpl, "Failed to construct _LiveboxProviderManagerImpl!!");
+
+ SysLog(NID_APP, "Exit.");
+
+ return E_SUCCESS;
+}
+
+result
+LiveboxProviderManager::SetLiveboxProviderFactory(ILiveboxProviderFactory& factory)
+{
+ return __pLiveboxProviderManagerImpl->SetLiveboxProviderFactory(factory);
+}
+
+result
+LiveboxProviderManager::SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory)
+{
+ return __pLiveboxProviderManagerImpl->SetLiveboxPopupProviderFactory(factory);
+}
+
+result
+LiveboxProviderManager::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
+{
+ __pLiveboxProviderManagerImpl->RequestUpdate(appId, providerName);
+ return E_SUCCESS;
+}
+
+result
+LiveboxProviderManager::AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
+{
+ return __pLiveboxProviderManagerImpl->AddLivebox(viewerAppId, providerAppId, providerName, text, userInfo);
+}
+
+}} // Tizen::Shell
#include <FGrpRectangle.h>
#include "FUi_Window.h"
#include "FShell_LiveboxLayer.h"
-#include "FShell_LiveboxManagerImpl.h"
+#include "FShell_LiveboxProviderManagerImpl.h"
using namespace std;
using namespace Tizen::Base;
result
_LiveboxLayer::RegisterTouchEventListener(void)
{
- result r = _LiveboxManagerImpl::GetInstance()->SetLiveboxTouchEventListener(__providerId, *this);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->SetLiveboxTouchEventListener(__providerId, *this);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
Rectangle bounds = pWindow->GetBounds();
- result r = _LiveboxManagerImpl::GetInstance()->RequestSharedMemoryId(__providerId, bounds.width, bounds.height, pixmapId);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryId(__providerId, bounds.width, bounds.height, pixmapId);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
SysLog(NID_UI_CTRL, "pixmapId(%d) bounds(%d %d %d %d)", pixmapId, bounds.x, bounds.y, bounds.width, bounds.height);
{
SysTryReturn(NID_UI_CTRL, !__providerId.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- result r = _LiveboxManagerImpl::GetInstance()->RequestSyncSharedMemory(__providerId, bounds.width, bounds.height);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSyncSharedMemory(__providerId, bounds.width, bounds.height);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
{
SysTryReturnVoidResult(NID_UI_CTRL, !__providerId.IsEmpty(), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- _LiveboxManagerImpl::GetInstance()->RequestReleaseSharedMemory(__providerId);
+ _LiveboxProviderManagerImpl::GetInstance()->RequestReleaseSharedMemory(__providerId);
}
int
using namespace Tizen::App;
using namespace Tizen::Graphics;
-
-namespace
-{
-const char LIVEBOX_ON_ADD[] = "Livebox='event=add'";
-const char LIVEBOX_ON_REMOVE[] = "Livebox='event=remove'";
-const char LIVEBOX_ON_UPDATE[] = "Livebox='event=update'";
-const char LIVEBOX_ON_RESIZE[] = "Livebox='event=resize'";
-const char LIVEBOX_ON_TOUCH[] = "Livebox='event=touch'";
-const char LIVEBOX_TRAY_ON_CREATE[] = "LiveboxTray='event=create'";
-const char LIVEBOX_TRAY_ON_DESTROY[] = "LiveboxTray='event=destroy'";
-const char LIVEBOX_TRAY_ON_TOUCH[] = "LiveboxTray='event=touch'";
-}
-
_LiveboxManagerImpl::_LiveboxManagerImpl()
- :__pLiveboxFactory(null)
- ,__pLiveboxPopupProviderFactory(null)
- ,__pLiveboxPopupProvider(null)
- ,__LiveboxPopupTouchEventListener(null)
- ,__messageReceived(false)
+ :__pLiveboxRequestEventListener(null)
{
SysLog(NID_APP, "");
}
{
SysLog(NID_APP, "Enter.");
- __liveBoxes.Construct();
- __touchEventListeners.Construct();
-
int ret = livebox_service_init();
SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "[E_SYSTEM] Failed to invoke livebox_service_init, ret (%d)", ret);
- Tizen::App::_AppImpl::GetInstance()->SetAppControlProviderInternalEventListener(this);
-
SysLog(NID_APP, "Exit.");
return E_SUCCESS;
}
-result
-_LiveboxManagerImpl::SetLiveboxProviderFactory(ILiveboxProviderFactory& factory)
-{
- __pLiveboxFactory = &factory;
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory)
-{
- __pLiveboxPopupProviderFactory = &factory;
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::SetLiveboxTouchEventListener(const String& instanceId, _ILiveboxTouchEventListener& listener)
-{
- return __touchEventListeners.Add(instanceId, &listener);
-}
-
-result
-_LiveboxManagerImpl::SetLiveboxPopupEventListener(_ILiveboxTouchEventListener& listener)
-{
- __LiveboxPopupTouchEventListener = &listener;
-
- return E_SUCCESS;
-}
-
// c style callback for livebox_service_get_pkglist
int GetLiveboxProviderInfoCallback(const char *packageId, const char *pProviderId, int is_prime, void *data)
{
}
else
{
- /*int index = 0;
- providerId.IndexOf(".", 11, index);
- providerId.SubString(0, index, appId);
- providerId.SubString(index+1, name);*/
_LiveboxManagerImpl::ExtractAppIdAndProviderName(providerId, appId, name);
}
- LiveboxProviderInfo* pInfo = new LiveboxProviderInfo(appId, name);
+ LiveboxProviderInfo* pInfo = _LiveboxManagerImpl::GetInstance()->GetLiveboxProviderInfoN(appId, name);
+
pLiveboxProviderInfos->Add(*pInfo);
_LiveboxProviderInfoImpl::GetImpl(*pInfo)->__isDefault = is_prime;
return 0;
}
+// c - style callback for shortcut_get_list
int GetConfigurableLiveboxInfosCallback(const char* pConfigurationAppControlAppId, const char* pIcon, const char* pDisplayName, const char* pExtraKey, const char* pExtraData, void* data)
{
// SysLog(NID_APP, "pConfigurationAppControlAppId(%s), pDisplayName(%s)", pConfigurationAppControlAppId, pDisplayName);
}
Tizen::Base::Collection::IList*
-_LiveboxManagerImpl::GetLiveboxProviderInfosN()
+_LiveboxManagerImpl::GetLiveboxProviderInfoListN()
{
std::unique_ptr<ArrayList> pLiveboxProviders(new ArrayList());
SysTryReturn(NID_APP, pLiveboxProviders.get(), null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
LiveboxProviderInfo*
_LiveboxManagerImpl::GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
{
- return new LiveboxProviderInfo(appId, providerName);
+ return _LiveboxProviderInfoImpl::GetLiveboxProviderInfoN(appId, providerName);
}
-result
-_LiveboxManagerImpl::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
+// c - style callback for shortcut_set_request_cb
+int LiveboxRequestEventHandler(const char* providerId, const char* text, int type, const char* content_info, const char* icon, int pid, double period, void *data)
{
+ SysTryReturn(NID_APP, providerId, 0, E_SYSTEM, "[E_SYSTEM] providerId is null!");
- /*if( appId == App::App::GetInstance()->GetAppId()) //TODO: optimazing
- {
-
- }
- else*/
- {
- _LiveboxManagerProxy::GetInstance()->RequestUpdate(appId, providerName);
- }
- return E_SUCCESS;
-}
-
-bool
-_LiveboxManagerImpl::ContainsLivebox(const String& instanceId) const
-{
- bool isCreated = false;
- __liveBoxes.ContainsKey(instanceId, isCreated);
-
- return isCreated;
-}
-
-void
-_LiveboxManagerImpl::TerminateAppIfInvalidState()
-{
- if( __messageReceived == false )
- {
- Tizen::App::App::GetInstance()->Terminate();
- }
-}
-
-void
-_LiveboxManagerImpl::OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs)
-{
- if( pArgs == null && pArgs->GetCount() == 0)
- {
- SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
- return;
- }
- __messageReceived = true;
-
- SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
-
- String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
- SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
-
- String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
- SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
-
- String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
- SysTryReturnVoidResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pParam is null");
-
- SysLog(NID_APP, "id(%ls), name(%ls), param(%ls)", pInstanceId->GetPointer(), pName->GetPointer(), pParam->GetPointer());
-
- if(this->ContainsLivebox(*pInstanceId) == false)
- {
- SysLog(NID_APP, "no livebox instance, creating..");
-
- int width = 0;
- int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, width);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, height);
-
- this->CreateLivebox( *pName, *pInstanceId, width, height, null);
-
- if( operationId == LIVEBOX_ON_RESIZE)
- {
- SysLog(NID_APP, "operation is resize, but livebox is already recreated with new size, so OnSize won't be called.");
- return;
- }
- }
-
- if( operationId.StartsWith(L"LiveboxTray", 0) == true)
- {
- SysTryReturnVoidResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
- HandleLiveboxPopupRequest(operationId, pArgs);
- }
- else
- {
- SysTryReturnVoidResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_FAILURE] __pLiveboxFactory is null");
- HandleLiveboxRequest(operationId, pArgs);
- }
- SysLog(NID_APP, "Exit");
-}
-
-result
-_LiveboxManagerImpl::HandleLiveboxRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
-{
- if( pArgs == null && pArgs->GetCount() < 3)
- {
- SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
- return E_SYSTEM;
- }
-
- SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
-
- String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
- SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
-
- /*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
- SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
-
- String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
- SysTryReturnResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pName is null");
-
- SysLog(NID_APP, "id(%ls), name(%d)", pInstanceId->GetPointer(), pName->GetPointer());*/
-
- /*if( operationId == LIVEBOX_ON_ADD )
- {
- int w = 0;
- int h = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(2));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, w);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, h);
-
- this->__pLiveboxEventListener->OnLiveboxAdded(*pId, width, height, pArgs);
- }*/
-
- if (operationId == LIVEBOX_ON_RESIZE)
- {
- int width = 0;
- int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, width);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, height);
-
- this->ResizeLivebox(*pInstanceId, width, height);
- }
- else if (operationId == LIVEBOX_ON_UPDATE)
- {
- int width = 0;
- int height = 0;
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE], ");
- Integer::Parse(*pValue, width);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, height);
-
- this->UpdateLivebox(*pInstanceId, width, height);
- }
- else if (operationId == LIVEBOX_ON_REMOVE)
- {
- this->RemoveLivebox(*pInstanceId);
- }
- else if (operationId == LIVEBOX_ON_TOUCH)
- {
- SysAssertf(pArgs->GetCount() == 7, "invalid argc(%d)", pArgs->GetCount() );
-
- int eventType = 0;
- double timeStamp = 0.0f;
- double x = 0.0f;
- double y = 0.0f;
-
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, eventType);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, timeStamp);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(5));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, x);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(6));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, y);
-
- this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
- }
- SysLog(NID_APP, "Exit");
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
-{
- SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
- if( pArgs == null && pArgs->GetCount() < 3)
- {
- SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
- return E_SYSTEM;
- }
-
- String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
- SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
-
- /*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
- SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
+ _LiveboxManagerImpl* pLiveboxManager = static_cast<_LiveboxManagerImpl*>(data);
+ SysTryReturn(NID_APP, pLiveboxManager, 0, E_SYSTEM, "[E_SYSTEM] pLiveboxManager is null!");
- String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
- SysTryReturnResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pName is null");
-
- SysLog(NID_APP, "id(%ls), name(%d)", pInstanceId->GetPointer(), pName->GetPointer());*/
-
- if (operationId == LIVEBOX_TRAY_ON_CREATE)
- {
- int width = 0;
- int height = 0;
-
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, width);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, height);
-
- this->CreateLiveboxPopupProvider(*pInstanceId);
- return E_SUCCESS;
- }
- else if (operationId == LIVEBOX_TRAY_ON_DESTROY)
- {
- this->DestroyLiveboxPopupProvider(*pInstanceId);
- return E_SUCCESS;
- }
- else if (operationId == LIVEBOX_TRAY_ON_TOUCH)
- {
- SysAssertf(pArgs->GetCount() == 6, "invalid argc(%d)", pArgs->GetCount() );
-
- int eventType = 0;
- double timeStamp = 0.0f;
- double x = 0.0f;
- double y = 0.0f;
-
- String* pValue = dynamic_cast<String*>(pArgs->GetAt(2));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Integer::Parse(*pValue, eventType);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(3));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, timeStamp);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(4));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, x);
-
- pValue = dynamic_cast<String*>(pArgs->GetAt(5));
- SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
- Double::Parse(*pValue, y);
-
- ForwardTouchEventForPD(*pInstanceId, eventType, timeStamp, x, y);
- }
- else
- {
- SysLog(NID_APP, "unexpected case(%ls)", operationId.GetPointer() );
- }
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::CreateLivebox(const String& name, const String& instanceId, int width, int height, const String& userInfo)
-{
- SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
- SysTryReturnResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxFactory should not be null");
-
- LiveboxProvider* pLivebox = __pLiveboxFactory->CreateInstance(name, width, height, userInfo);
- SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
-
- pLivebox->Construct(instanceId);
- __liveBoxes.Add(instanceId, pLivebox);
-
- pLivebox->OnLiveboxProviderInitializing(width, height, userInfo);
-
- SysTryReturnResult(NID_APP, pLivebox->GetLiveboxFrame(), E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::UpdateLivebox(const String& instanceId, int width, int height)
-{
- SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
-
- LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
- SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
-
- pLivebox->OnLiveboxProviderUpdating(L"");
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::ResizeLivebox(const String& instanceId, int width, int height)
-{
- SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
-
- LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
- SysTryReturnResult(NID_APP, pLivebox, E_SYSTEM, "[E_SYSTEM]");
-
- LiveboxFrame* pLiveBoxFrame = pLivebox->GetLiveboxFrame();
- SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_STATE, "[E_INVALID_STATE]");
-
- return pLiveBoxFrame->SetSize(Dimension(width, height));
-}
-
-result
-_LiveboxManagerImpl::RemoveLivebox(const String& instanceId)
-{
- SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer() );
-// __pLiveboxEventListener->OnLiveboxRemoved(instanceId);
-
- LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
- __liveBoxes.Remove(instanceId);
- if( pLivebox != null)
- {
- delete pLivebox;
- }
-
-// this->__pLiveboxEventListener->OnLiveboxRemoved(instanceId);
- if( this->__liveBoxes.GetCount() == 0)
- {
- Tizen::App::App::GetInstance()->Terminate();
- }
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::CreateLiveboxPopupProvider(const String& instanceId)
-{
- SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer());
- SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxPopupProviderFactory should not be null");
-
- LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
- SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
-
- LiveboxPopupProvider* pPd = __pLiveboxPopupProviderFactory->CreateInstance(L"test", L"");
- __pLiveboxPopupProvider = pPd;
-
- __pLiveboxPopupProvider->Construct(instanceId);
- __pLiveboxPopupProvider->OnLiveboxPopupProviderInitializing(L"");
-
- LiveboxPopup* pLiveBoxFrame = pPd->GetLiveboxPopup();
- SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::DestroyLiveboxPopupProvider(const String& instanceId)
-{
- SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer());
-
- if( __pLiveboxPopupProvider != null)
- {
- __pLiveboxPopupProvider->OnLiveboxPopupProviderTerminating();
- delete __pLiveboxPopupProvider;
- __pLiveboxPopupProvider = null;
- }
-
- return E_SUCCESS;
-}
-
-result
-_LiveboxManagerImpl::ForwardTouchEvent(const String& instanceId, int eventType, double timeStamp, double x, double y)
-{
- SysLog(NID_APP, "instanceId(%ls), eventType(%d), timeStamp(%f), x(%f), y(%f)", instanceId.GetPointer(), eventType, timeStamp, x, y);
-
- _ILiveboxTouchEventListener* pTouchEventListener = null;
- __touchEventListeners.GetValue(instanceId, pTouchEventListener);
- SysTryReturnResult(NID_APP, pTouchEventListener, E_INVALID_STATE, "[E_INVALID_STATE]");
+ String appId;
+ String providerName;
+ _LiveboxManagerImpl::ExtractAppIdAndProviderName(providerId, appId, providerName);
- pTouchEventListener->OnTouchEventRecevied(eventType, timeStamp, x, y);
+ ILiveboxAddRequestListener* pListener = pLiveboxManager->GetAddRequestListener();
+ SysTryReturn(NID_APP, pLiveboxManager, 0, E_SYSTEM, "[E_SYSTEM] pListener is null!");
+ pListener->OnLiveboxAddRequested(appId, providerName, text, content_info);
- return E_SUCCESS;
+ return 0;
}
result
-_LiveboxManagerImpl::ForwardTouchEventForPD(const String& instanceId, int eventType, double timeStamp, double x, double y)
+_LiveboxManagerImpl::SetLiveboxAddRequestListener(ILiveboxAddRequestListener* pListener)
{
- SysTryReturnResult(NID_APP, __LiveboxPopupTouchEventListener, E_INVALID_STATE, "[E_INVALID_STATE]");
- __LiveboxPopupTouchEventListener->OnTouchEventRecevied(eventType, timeStamp, x, y);
+ int ret = shortcut_set_request_cb(LiveboxRequestEventHandler, this );
+ SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "failed to shortcut_set_request_cb (%d)", ret);
+ __pLiveboxRequestEventListener = pListener;
return E_SUCCESS;
}
-//////////////////////////////////////////////////////////////////////////
-// buffer APIs
-//////////////////////////////////////////////////////////////////////////
-
-result
-_LiveboxManagerImpl::RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId)
-{
- return _LiveboxManagerProxy::GetInstance()->RequestSharedMemoryId(instanceId, width, height, shmId);
-}
-result
-_LiveboxManagerImpl::RequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int& shmId)
-{
- return _LiveboxManagerProxy::GetInstance()->RequestSharedMemoryIdForPD(instanceId, width, height, shmId);
-}
-
-result
-_LiveboxManagerImpl::RequestReleaseSharedMemory(const Tizen::Base::String& instanceId)
+ILiveboxAddRequestListener*
+_LiveboxManagerImpl::GetAddRequestListener()
{
- return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemory(instanceId);
-}
-
-result
-_LiveboxManagerImpl::RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId)
-{
- return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemoryForPD(instanceId);
-}
-
-result
-_LiveboxManagerImpl::RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height)
-{
- return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemory(instanceId, width, height);
-}
-
-result
-_LiveboxManagerImpl::RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId)
-{
- return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemoryForPD(instanceId);
+ return __pLiveboxRequestEventListener;
}
// helper
-
result
_LiveboxManagerImpl::ExtractAppIdAndProviderName(const Tizen::Base::String& providerId, Tizen::App::AppId& appId, Tizen::Base::String& providerName)
{
#include <FIo_IpcClient.h>
#include <FShell_LiveboxManagerIpcMessage.h>
-#include "FShell_LiveboxManagerImpl.h"
+#include "FShell_LiveboxProviderManagerImpl.h"
#include "FShell_LiveboxManagerProxy.h"
namespace Tizen { namespace Shell {
result
_LiveboxManagerProxy::OnTouchEventReceived(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y )
{
- return _LiveboxManagerImpl::GetInstance()->ForwardTouchEvent(instanceId, eventType, timeStamp, x, y);
+ return _LiveboxProviderManagerImpl::GetInstance()->ForwardTouchEvent(instanceId, eventType, timeStamp, x, y);
}
result
_LiveboxManagerProxy::OnTouchEventReceivedForPD(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y )
{
- return _LiveboxManagerImpl::GetInstance()->ForwardTouchEventForPD(instanceId, eventType, timeStamp, x, y);
+ return _LiveboxProviderManagerImpl::GetInstance()->ForwardTouchEventForPD(instanceId, eventType, timeStamp, x, y);
}
void
#include "FShell_LiveboxLayer.h"
#include "FShell_LiveboxPopup.h"
#include "FShell_LiveboxPopupPresenter.h"
-#include "FShell_LiveboxManagerImpl.h"
+#include "FShell_LiveboxProviderManagerImpl.h"
using namespace std;
using namespace Tizen::Base;
result
_LiveboxPopupLayer::RegisterTouchEventListener(void)
{
- result r = _LiveboxManagerImpl::GetInstance()->SetLiveboxPopupEventListener(*this);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->SetLiveboxPopupEventListener(*this);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
Rectangle bounds = pWindow->GetBounds();
- result r = _LiveboxManagerImpl::GetInstance()->RequestSharedMemoryIdForPD(GetProviderId(), bounds.width, bounds.height, pixmapId);
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSharedMemoryIdForPD(GetProviderId(), bounds.width, bounds.height, pixmapId);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, -1, r, "[%s] Propagating.", GetErrorMessage(r));
SystemTime::GetTicks(ticks);
result
_LiveboxPopupLayer::Sync(const Tizen::Graphics::Rectangle& bounds)
{
- result r = _LiveboxManagerImpl::GetInstance()->RequestSyncSharedMemoryForPD(GetProviderId());
+ result r = _LiveboxProviderManagerImpl::GetInstance()->RequestSyncSharedMemoryForPD(GetProviderId());
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
void
_LiveboxPopupLayer::ReleasePixmap(void)
{
- _LiveboxManagerImpl::GetInstance()->RequestReleaseSharedMemoryForPD(GetProviderId());
+ _LiveboxProviderManagerImpl::GetInstance()->RequestReleaseSharedMemoryForPD(GetProviderId());
}
_LiveboxPopup::_LiveboxPopup(void)
// SysAssertf(pLiveboxFrameImpl != null, "Not-yet constructed! Construct() should be called before use.");
SysTryReturnResult(NID_APP, pLiveboxFrameImpl, E_INVALID_OPERATION, "Not-yet constructed! LiveboxFrame::Construct() should be called before use.");
- pLiveboxFrameImpl->SetProviderId(GetInstanceId());
+ result r = pLiveboxFrameImpl->SetProviderId(GetInstanceId());
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_SYSTEM, "Failed to invoke _LiveboxFrameImpl::SetProviderId.");
return E_SUCCESS;
}
}
Tizen::Base::Collection::IList*
-_LiveboxProviderInfoImpl::GetSizeInfosN() const
+_LiveboxProviderInfoImpl::GetSizeInfoListN() const
{
const int SUPPORTED_SIZE_TYPE_MAX = 6;
return pSizes;
}
+LiveboxProviderInfo*
+_LiveboxProviderInfoImpl::GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
+{
+ return new LiveboxProviderInfo(appId, providerName);
+}
_LiveboxProviderInfoImpl*
_LiveboxProviderInfoImpl::GetImpl(const LiveboxProviderInfo& liveboxProviderInfo)
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 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.
+//
+
+/**
+ * @file FShell_LiveboxManagerImpl.cpp
+ * @brief This is the implementation for the _LiveboxManagerImpl class.
+ */
+
+#include <unique_ptr.h>
+
+#include <shortcut.h>
+//#include <livebox-service/livebox-service.h>
+
+#include <FBaseSysLog.h>
+#include <FBase.h>
+#include <FApp.h>
+#include <FGrpDimension.h>
+#include <FApp_AppImpl.h>
+#include <FAppPkg_PackageManagerImpl.h>
+#include <FBase_StringConverter.h>
+
+#include <FShellLiveboxProviderInfo.h>
+#include <FShellLiveboxProvider.h>
+#include <FShellLiveboxPopupProvider.h>
+#include <FShellLiveboxFrame.h>
+#include <FShellLiveboxPopup.h>
+
+#include <FShellILiveboxProviderFactory.h>
+#include <FShellILiveboxPopupProviderFactory.h>
+
+#include <FShell_ILiveboxTouchEventListener.h>
+#include <FShell_TemplateUtil.h>
+
+#include "FShell_LiveboxManagerProxy.h"
+#include "FShell_LiveboxProviderManagerImpl.h"
+
+#include "FShell_LiveboxProviderInfoImpl.h"
+
+namespace Tizen { namespace Shell
+{
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Graphics;
+
+
+namespace
+{
+const char LIVEBOX_ON_ADD[] = "Livebox='event=add'";
+const char LIVEBOX_ON_REMOVE[] = "Livebox='event=remove'";
+const char LIVEBOX_ON_UPDATE[] = "Livebox='event=update'";
+const char LIVEBOX_ON_RESIZE[] = "Livebox='event=resize'";
+const char LIVEBOX_ON_TOUCH[] = "Livebox='event=touch'";
+const char LIVEBOX_TRAY_ON_CREATE[] = "LiveboxTray='event=create'";
+const char LIVEBOX_TRAY_ON_DESTROY[] = "LiveboxTray='event=destroy'";
+const char LIVEBOX_TRAY_ON_TOUCH[] = "LiveboxTray='event=touch'";
+}
+
+_LiveboxProviderManagerImpl::_LiveboxProviderManagerImpl()
+ :__pLiveboxFactory(null)
+ ,__pLiveboxPopupProviderFactory(null)
+ ,__pLiveboxPopupProvider(null)
+ ,__LiveboxPopupTouchEventListener(null)
+ ,__messageReceived(false)
+{
+ SysLog(NID_APP, "");
+}
+
+_LiveboxProviderManagerImpl::~_LiveboxProviderManagerImpl()
+{
+ SysLog(NID_APP, "");
+}
+
+
+_LiveboxProviderManagerImpl*
+_LiveboxProviderManagerImpl::GetInstance()
+{
+ static _LiveboxProviderManagerImpl* __pLiveboxManagerImpl = null;
+ if( __pLiveboxManagerImpl == null)
+ {
+ __pLiveboxManagerImpl = new (std::nothrow)_LiveboxProviderManagerImpl;
+ SysTryReturn(NID_APP, __pLiveboxManagerImpl, null, E_OUT_OF_MEMORY, "Allocating new _LiveboxManagerProxy failed.");
+
+ result r = __pLiveboxManagerImpl->Construct();
+ SysTryReturn(NID_APP, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ return __pLiveboxManagerImpl;
+}
+
+result
+_LiveboxProviderManagerImpl::Construct()
+{
+ SysLog(NID_APP, "Enter.");
+
+ __liveBoxes.Construct();
+ __touchEventListeners.Construct();
+
+ Tizen::App::_AppImpl::GetInstance()->SetAppControlProviderInternalEventListener(this);
+
+ SysLog(NID_APP, "Exit.");
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::SetLiveboxProviderFactory(ILiveboxProviderFactory& factory)
+{
+ __pLiveboxFactory = &factory;
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory)
+{
+ __pLiveboxPopupProviderFactory = &factory;
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::SetLiveboxTouchEventListener(const String& instanceId, _ILiveboxTouchEventListener& listener)
+{
+ return __touchEventListeners.Add(instanceId, &listener);
+}
+
+result
+_LiveboxProviderManagerImpl::SetLiveboxPopupEventListener(_ILiveboxTouchEventListener& listener)
+{
+ __LiveboxPopupTouchEventListener = &listener;
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
+{
+
+ /*if( appId == App::App::GetInstance()->GetAppId()) //TODO: optimazing
+ {
+
+ }
+ else*/
+ {
+ _LiveboxManagerProxy::GetInstance()->RequestUpdate(appId, providerName);
+ }
+ return E_SUCCESS;
+}
+
+namespace
+{
+int AddLiveboxCallback(int ret, int pid, void *data)
+{
+ if( ret != 0)
+ {
+ SysLog(NID_APP, "Error.(%d)", ret);
+ }
+
+ return 0;
+}
+}
+
+result
+_LiveboxProviderManagerImpl::AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
+{
+ SysTryReturnResult(NID_APP, providerAppId.IsEmpty()==false, E_INVALID_ARG, "The providerAppId is empty.");
+ SysTryReturnResult(NID_APP, providerAppId.GetLength() < NATIVE_APP_MAX_APPID_LENGTH, E_INVALID_ARG, "The providerAppId is too long (Maximum %d bytes).", NATIVE_APP_MAX_APPID_LENGTH);
+// SysTryReturnResult(NID_APP, _PackageManagerImpl::IsAppInstalled(providerAppId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", providerAppId.GetPointer());
+
+ //TODO :: check privilege
+ String providerId;
+ if( providerAppId.StartsWith(L"com.samsung", 0) == true )
+ {
+ SysLog(NID_APP, "[E_INVALID_OPERATION] but allowed to test");
+ //TODO:return E_INVALID_OPERATION
+ providerId = providerAppId;
+ }
+ else
+ {
+ String localPackageId = _PackageManagerImpl::GetPackageIdByAppId(Tizen::App::App::GetInstance()->GetAppId());
+ String liveboxProviderPackageId = _PackageManagerImpl::GetPackageIdByAppId(providerAppId);
+ if( localPackageId != liveboxProviderPackageId)
+ {
+ SysLog(NID_APP, "[E_INVALID_OPERATION] but allowed to test");
+ //TODO:return E_INVALID_OPERATION
+ }
+ providerId = providerAppId + "." + providerName;
+ }
+
+ PackageInfo* pPackageInfo = null;
+ result r = E_SUCCESS;
+
+ pPackageInfo = _PackageManagerImpl::GetInstance()->GetPackageInfoN(providerAppId);
+ SysTryReturn(NID_APP, pPackageInfo != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ String iconPath; //= packageInfo.GetAppIconPath();
+
+ delete pPackageInfo;
+
+ std::unique_ptr<char[]> pProviderId(_StringConverter::CopyToCharArrayN(providerId));
+ std::unique_ptr<char[]> pName(_StringConverter::CopyToCharArrayN(text));
+ std::unique_ptr<char[]> pContent(_StringConverter::CopyToCharArrayN(userInfo));
+ std::unique_ptr<char[]> pIcon(_StringConverter::CopyToCharArrayN(iconPath));
+
+ int ret = add_to_home_livebox(pProviderId.get(), pName.get(), LAUNCH_BY_PACKAGE, pContent.get(), pIcon.get(), -1.0l, AddLiveboxCallback, this);
+ SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "[E_SYSTEM] failed to add_to_home_livebox (%d)", ret);
+
+ return E_SUCCESS;
+}
+
+bool
+_LiveboxProviderManagerImpl::ContainsLivebox(const String& instanceId) const
+{
+ bool isCreated = false;
+ __liveBoxes.ContainsKey(instanceId, isCreated);
+
+ return isCreated;
+}
+
+void
+_LiveboxProviderManagerImpl::TerminateAppIfInvalidState()
+{
+ if( __messageReceived == false )
+ {
+ Tizen::App::App::GetInstance()->Terminate();
+ }
+}
+
+void
+_LiveboxProviderManagerImpl::OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs)
+{
+ if( pArgs == null && pArgs->GetCount() == 0)
+ {
+ SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
+ return;
+ }
+ __messageReceived = true;
+
+ SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
+
+ String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
+ SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
+
+ String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
+ SysTryReturnVoidResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
+
+ String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
+ SysTryReturnVoidResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pParam is null");
+
+ SysLog(NID_APP, "id(%ls), name(%ls), param(%ls)", pInstanceId->GetPointer(), pName->GetPointer(), pParam->GetPointer());
+
+ if(this->ContainsLivebox(*pInstanceId) == false)
+ {
+ SysLog(NID_APP, "no livebox instance, creating..");
+
+ int width = 0;
+ int height = 0;
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, width);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnVoidResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, height);
+
+ this->CreateLivebox( *pName, *pInstanceId, width, height, null);
+
+ if( operationId == LIVEBOX_ON_RESIZE)
+ {
+ SysLog(NID_APP, "operation is resize, but livebox is already recreated with new size, so OnSize won't be called.");
+ return;
+ }
+ }
+
+ if( operationId.StartsWith(L"LiveboxTray", 0) == true)
+ {
+ SysTryReturnVoidResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
+ HandleLiveboxPopupRequest(operationId, pArgs);
+ }
+ else
+ {
+ SysTryReturnVoidResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_FAILURE] __pLiveboxFactory is null");
+ HandleLiveboxRequest(operationId, pArgs);
+ }
+ SysLog(NID_APP, "Exit");
+}
+
+result
+_LiveboxProviderManagerImpl::HandleLiveboxRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
+{
+ if( pArgs == null && pArgs->GetCount() < 3)
+ {
+ SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
+ return E_SYSTEM;
+ }
+
+ SysLog(NID_APP, "operationId(%ls), argc(%d)", operationId.GetPointer(), pArgs->GetCount());
+
+ String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
+ SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
+
+ /*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
+ SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
+
+ String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
+ SysTryReturnResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pName is null");
+
+ SysLog(NID_APP, "id(%ls), name(%d)", pInstanceId->GetPointer(), pName->GetPointer());*/
+
+ /*if( operationId == LIVEBOX_ON_ADD )
+ {
+ int w = 0;
+ int h = 0;
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(2));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, w);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, h);
+
+ this->__pLiveboxEventListener->OnLiveboxAdded(*pId, width, height, pArgs);
+ }*/
+
+ if (operationId == LIVEBOX_ON_RESIZE)
+ {
+ int width = 0;
+ int height = 0;
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, width);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, height);
+
+ this->ResizeLivebox(*pInstanceId, width, height);
+ }
+ else if (operationId == LIVEBOX_ON_UPDATE)
+ {
+ int width = 0;
+ int height = 0;
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE], ");
+ Integer::Parse(*pValue, width);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, height);
+
+ this->UpdateLivebox(*pInstanceId, width, height);
+ }
+ else if (operationId == LIVEBOX_ON_REMOVE)
+ {
+ this->RemoveLivebox(*pInstanceId);
+ }
+ else if (operationId == LIVEBOX_ON_TOUCH)
+ {
+ SysAssertf(pArgs->GetCount() == 7, "invalid argc(%d)", pArgs->GetCount() );
+
+ int eventType = 0;
+ double timeStamp = 0.0f;
+ double x = 0.0f;
+ double y = 0.0f;
+
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, eventType);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, timeStamp);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(5));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, x);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(6));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, y);
+
+ this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
+ }
+ SysLog(NID_APP, "Exit");
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs)
+{
+ SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_FAILURE] __pLiveboxPopupProviderFactory is null");
+ if( pArgs == null && pArgs->GetCount() < 3)
+ {
+ SysAssertf(pArgs, "[E_SYSTEN] pArgs should not be null.");
+ return E_SYSTEM;
+ }
+
+ String *pInstanceId = dynamic_cast<String*>(pArgs->GetAt(0));
+ SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pId is null.");
+
+ /*String *pName = dynamic_cast<String*>(pArgs->GetAt(1));
+ SysTryReturnResult(NID_APP, pInstanceId, E_FAILURE, "[E_FAILURE] pName is null");
+
+ String *pParam = dynamic_cast<String*>(pArgs->GetAt(2));
+ SysTryReturnResult(NID_APP, pParam, E_FAILURE, "[E_FAILURE] pName is null");
+
+ SysLog(NID_APP, "id(%ls), name(%d)", pInstanceId->GetPointer(), pName->GetPointer());*/
+
+ if (operationId == LIVEBOX_TRAY_ON_CREATE)
+ {
+ int width = 0;
+ int height = 0;
+
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, width);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, height);
+
+ this->CreateLiveboxPopupProvider(*pInstanceId);
+ return E_SUCCESS;
+ }
+ else if (operationId == LIVEBOX_TRAY_ON_DESTROY)
+ {
+ this->DestroyLiveboxPopupProvider(*pInstanceId);
+ return E_SUCCESS;
+ }
+ else if (operationId == LIVEBOX_TRAY_ON_TOUCH)
+ {
+ SysAssertf(pArgs->GetCount() == 6, "invalid argc(%d)", pArgs->GetCount() );
+
+ int eventType = 0;
+ double timeStamp = 0.0f;
+ double x = 0.0f;
+ double y = 0.0f;
+
+ String* pValue = dynamic_cast<String*>(pArgs->GetAt(2));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Integer::Parse(*pValue, eventType);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(3));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, timeStamp);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(4));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, x);
+
+ pValue = dynamic_cast<String*>(pArgs->GetAt(5));
+ SysTryReturnResult(NID_APP, pValue, E_FAILURE, "[E_FAILURE]");
+ Double::Parse(*pValue, y);
+
+ ForwardTouchEventForPD(*pInstanceId, eventType, timeStamp, x, y);
+ }
+ else
+ {
+ SysLog(NID_APP, "unexpected case(%ls)", operationId.GetPointer() );
+ }
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::CreateLivebox(const String& name, const String& instanceId, int width, int height, const String& userInfo)
+{
+ SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
+ SysTryReturnResult(NID_APP, __pLiveboxFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxFactory should not be null");
+
+ LiveboxProvider* pLivebox = __pLiveboxFactory->CreateInstance(name, width, height, userInfo);
+ SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+
+ pLivebox->Construct(instanceId);
+ __liveBoxes.Add(instanceId, pLivebox);
+
+ pLivebox->OnLiveboxProviderInitializing(width, height, userInfo);
+
+ SysTryReturnResult(NID_APP, pLivebox->GetLiveboxFrame(), E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::UpdateLivebox(const String& instanceId, int width, int height)
+{
+ SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
+
+ LiveboxProvider* pLivebox = null;
+ __liveBoxes.GetValue(instanceId, pLivebox);
+ SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+
+ pLivebox->OnLiveboxProviderUpdating(L"");
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::ResizeLivebox(const String& instanceId, int width, int height)
+{
+ SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
+
+ LiveboxProvider* pLivebox = null;
+ __liveBoxes.GetValue(instanceId, pLivebox);
+ SysTryReturnResult(NID_APP, pLivebox, E_SYSTEM, "[E_SYSTEM]");
+
+ LiveboxFrame* pLiveBoxFrame = pLivebox->GetLiveboxFrame();
+ SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_STATE, "[E_INVALID_STATE]");
+
+ return pLiveBoxFrame->SetSize(Dimension(width, height));
+}
+
+result
+_LiveboxProviderManagerImpl::RemoveLivebox(const String& instanceId)
+{
+ SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer() );
+// __pLiveboxEventListener->OnLiveboxRemoved(instanceId);
+
+ LiveboxProvider* pLivebox = null;
+ __liveBoxes.GetValue(instanceId, pLivebox);
+ __liveBoxes.Remove(instanceId);
+ if( pLivebox != null)
+ {
+ delete pLivebox;
+ }
+
+// this->__pLiveboxEventListener->OnLiveboxRemoved(instanceId);
+ if( this->__liveBoxes.GetCount() == 0)
+ {
+ Tizen::App::App::GetInstance()->Terminate();
+ }
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::CreateLiveboxPopupProvider(const String& instanceId)
+{
+ SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer());
+ SysTryReturnResult(NID_APP, __pLiveboxPopupProviderFactory, E_FAILURE, "[E_INVALID_OPERATION] __pLiveboxPopupProviderFactory should not be null");
+
+ LiveboxProvider* pLivebox = null;
+ __liveBoxes.GetValue(instanceId, pLivebox);
+ SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+
+ LiveboxPopupProvider* pPd = __pLiveboxPopupProviderFactory->CreateInstance(L"test", L"");
+ __pLiveboxPopupProvider = pPd;
+
+ __pLiveboxPopupProvider->Construct(instanceId);
+ __pLiveboxPopupProvider->OnLiveboxPopupProviderInitializing(L"");
+
+ LiveboxPopup* pLiveBoxFrame = pPd->GetLiveboxPopup();
+ SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::DestroyLiveboxPopupProvider(const String& instanceId)
+{
+ SysLog(NID_APP, "instanceId(%ls)", instanceId.GetPointer());
+
+ if( __pLiveboxPopupProvider != null)
+ {
+ __pLiveboxPopupProvider->OnLiveboxPopupProviderTerminating();
+ delete __pLiveboxPopupProvider;
+ __pLiveboxPopupProvider = null;
+ }
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::ForwardTouchEvent(const String& instanceId, int eventType, double timeStamp, double x, double y)
+{
+ SysLog(NID_APP, "instanceId(%ls), eventType(%d), timeStamp(%f), x(%f), y(%f)", instanceId.GetPointer(), eventType, timeStamp, x, y);
+
+ _ILiveboxTouchEventListener* pTouchEventListener = null;
+ __touchEventListeners.GetValue(instanceId, pTouchEventListener);
+ SysTryReturnResult(NID_APP, pTouchEventListener, E_INVALID_STATE, "[E_INVALID_STATE]");
+
+ pTouchEventListener->OnTouchEventRecevied(eventType, timeStamp, x, y);
+
+ return E_SUCCESS;
+}
+
+result
+_LiveboxProviderManagerImpl::ForwardTouchEventForPD(const String& instanceId, int eventType, double timeStamp, double x, double y)
+{
+ SysTryReturnResult(NID_APP, __LiveboxPopupTouchEventListener, E_INVALID_STATE, "[E_INVALID_STATE]");
+ __LiveboxPopupTouchEventListener->OnTouchEventRecevied(eventType, timeStamp, x, y);
+
+ return E_SUCCESS;
+}
+//////////////////////////////////////////////////////////////////////////
+// buffer APIs
+//////////////////////////////////////////////////////////////////////////
+
+result
+_LiveboxProviderManagerImpl::RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestSharedMemoryId(instanceId, width, height, shmId);
+}
+
+result
+_LiveboxProviderManagerImpl::RequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int& shmId)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestSharedMemoryIdForPD(instanceId, width, height, shmId);
+}
+
+result
+_LiveboxProviderManagerImpl::RequestReleaseSharedMemory(const Tizen::Base::String& instanceId)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemory(instanceId);
+}
+
+result
+_LiveboxProviderManagerImpl::RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemoryForPD(instanceId);
+}
+
+result
+_LiveboxProviderManagerImpl::RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemory(instanceId, width, height);
+}
+
+result
+_LiveboxProviderManagerImpl::RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId)
+{
+ return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemoryForPD(instanceId);
+}
+
+}} // Tizen::Shell
* This header file contains the declarations of the _LiveboxManagerImpl class.
*/
-#ifndef FShell_LiveboxMANAGERIMPL_H_
-#define FShell_LiveboxMANAGERIMPL_H_
+#ifndef _FSHELL_INTERNAL_LIVEBOX_MANAGERIMPL_H_
+#define _FSHELL_INTERNAL_LIVEBOX_MANAGERIMPL_H_
#include <unique_ptr.h>
#include <FBaseObject.h>
#include <FBaseColIListT.h>
#include <FAppTypes.h>
#include <FAppIAppControlProviderEventListener.h>
-//#include <FShellLiveboxProviderInfo.h>
+#include <FShellLiveboxManager.h>
namespace Tizen { namespace Shell {
-class LiveboxFrame;
-class LiveboxPopup;
-
class LiveboxProviderInfo;
-class ILiveboxProviderFactory;
-class ILiveboxPopupProviderFactory;
-class LiveboxProvider;
-class LiveboxPopupProvider;
-class _ILiveboxTouchEventListener;
-class _LiveboxManagerProxy;
-
-
class _OSP_EXPORT_ _LiveboxManagerImpl
- : public Tizen::App::IAppControlProviderEventListener
- , public Tizen::Base::Object
+ : public Tizen::Base::Object
{
public:
static _LiveboxManagerImpl* GetInstance();
// API impl
- result SetLiveboxProviderFactory(ILiveboxProviderFactory& factory);
- result SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory);
-
- Tizen::Base::Collection::IList* GetLiveboxProviderInfosN();
+ Tizen::Base::Collection::IList* GetLiveboxProviderInfoListN();
LiveboxProviderInfo* GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
-
- result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
-
- // internal API
- result RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId);
- result RequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int& shmId);
- result RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height);
- result RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId);
- result RequestReleaseSharedMemory(const Tizen::Base::String& instanceId);
- result RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId);
+ result SetLiveboxAddRequestListener(ILiveboxAddRequestListener* pListener);
// internal
- result SetLiveboxTouchEventListener(const Tizen::Base::String& instanceId, _ILiveboxTouchEventListener& listener);
- result SetLiveboxPopupEventListener(_ILiveboxTouchEventListener& listener);
-
- result ForwardTouchEvent(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y);
- result ForwardTouchEventForPD(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y);
+ ILiveboxAddRequestListener* GetAddRequestListener();
// helper
static result ExtractAppIdAndProviderName(const Tizen::Base::String& providerId, Tizen::App::AppId& appId, Tizen::Base::String& providerName);
- void TerminateAppIfInvalidState();
-
private:
_LiveboxManagerImpl();
virtual ~_LiveboxManagerImpl();
result Construct();
- result CreateLivebox(const Tizen::Base::String& name, const Tizen::Base::String& instanceId, int width, int height, const Tizen::Base::String& userInfo);
- result UpdateLivebox(const Tizen::Base::String& instanceId, int width, int height);
- result ResizeLivebox(const Tizen::Base::String& instanceId, int width, int height);
- result RemoveLivebox(const Tizen::Base::String& instanceId);
- result CreateLiveboxPopupProvider(const Tizen::Base::String& instanceId);
- result DestroyLiveboxPopupProvider(const Tizen::Base::String& instanceId);
-
- bool ContainsLivebox(const Tizen::Base::String& instanceId) const;
-
- virtual void OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs);
- // [Temp] abc break
- virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData) {}
-
- result HandleLiveboxRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs);
- result HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs);
-
private:
- // for livebox
- ILiveboxProviderFactory* __pLiveboxFactory;
- Tizen::Base::Collection::HashMapT<Tizen::Base::String, LiveboxProvider*> __liveBoxes;
- Tizen::Base::Collection::HashMapT<Tizen::Base::String, _ILiveboxTouchEventListener*> __touchEventListeners;
-
- // for PD
- ILiveboxPopupProviderFactory* __pLiveboxPopupProviderFactory;
- LiveboxPopupProvider* __pLiveboxPopupProvider;
- _ILiveboxTouchEventListener* __LiveboxPopupTouchEventListener;
+ ILiveboxAddRequestListener* __pLiveboxRequestEventListener;
- bool __messageReceived;
};
}} // Tizen::Shell
-#endif /* FShell_LiveboxMANAGERIMPL_H_ */
+#endif /* _FSHELL_INTERNAL_LIVEBOX_MANAGERIMPL_H_ */
* @exception E_SYSTEM A system error has occurred.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
- Tizen::Base::Collection::IList* GetSizeInfosN() const;
+ Tizen::Base::Collection::IList* GetSizeInfoListN() const;
+
+
+ // internal
+ static LiveboxProviderInfo* GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
static _LiveboxProviderInfoImpl* GetImpl(const LiveboxProviderInfo& liveboxProviderInfo);
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 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.
+//
+
+/**
+ * @file FShell_LiveboxManagerImpl.h
+ * @brief This is the header file for the _LiveboxProviderManagerImpl class.
+ *
+ * This header file contains the declarations of the _LiveboxProviderManagerImpl class.
+ */
+
+#ifndef FShell_LIVEBOX_PROVIDER_MANAGERIMPL_H_
+#define FShell_LIVEBOX_PROVIDER_MANAGERIMPL_H_
+
+#include <unique_ptr.h>
+#include <FBaseObject.h>
+#include <FBaseColHashMapT.h>
+#include <FBaseColIListT.h>
+#include <FAppTypes.h>
+#include <FAppIAppControlProviderEventListener.h>
+
+
+namespace Tizen { namespace Shell {
+
+class LiveboxFrame;
+class LiveboxPopup;
+
+class ILiveboxProviderFactory;
+class ILiveboxPopupProviderFactory;
+class LiveboxProvider;
+class LiveboxPopupProvider;
+class _ILiveboxTouchEventListener;
+class _LiveboxManagerProxy;
+
+
+class _OSP_EXPORT_ _LiveboxProviderManagerImpl
+ : public Tizen::App::IAppControlProviderEventListener
+ , public Tizen::Base::Object
+{
+public:
+ static _LiveboxProviderManagerImpl* GetInstance();
+
+ // public APIs
+ result SetLiveboxProviderFactory(ILiveboxProviderFactory& factory);
+ result SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory);
+ result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+ result AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::Base::String& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo);
+
+ // internal APIs
+ result RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId);
+ result RequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int& shmId);
+ result RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height);
+ result RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId);
+ result RequestReleaseSharedMemory(const Tizen::Base::String& instanceId);
+ result RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId);
+
+ // internal
+ result SetLiveboxTouchEventListener(const Tizen::Base::String& instanceId, _ILiveboxTouchEventListener& listener);
+ result SetLiveboxPopupEventListener(_ILiveboxTouchEventListener& listener);
+
+ result ForwardTouchEvent(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y);
+ result ForwardTouchEventForPD(const Tizen::Base::String& instanceId, int eventType, double timeStamp, double x, double y);
+
+ // helper
+// static result ExtractAppIdAndProviderName(const Tizen::Base::String& providerId, Tizen::App::AppId& appId, Tizen::Base::String& providerName);
+
+ void TerminateAppIfInvalidState();
+
+private:
+ _LiveboxProviderManagerImpl();
+ virtual ~_LiveboxProviderManagerImpl();
+ result Construct();
+
+ result CreateLivebox(const Tizen::Base::String& name, const Tizen::Base::String& instanceId, int width, int height, const Tizen::Base::String& userInfo);
+ result UpdateLivebox(const Tizen::Base::String& instanceId, int width, int height);
+ result ResizeLivebox(const Tizen::Base::String& instanceId, int width, int height);
+ result RemoveLivebox(const Tizen::Base::String& instanceId);
+ result CreateLiveboxPopupProvider(const Tizen::Base::String& instanceId);
+ result DestroyLiveboxPopupProvider(const Tizen::Base::String& instanceId);
+
+ bool ContainsLivebox(const Tizen::Base::String& instanceId) const;
+
+ virtual void OnAppControlRequestReceivedN(RequestId reqId, const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::String& category, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriScheme, Tizen::Base::Collection::IList* pArgs);
+ // [Temp] abc break
+ virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData) {}
+
+ result HandleLiveboxRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs);
+ result HandleLiveboxPopupRequest(const Tizen::Base::String& operationId, Tizen::Base::Collection::IList* pArgs);
+
+private:
+ // for livebox
+ ILiveboxProviderFactory* __pLiveboxFactory;
+ Tizen::Base::Collection::HashMapT<Tizen::Base::String, LiveboxProvider*> __liveBoxes;
+ Tizen::Base::Collection::HashMapT<Tizen::Base::String, _ILiveboxTouchEventListener*> __touchEventListeners;
+
+ // for PD
+ ILiveboxPopupProviderFactory* __pLiveboxPopupProviderFactory;
+ LiveboxPopupProvider* __pLiveboxPopupProvider;
+ _ILiveboxTouchEventListener* __LiveboxPopupTouchEventListener;
+
+ bool __messageReceived;
+};
+
+}} // Tizen::Shell
+#endif /* FShell_LIVEBOX_PROVIDER_MANAGERIMPL_H_ */