#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FShellAppWidgetFrame.h>
-#include <FSysSystemInfo.h>
-#include <FShellTypes.h>
#include "FShell_AppWidgetFrameImpl.h"
+#include "FShell_AppWidgetManagerImpl.h"
using namespace std;
using namespace Tizen::Base;
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
-using namespace Tizen::System;
namespace Tizen { namespace Shell
{
result
AppWidgetFrame::Construct(const FloatDimension& size)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
unique_ptr<_AppWidgetFrameImpl> pImpl(_AppWidgetFrameImpl::CreateAppWidgetFrameImplN(*this, null, null));
- r = GetLastResult();
+ result r = GetLastResult();
SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
result
AppWidgetFrame::Construct(const Layout& layout, const FloatDimension& size)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
unique_ptr<_AppWidgetFrameImpl> pImpl(_AppWidgetFrameImpl::CreateAppWidgetFrameImplN(*this, &layout, &layout));
- r = GetLastResult();
+ result r = GetLastResult();
SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
#include <FGraphics.h>
#include <FApp.h>
#include <FAppPkgPackageInfo.h>
-#include <FSysSystemInfo.h>
-#include <FShellTypes.h>
#include <FApp_Types.h>
#include <FApp_AppInfo.h>
#include <FShellAppWidgetManager.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::System;
namespace Tizen { namespace Shell
{
{
ClearLastResult();
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturn(NID_SHELL, !IsFailed(r) && isSupported, null, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] This operation is not supported.");
+ SysTryReturn(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), null, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] This operation is not supported.");
static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
if (__pTheInstance == null)
{
pthread_once(&onceBlock, InitSingleton);
- r = GetLastResult();
+ result r = GetLastResult();
if (IsFailed(r))
{
onceBlock = PTHREAD_ONCE_INIT;
#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FShellAppWidgetPopup.h>
-#include <FSysSystemInfo.h>
-#include <FShellTypes.h>
#include "FShell_AppWidgetPopupImpl.h"
+#include "FShell_AppWidgetManagerImpl.h"
using namespace std;
using namespace Tizen::Base;
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
-using namespace Tizen::System;
namespace Tizen { namespace Shell
{
result
AppWidgetPopup::Construct(const FloatDimension& size)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
unique_ptr<_AppWidgetPopupImpl> pImpl(_AppWidgetPopupImpl::CreateAppWidgetPopupImplN(*this, null, null));
- r = GetLastResult();
+ result r = GetLastResult();
SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
result
AppWidgetPopup::Construct(const Layout& layout, const FloatDimension& size)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
unique_ptr<_AppWidgetPopupImpl> pImpl(_AppWidgetPopupImpl::CreateAppWidgetPopupImplN(*this, &layout, &layout));
- r = GetLastResult();
+ result r = GetLastResult();
SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
#include <FShellAppWidgetProviderInfo.h>
#include <FShellIAppWidgetProviderFactory.h>
#include <FShellIAppWidgetPopupProviderFactory.h>
-#include <FSysSystemInfo.h>
#include <FApp_Types.h>
#include <FApp_AppInfo.h>
#include <FAppPkg_PackageManagerImpl.h>
#include <FBase_StringConverter.h>
#include "FShell_AppWidgetProviderManagerImpl.h"
+#include "FShell_AppWidgetManagerImpl.h"
using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::System;
namespace Tizen { namespace Shell
{
-extern const wchar_t FEATURE_STRING[] = L"http://tizen.org/feature/shell.appwidget";
-
AppWidgetProviderManager* AppWidgetProviderManager::__pTheInstance = null;
AppWidgetProviderManager::AppWidgetProviderManager()
{
ClearLastResult();
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturn(NID_SHELL, !IsFailed(r) && isSupported, null, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] This operation is not supported.");
+ SysTryReturn(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), null, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] This operation is not supported.");
static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
if (__pTheInstance == null)
{
pthread_once(&onceBlock, InitSingleton);
- r = GetLastResult();
+ result r = GetLastResult();
if (IsFailed(r))
{
onceBlock = PTHREAD_ONCE_INIT;
#include <FBaseString.h>
#include <FGrpPoint.h>
#include <FShellAppWidgetView.h>
-#include <FShellTypes.h>
-#include <FSysSystemInfo.h>
#include <FApp_Aul.h>
#include "FShell_AppWidgetViewImpl.h"
+#include "FShell_AppWidgetManagerImpl.h"
using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Graphics;
-using namespace Tizen::System;
namespace Tizen { namespace Shell
{
result
AppWidgetView::Construct(const AppId& appId, const String& providerName, const FloatRectangle& rect)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
return Construct(appId, providerName, rect, L"");
}
result
AppWidgetView::Construct(const AppId& appId, const String& providerName, const FloatRectangle& rect, const String& userInfo)
{
- bool isSupported = false;
- result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
- SysTryReturnResult(NID_SHELL, !IsFailed(r) && isSupported, E_UNSUPPORTED_OPERATION, "This operation is not supported.");
-
+ SysTryReturnResult(NID_SHELL, _AppWidgetManagerImpl::HasFeature(), E_UNSUPPORTED_OPERATION, "This operation is not supported.");
SysTryReturnResult(NID_SHELL, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application is not installed.");
SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
unique_ptr<_AppWidgetViewImpl> pImpl(_AppWidgetViewImpl::CreateAppWidgetViewImplN(*this));
- r = GetLastResult();
+ result r = GetLastResult();
SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(appId, providerName, rect, userInfo);
#include <FBase.h>
#include <FApp.h>
#include <FGrpDimension.h>
+#include <FSysSystemInfo.h>
+#include <FShellTypes.h>
#include <FApp_AppImpl.h>
#include <FBase_StringConverter.h>
#include <FAppPkg_PackageManagerImpl.h>
using namespace Tizen::Base::Collection;
using namespace Tizen::App;
using namespace Tizen::Graphics;
+using namespace Tizen::System;
+
+extern const wchar_t FEATURE_STRING[] = L"http://tizen.org/feature/shell.appwidget";
_AppWidgetManagerImpl::_AppWidgetManagerImpl()
:__pAppWidgetRequestEventListener(null)
return providerId;
}
+bool
+_AppWidgetManagerImpl::HasFeature(void)
+{
+ static bool isChecked = false;
+ static bool isSupported = false;
+
+ if (!isChecked)
+ {
+ result r = SystemInfo::GetValue(FEATURE_STRING, isSupported);
+ SysTryReturn(NID_SHELL, !IsFailed(r), false, E_UNSUPPORTED_OPERATION, "[E_UNSUPPORTED_OPERATION] This operation is not supported.");
+
+ isChecked = true;
+ SysLog(NID_SHELL, "HasFeature is called[%d]", isChecked);
+ }
+
+ return isSupported;
+}
+
+
}} // Tizen::Shell
static result ExtractAppIdAndProviderName(const Tizen::Base::String& providerId, Tizen::App::AppId& appId, Tizen::Base::String& providerName);
static Tizen::Base::String MakeProviderName(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+ static bool HasFeature(void);
+
private:
_AppWidgetManagerImpl();
virtual ~_AppWidgetManagerImpl();