* @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& providerName, int width, int height, const Tizen::Base::String& userInfo) = 0;
+ virtual LiveboxProvider* CreateInstance(const Tizen::Base::String& providerName, float width, float height, const Tizen::Base::String& userInfo) = 0;
protected:
//
* @since 2.1
*
* @param[in] userInfo User information that specifed when the Livebox is added
+ * @return @c true if the method is successful, @n
+ * else @c false\r
*
* @remarks LiveboxPopup should be created and set here
* @see SetLiveboxPopup
*/
- virtual void OnLiveboxPopupProviderInitializing(const Tizen::Base::String& userInfo) = 0;
+ virtual bool OnLiveboxPopupProviderInitializing(const Tizen::Base::String& userInfo) = 0;
/**
* Called when the Livebox popup provider is required to be destroyed @n
*
* @return The LiveboxPopup instnace, or null if any LiveboxPopup is set yet.
*/
- const Tizen::Shell::LiveboxPopup* GetLiveboxPopup() const;
+ const Tizen::Shell::LiveboxPopup* GetLiveboxPopup(void) const;
/**
* Requests Livebox service to trigger specified Livebox update
* @param[in] height The height of the Livebox
* @param[in] userInfo User information that specifed when the Livebox is added
*
+ * @return @c true if the method is successful, @n
+ * else @c false
+ *
* @remarks LiveboxFrame should be created and set here
* @see SetLiveboxFrame
*
* AddControl(*__pLabel);
* this->SetLiveboxFrame(pFrame);
* pFrame->Show();
+ *
+ * return true;
* }
* @endcode
*/
- virtual void OnLiveboxProviderInitializing(int width, int height, const Tizen::Base::String& userInfo) = 0;
+ virtual bool OnLiveboxProviderInitializing(float width, float height, const Tizen::Base::String& userInfo) = 0;
/**
* Called when the Livebox provider is required to be destroyed @n
* @param[in] userInfo User information to update the Livebox provider@n
* This parameter is delivered from LiveboxProvider::RequestUpdate()
*
+ * @return @c true if the method is successful, @n
+ * else @c false
+ *
* @remarks This function is called when UpdatePeriod timer is expired or LiveboxManager::RequestUpdate() is called.@n
*/
- virtual void OnLiveboxProviderUpdating(const Tizen::Base::String& userInfo) = 0;
+ virtual bool OnLiveboxProviderUpdating(const Tizen::Base::String& userInfo) = 0;
/**
* Sets the LiveboxFrame to the LiveboxProvider
*
* @return the LiveboxFrame instnace, or null if any LiveboxFrame isn't set yet.
*/
- const LiveboxFrame* GetLiveboxFrame() const;
+ const LiveboxFrame* GetLiveboxFrame(void) const;
protected:
//
*
* @return The application ID
*/
- Tizen::App::AppId GetAppId() const;
+ Tizen::App::AppId GetAppId(void) const;
/**
* Gets the Livebox provider name
*
* @return The application ID
*/
- Tizen::Base::String GetName() const;
+ Tizen::Base::String GetName(void) const;
/**
* Gets the display name of the Livbox @n
*
* @return The display name of the Livbox
*/
- Tizen::Base::String GetDisplayName() const;
+ Tizen::Base::String GetDisplayName(void) const;
/**
* Gets the icon path of the application.
* @return The icon path of the application, @n
* An empty string is returned if there is no value.
*/
- Tizen::Base::String GetIconPath() const;
+ Tizen::Base::String GetIconPath(void) const;
/**
* Gets the Id of the application that exports AppContorl to configure the Livebox
* delete pProviderInfo;
* @endcode
*/
- Tizen::Base::String GetConfigurationAppControlAppId() const;
+ Tizen::Base::String GetConfigurationAppControlAppId(void) const;
/**
* Checks whether the Livebox provider is default or not.
* @remarks Default Livebox provider providing Livebox that represents application.@n
* Home application can show Livebox instead of icon and text for applications that includes default Livebox provider.
*/
- bool IsDefault() const;
+ bool IsDefault(void) const;
/**
* Gets a list of LiveboxSizeInfo of the Livebox
* @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* GetSizeInfoListN() const;
+ Tizen::Base::Collection::IList* GetSizeInfoListN(void) const;
private:
* @privlevel public
* @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] alternateText Alternate text displayed in the LiveboxView while the LiveboxProvider is initializing or unavailable.
* @remarks 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::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& alternateText, const Tizen::Base::String& userInfo);
+ result AddLivebox(const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& alternateText, const Tizen::Base::String& userInfo);
/**
* Sets a LiveboxProvider factory. @n
#include <FBaseString.h>
#include <FAppTypes.h>
-#include <FGrpDimension.h>
+#include <FGrpFloatDimension.h>
namespace Tizen { namespace Shell
{
*
* @return A size
*/
- Tizen::Graphics::Dimension GetSize() const;
+ Tizen::Graphics::FloatDimension GetSize(void) const;
/**
* Gets the image path for preview
*
* @return The image path for preview
*/
- Tizen::Base::String GetPreviewImagePath() const;
+ Tizen::Base::String GetPreviewImagePath(void) const;
private:
//
// @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);
+ LiveboxSizeInfo(Tizen::Graphics::FloatDimension size, const Tizen::Base::String& previewImagePath);
//
// This default constructor is intentionally declared as private so that only the platform can create an instance.
}
result
-LiveboxProviderManager::AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
+LiveboxProviderManager::AddLivebox(const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
{
- return __pLiveboxProviderManagerImpl->AddLivebox(viewerAppId, providerAppId, providerName, text, userInfo);
+ return __pLiveboxProviderManagerImpl->AddLivebox(providerAppId, providerName, text, userInfo);
}
}} // Tizen::Shell
namespace Tizen { namespace Shell
{
-LiveboxSizeInfo::LiveboxSizeInfo(Dimension size, const String& previewImagePath)
+LiveboxSizeInfo::LiveboxSizeInfo(FloatDimension size, const String& previewImagePath)
{
__pLiveboxSizeInfoImpl = new (std::nothrow) _LiveboxSizeInfoImpl(size, previewImagePath);
}
{
}
-Dimension
+FloatDimension
LiveboxSizeInfo::GetSize() const
{
return __pLiveboxSizeInfoImpl->GetSize();
SysTryReturn(NID_APP, pSizes, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory for ArrayList." );
pSizes->Construct();
- Dimension size(0, 0);
+ FloatDimension size(0, 0);
String previewImagePath;
for(int i = 0; i < supportedSizeCount; i++)
{
size.SetSize(widthArray[i], heightArray[i]);
- previewImagePath = livebox_service_preview(pPackageId.get(), livebox_service_size_type(size.width, size.height) );
+ previewImagePath = livebox_service_preview(pPackageId.get(), livebox_service_size_type(static_cast<int>(size.width), static_cast<int>(size.height) ) );
std::unique_ptr<LiveboxSizeInfo> pLiveboxSizeInfo(_LiveboxSizeInfoImpl::CreateLiveboxSizeInfo(size, previewImagePath) );
SysTryReturn(NID_APP, pLiveboxSizeInfo, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Failed to allocate memory for LiveboxSizeInfo." );
pSizes->Add( *pLiveboxSizeInfo.release() );
{
SysLog(NID_APP, "Enter.");
- __liveBoxes.Construct();
+ __liveboxProviders.Construct();
__touchEventListeners.Construct();
Tizen::App::_AppImpl::GetInstance()->SetAppControlProviderInternalEventListener(this);
if(ContainsLivebox(instanceId))
{
LiveboxProvider* pLiveboxProvider = null;
- __liveBoxes.GetValue(instanceId, pLiveboxProvider);
+ __liveboxProviders.GetValue(instanceId, pLiveboxProvider);
LiveboxFrame* pLiveBoxFrame = pLiveboxProvider->GetLiveboxFrame();
SysTryReturnResult(NID_APP, pLiveBoxFrame, E_SYSTEM, "Failed to GetLiveboxFrame");
}
result
-_LiveboxProviderManagerImpl::AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
+_LiveboxProviderManagerImpl::AddLivebox(const Tizen::App::AppId& 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);
_LiveboxProviderManagerImpl::ContainsLivebox(const String& instanceId) const
{
bool contains = false;
- __liveBoxes.ContainsKey(instanceId, contains);
+ __liveboxProviders.ContainsKey(instanceId, contains);
return contains;
}
SysTryReturnResult(NID_APP, pLivebox, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
pLivebox->Construct(instanceId);
- __liveBoxes.Add(instanceId, pLivebox);
+ __liveboxProviders.Add(instanceId, pLivebox);
pLivebox->OnLiveboxProviderInitializing(width, height, userInfo);
SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d, argument:%ls", instanceId.GetPointer(), width, height, argument.GetPointer() );
LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
+ __liveboxProviders.GetValue(instanceId, pLivebox);
SysTryReturnResult(NID_APP, pLivebox, E_SYSTEM, "Can't find the Livebox provider");
pLivebox->OnLiveboxProviderUpdating(argument);
SysLog(NID_APP, "instanceId(%ls), w:%d, h:%d", instanceId.GetPointer(), width, height);
LiveboxProvider* pLivebox = null;
- __liveBoxes.GetValue(instanceId, pLivebox);
+ __liveboxProviders.GetValue(instanceId, pLivebox);
SysTryReturnResult(NID_APP, pLivebox, E_SYSTEM, "Can't find the Livebox provider");
LiveboxFrame* pLiveBoxFrame = pLivebox->GetLiveboxFrame();
// __pLiveboxEventListener->OnLiveboxRemoved(instanceId);
LiveboxProvider* pLiveboxProvider = null;
- __liveBoxes.GetValue(instanceId, pLiveboxProvider);
- __liveBoxes.Remove(instanceId);
+ __liveboxProviders.GetValue(instanceId, pLiveboxProvider);
+ result r = __liveboxProviders.Remove(instanceId);
+ SysLog(NID_APP, "%s", GetErrorMessage(r) );
if( pLiveboxProvider != null)
{
delete pLiveboxProvider;
}
-// this->__pLiveboxEventListener->OnLiveboxRemoved(instanceId);
- if( terminateIfFinished && this->__liveBoxes.GetCount() == 0)
+ SysLog(NID_APP, "(%d) provider(s) remains.", __liveboxProviders.GetCount() );
+
+ if( terminateIfFinished && this->__liveboxProviders.GetCount() == 0)
{
Tizen::App::App::GetInstance()->Terminate();
}
__pLiveboxPopupProvider->OnLiveboxPopupProviderInitializing(userInfo);
LiveboxPopup* pLiveBoxFrame = pPd->GetLiveboxPopup();
- SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_OPERATION, "[E_INVALID_OPERATION]");
+ SysTryReturnResult(NID_APP, pLiveBoxFrame, E_INVALID_OPERATION, "[E_INVALID_OPERATION] LiveboxPopup should be set using LiveboxPopupProvider::SetLiveboxPopup()");
return E_SUCCESS;
}
result
_LiveboxProviderManagerImpl::RequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int& shmId)
{
- return _LiveboxManagerProxy::GetInstance()->RequestSharedMemoryId(instanceId, width, height, shmId);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->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);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->RequestSharedMemoryIdForPD(instanceId, width, height, shmId);
}
result
_LiveboxProviderManagerImpl::RequestReleaseSharedMemory(const Tizen::Base::String& instanceId)
{
- return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemory(instanceId);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->RequestReleaseSharedMemory(instanceId);
}
result
_LiveboxProviderManagerImpl::RequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId)
{
- return _LiveboxManagerProxy::GetInstance()->RequestReleaseSharedMemoryForPD(instanceId);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->RequestReleaseSharedMemoryForPD(instanceId);
}
result
_LiveboxProviderManagerImpl::RequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height)
{
- return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemory(instanceId, width, height);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->RequestSyncSharedMemory(instanceId, width, height);
}
result
_LiveboxProviderManagerImpl::RequestSyncSharedMemoryForPD(const Tizen::Base::String& instanceId)
{
- return _LiveboxManagerProxy::GetInstance()->RequestSyncSharedMemoryForPD(instanceId);
+ _LiveboxManagerProxy* pProxy = _LiveboxManagerProxy::GetInstance();
+ SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
+
+ return pProxy->RequestSyncSharedMemoryForPD(instanceId);
}
}} // Tizen::Shell
namespace Tizen { namespace Shell
{
-_LiveboxSizeInfoImpl::_LiveboxSizeInfoImpl(Dimension size, const String& previewImagePath)
+_LiveboxSizeInfoImpl::_LiveboxSizeInfoImpl(FloatDimension size, const String& previewImagePath)
{
__size = size;
__previewImagePath = previewImagePath;
}
LiveboxSizeInfo*
-_LiveboxSizeInfoImpl::CreateLiveboxSizeInfo(Tizen::Graphics::Dimension size, const Tizen::Base::String& previewImagePath)
+_LiveboxSizeInfoImpl::CreateLiveboxSizeInfo(Tizen::Graphics::FloatDimension size, const Tizen::Base::String& previewImagePath)
{
return new (std::nothrow) LiveboxSizeInfo(size, previewImagePath);
}
-Dimension
+FloatDimension
_LiveboxSizeInfoImpl::GetSize() const
{
return __size;
result SetLiveboxProviderFactory(ILiveboxProviderFactory& factory);
result SetLiveboxPopupProviderFactory(ILiveboxPopupProviderFactory& factory);
result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument);
- result AddLivebox(const Tizen::App::AppId& viewerAppId, const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo);
+ result AddLivebox(const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo);
// internal APIs
result RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument = L"");
private:
// for Livebox
ILiveboxProviderFactory* __pLiveboxFactory;
- Tizen::Base::Collection::HashMapT<Tizen::Base::String, LiveboxProvider*> __liveBoxes;
+ Tizen::Base::Collection::HashMapT<Tizen::Base::String, LiveboxProvider*> __liveboxProviders;
Tizen::Base::Collection::HashMapT<Tizen::Base::String, _ILiveboxTouchEventListener*> __touchEventListeners;
// for LiveboxPopup
#include <FBaseString.h>
#include <FBaseCol.h>
-#include <FGrpDimension.h>
+#include <FGrpFloatDimension.h>
#include <FAppTypes.h>
namespace Tizen { namespace Shell
*
* @return A size
*/
- Tizen::Graphics::Dimension GetSize() const;
+ Tizen::Graphics::FloatDimension GetSize() const;
/**
* Gets the image path for preview
*/
Tizen::Base::String GetPreviewImagePath() const;
- static LiveboxSizeInfo* CreateLiveboxSizeInfo(Tizen::Graphics::Dimension size, const Tizen::Base::String& previewImagePath);
+ static LiveboxSizeInfo* CreateLiveboxSizeInfo(Tizen::Graphics::FloatDimension size, const Tizen::Base::String& previewImagePath);
private:
/**
*
* @since 2.1
*/
- _LiveboxSizeInfoImpl(Tizen::Graphics::Dimension size, const Tizen::Base::String& previewImagePath);
+ _LiveboxSizeInfoImpl(Tizen::Graphics::FloatDimension size, const Tizen::Base::String& previewImagePath);
private:
- Tizen::Graphics::Dimension __size;
+ Tizen::Graphics::FloatDimension __size;
Tizen::Base::String __previewImagePath;
friend class LiveboxSizeInfo;