--- /dev/null
+//
+// 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 FShellTypes.h
+ * @brief This is the header file for the definitions of constants and enumerators in the %Shell namespace.
+ *
+ * This header file contains definitions for the constants and enumerators in the %Shell namespace.
+ */
+
+#ifndef _FSHELL_TYPES_H_
+#define _FSHELL_TYPES_H_
+
+namespace Tizen { namespace Shell
+{
+
+_OSP_EXPORT_ extern const wchar_t FEATURE_STRING[];
+
+}} // Tizen::Shell
+
+#endif // _FSHELL_TYPES_H_
#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FShellAppWidgetFrame.h>
+#include <FSysSystemInfo.h>
+#include <FShellTypes.h>
#include "FShell_AppWidgetFrameImpl.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.");
+
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));
- result r = GetLastResult();
- SysTryReturn(NID_SHELL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetLastResult();
+ SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_SHELL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl.release();
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.");
+
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));
- result r = GetLastResult();
- SysTryReturn(NID_SHELL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetLastResult();
+ SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_SHELL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl.release();
#include <cstdlib>
#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 <FSysSystemInfo.h>
+#include <FShellTypes.h>
#include <FApp_Types.h>
#include <FApp_AppInfo.h>
-
-
#include <FShellAppWidgetManager.h>
#include <FShellAppWidgetProviderInfo.h>
#include <FShellIAppWidgetRequestListener.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-
+using namespace Tizen::System;
namespace Tizen { namespace Shell
{
AppWidgetManager*
AppWidgetManager::GetInstance(void)
{
+ 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.");
+
static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
if (__pTheInstance == null)
{
- ClearLastResult();
pthread_once(&onceBlock, InitSingleton);
- result r = GetLastResult();
+ 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"
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.");
+
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));
- result r = GetLastResult();
- SysTryReturn(NID_SHELL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetLastResult();
+ SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_SHELL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl.release();
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.");
+
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));
- result r = GetLastResult();
- SysTryReturn(NID_SHELL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetLastResult();
+ SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(size);
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_SHELL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl.release();
*/
#include <unique_ptr.h>
-
#include <shortcut.h>
#include <livebox-service/livebox-service.h>
-
#include <FBaseSysLog.h>
#include <FBaseCol.h>
#include <FGraphics.h>
#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"
using namespace std;
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()
AppWidgetProviderManager*
AppWidgetProviderManager::GetInstance()
{
- static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
+ 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.");
+
+ static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
if (__pTheInstance == null)
{
- ClearLastResult();
pthread_once(&onceBlock, InitSingleton);
- result r = GetLastResult();
+ 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"
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.");
+
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, _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));
- result r = GetLastResult();
- SysTryReturn(NID_SHELL, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = GetLastResult();
+ SysTryReturnResult(NID_SHELL, pImpl, r, "Propagating.");
r = pImpl->Initialize(appId, providerName, rect, userInfo);
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_SHELL, r == E_SUCCESS, r, "Propagating.");
_pControlImpl = pImpl.release();