Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.27
+Version: 0.4.28
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
PKG_CHECK_MODULES(platform_pkgs_alarm REQUIRED capi-appfw-application)
+ADD_DEFINITIONS("-fvisibility=hidden")
+
INCLUDE_DIRECTORIES(
${platform_pkgs_alarm_INCLUDE_DIRS}
${INCLUDE_COMMON}
#include "plugin_config.h"
#include "JSAlarmAbsolute.h"
#include "JSAlarmManager.h"
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-const JSClassRef JSAlarmAbsolute::getClassRef()
+const JSClassRef DLL_EXPORT JSAlarmAbsolute::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_jsClassInfo);
return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
}
-JSObjectRef JSAlarmAbsolute::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+JSObjectRef DLL_EXPORT JSAlarmAbsolute::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
try {
AlarmAbsolutePtr priv = AlarmAbsolutePtr(new AlarmAbsolute());
#include "JSAlarmManager.h"
#include <TimeTracer.h>
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-const JSClassRef JSAlarmManager::getClassRef()
+const JSClassRef DLL_EXPORT JSAlarmManager::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_jsClassInfo);
#include <app.h>
#include <time.h>
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-const JSClassRef JSAlarmRelative::getClassRef()
+const JSClassRef DLL_EXPORT JSAlarmRelative::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_jsClassInfo);
return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
}
-JSObjectRef JSAlarmRelative::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+JSObjectRef DLL_EXPORT JSAlarmRelative::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
try {
ArgumentValidator validator(ctx, argumentCount, arguments);
static FunctionMapping AlarmFunctions =
createAlarmFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Alarm, AlarmFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createAlarmFunctions()
{
/**
//
#include "AppManagerWrapper.h"
-#include <dpl/singleton_impl.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include <Logger.h>
-IMPLEMENT_SINGLETON(DeviceAPI::Application::AppManagerWrapper)
-
namespace DeviceAPI {
namespace Application {
return true;
}
-
+SINGLETON_IMPLEMENTATION(AppManagerWrapper)
} // Application
} // DeviceAPI
#include <map>
#include <set>
#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
#include <app_manager.h>
#include <package-manager.h>
// To get app size and installed time
#include <pkgmgr-info.h>
+#include <Singleton.h>
+
namespace DeviceAPI {
namespace Application {
virtual void onAppManagerEventUpdated(const char *appId) = 0;
};
-class AppManagerWrapper
+class DLL_EXPORT AppManagerWrapper
{
public:
AppManagerWrapper();
std::vector<std::string> applist;
public:
- friend class DPL::Singleton<AppManagerWrapper>;
+ friend class AppManagerWrapperSingleton;
};
-typedef DPL::Singleton<AppManagerWrapper> AppManagerWrapperSingleton;
+SINGLETON_DEFINITION(AppManagerWrapper)
+
} // Application
} // DeviceAPI
#include "ApplicationAsyncCallbackManager.h"
-#include <dpl/singleton_impl.h>
-
-using namespace DPL;
-
-IMPLEMENT_SINGLETON(DeviceAPI::Application::ApplicationAsyncCallbackManager)
namespace DeviceAPI {
namespace Application {
+SINGLETON_IMPLEMENTATION(ApplicationAsyncCallbackManager)
+
} // Application
} // DeviceAPI
#ifndef _TIZEN_APPLICATION_ASYNC_CALLBACK_MANAGER_H_
#define _TIZEN_APPLICATION_ASYNC_CALLBACK_MANAGER_H_
-#include <dpl/singleton.h>
#include <AsyncCallbackManager.h>
namespace DeviceAPI {
class ApplicationAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackManager
{
-public:
+private:
ApplicationAsyncCallbackManager()
{
}
+public:
virtual ~ApplicationAsyncCallbackManager()
{
}
- friend class DPL::Singleton<ApplicationAsyncCallbackManager>;
+ friend class ApplicationAsyncCallbackManagerSingleton;
};
-typedef DPL::Singleton<ApplicationAsyncCallbackManager> ApplicationAsyncCallbackManagerSingleton;
+SINGLETON_DEFINITION(ApplicationAsyncCallbackManager)
} // Application
} // DeviceAPI
#include <dpl/shared_ptr.h>
#include <app_service.h>
#include "ApplicationControlData.h"
+#include <Export.h>
namespace DeviceAPI {
namespace Application {
typedef DPL::SharedPtr<ApplicationControl> ApplicationControlPtr;
/* This object represents a single extra data for service request and reply */
-class ApplicationControl
+class DLL_EXPORT ApplicationControl
{
public:
ApplicationControl();
#include <string>
#include <vector>
#include <dpl/shared_ptr.h>
+#include <Export.h>
namespace DeviceAPI {
namespace Application {
typedef DPL::SharedPtr<ApplicationControlDataArray> ApplicationControlDataArrayPtr;
/* This object represents a single extra data for app control request and reply */
-class ApplicationControlData
+class DLL_EXPORT ApplicationControlData
{
public:
ApplicationControlData();
#include "ApplicationControlData.h"
#include "ApplicationControl.h"
#include "ApplicationCert.h"
+#include <Export.h>
namespace DeviceAPI {
namespace Application {
-class ApplicationConverter : public WrtDeviceApis::CommonsJavaScript::Converter
+class DLL_EXPORT ApplicationConverter : public WrtDeviceApis::CommonsJavaScript::Converter
{
public:
using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
//
#include "ApplicationListenerManager.h"
-#include <dpl/singleton_impl.h>
-
-using namespace DPL;
-
-IMPLEMENT_SINGLETON(DeviceAPI::Application::ApplicationListenerManager)
namespace DeviceAPI {
namespace Application {
+SINGLETON_IMPLEMENTATION(ApplicationListenerManager)
+
} // Application
} // DeviceAPI
#include <map>
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSApplicationManager.h"
#include "ApplicationController.h"
class ApplicationListenerManager : public DeviceAPI::Common::IListenerController
{
-public:
+private:
ApplicationListenerManager()
{
}
+public:
virtual ~ApplicationListenerManager()
{
}
+
+ friend class ApplicationListenerManagerSingleton;
};
-typedef DPL::Singleton<ApplicationListenerManager> ApplicationListenerManagerSingleton;
+
+SINGLETON_DEFINITION(ApplicationListenerManager)
class ApplicationListenerCanceller : public DeviceAPI::Common::IListenerItem
{
pkgmgr-info
)
+ADD_DEFINITIONS("-fvisibility=hidden")
+
INCLUDE_DIRECTORIES(
${INCLUDE_COMMON}
${TOP}/Application
#include "JSApplication.h"
#include <TimeTracer.h>
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
};
-JSClassRef JSApplication::getClassRef() {
+JSClassRef DLL_EXPORT JSApplication::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ApplicationCert.h"
#include "JSApplicationCert.h"
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-JSClassRef JSApplicationCert::getClassRef() {
+JSClassRef DLL_EXPORT JSApplicationCert::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
//#include <JSTizenException.h>
#include "ApplicationContext.h"
#include "JSApplicationContext.h"
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-JSClassRef JSApplicationContext::getClassRef() {
+JSClassRef DLL_EXPORT JSApplicationContext::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include <SecurityExceptions.h>
#include <JSWebAPIException.h>
#include <ArgumentValidator.h>
+#include <Export.h>
//#include <Commons/Exception.h>
//#include <JSTizenExceptionFactory.h>
return &m_classInfo;
}
-const JSClassRef JSApplicationControl::getClassRef()
+const JSClassRef DLL_EXPORT JSApplicationControl::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
-ApplicationControlPtr JSApplicationControl::getApplicationControl(JSContextRef context, JSValueRef value)
+ApplicationControlPtr DLL_EXPORT JSApplicationControl::getApplicationControl(JSContextRef context, JSValueRef value)
{
if (!isObjectOfClass(context, value)) {
throw TypeMismatchException("is not a object class");
delete priv;
}
-JSObjectRef JSApplicationControl::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSApplicationControl::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
//#include <JSTizenExceptionFactory.h>
//#include <JSTizenException.h>
#include <JSUtil.h>
+#include <Export.h>
#include "JSApplicationControlData.h"
#include "ApplicationConverter.h"
#include "ApplicationUtil.h"
{ 0, 0, 0 }
};
-JSClassRef JSApplicationControlData::getClassRef() {
+JSClassRef DLL_EXPORT JSApplicationControlData::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
return JSObjectMake(context, getClassRef(), priv);
}
-JSObjectRef JSApplicationControlData::constructor(JSContextRef context, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+JSObjectRef DLL_EXPORT JSApplicationControlData::constructor(JSContextRef context, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
try {
ArgumentValidator validator(context, argumentCount, arguments);
#include "ApplicationInformation.h"
#include "JSApplicationInformation.h"
#include "AppManagerWrapper.h"
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0, 0 }
};
-JSClassRef JSApplicationInformation::getClassRef() {
+JSClassRef DLL_EXPORT JSApplicationInformation::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "JSApplication.h"
#include <TimeTracer.h>
+#include <Export.h>
#include <Logger.h>
namespace DeviceAPI {
{ 0, 0, 0 }
};
-const JSClassRef JSApplicationManager::getClassRef()
+const JSClassRef DLL_EXPORT JSApplicationManager::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
#include "ApplicationConverter.h"
#include "ApplicationUtil.h"
#include "JSRequestedApplicationControl.h"
+#include <Export.h>
#include <Logger.h>
using namespace WrtDeviceApis::Commons;
return &m_classInfo;
}
-JSClassRef JSRequestedApplicationControl::getClassRef()
+JSClassRef DLL_EXPORT JSRequestedApplicationControl::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
static FunctionMapping ApplicationFunctions =
createApplicationFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Application, ApplicationFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createApplicationFunctions()
{
/**
static FunctionMapping createBluetoothFunctions();
static FunctionMapping BluetoothFunctions = createBluetoothFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Bluetooth, BluetoothFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createBluetoothFunctions()
{
/**
static WrtDeviceApis::Commons::FunctionMapping bookmarkFunctions =
createBookmarkFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Bookmark, bookmarkFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createBookmarkFunctions()
{
using namespace WrtDeviceApis::Commons;
PKG_CHECK_MODULES(platform_pkgs_calendar REQUIRED calendar-service2 icu-i18n)
+ADD_DEFINITIONS("-fvisibility=hidden")
+
INCLUDE_DIRECTORIES(
${TOP}/Tizen
${TOP}/TimeUtil
#include "CalendarAsyncCallbackManager.h"
-#include <dpl/singleton_impl.h>
-IMPLEMENT_SINGLETON(DeviceAPI::Calendar::CalendarAsyncCallbackManager)
+namespace DeviceAPI {
+namespace Calendar {
+SINGLETON_IMPLEMENTATION(CalendarAsyncCallbackManager)
+
+} // Calendar
+} // DeviceAPI
#ifndef _TIZEN_CALENDAR_ASYNC_CALLBACK_MANAGER_H_
#define _TIZEN_CALENDAR_ASYNC_CALLBACK_MANAGER_H_
-#include <dpl/singleton.h>
#include <AsyncCallbackManager.h>
namespace DeviceAPI {
class CalendarAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackManager
{
-public:
+private:
CalendarAsyncCallbackManager()
{
}
+public:
virtual ~CalendarAsyncCallbackManager()
{
}
- friend class DPL::Singleton<CalendarAsyncCallbackManager>;
+ friend class CalendarAsyncCallbackManagerSingleton;
};
-typedef DPL::Singleton<CalendarAsyncCallbackManager> CalendarAsyncCallbackManagerSingleton;
+SINGLETON_DEFINITION(CalendarAsyncCallbackManager)
} // Calendar
} // DeviceAPI
-#endif // _TIZEN_CALENDAR_ASYNC_CALLBACK_MANAGER_H_
\ No newline at end of file
+#endif // _TIZEN_CALENDAR_ASYNC_CALLBACK_MANAGER_H_
#include "CalendarListenerManager.h"
-#include <dpl/singleton_impl.h>
-IMPLEMENT_SINGLETON(DeviceAPI::Calendar::CalendarListenerManager)
+namespace DeviceAPI {
+namespace Calendar {
+SINGLETON_IMPLEMENTATION(CalendarListenerManager)
+
+} // Calendar
+} // DeviceAPI
#include <map>
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "CalendarResponseDispatcher.h"
#include "JSCalendar.h"
namespace DeviceAPI {
namespace Calendar {
-
-
class CalendarListenerManager : public DeviceAPI::Common::IListenerController
{
-public:
+private:
CalendarListenerManager()
{
}
+public:
virtual ~CalendarListenerManager()
{
}
+
+ friend class CalendarListenerManagerSingleton;
};
-typedef DPL::Singleton<CalendarListenerManager> CalendarListenerManagerSingleton;
+
+SINGLETON_DEFINITION(CalendarListenerManager)
class CalendarListenerCanceller : public DeviceAPI::Common::IListenerItem
{
#include <SecurityExceptions.h>
#include <TimeUtilConverter.h>
#include <TimeTracer.h>
+#include <Logger.h>
+#include <Export.h>
#include "JSCalendarManager.h"
#include "CalendarConverter.h"
#include "CalendarAsyncCallbackManager.h"
#include "CalendarListenerManager.h"
-#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
}
-const JSClassRef JSCalendar::getClassRef()
+const JSClassRef DLL_EXPORT JSCalendar::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
#include <JSTZDate.h>
#include <JSTimeDuration.h>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
return &(m_classInfo);
}
-JSClassRef JSCalendarAlarm::getClassRef()
+JSClassRef DLL_EXPORT JSCalendarAlarm::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
-JSObjectRef JSCalendarAlarm::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarAlarm::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
#include <DurationProperties.h>
#include <ContactRef.h>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
return &(m_classInfo);
}
-JSClassRef JSCalendarAttendee::getClassRef()
+JSClassRef DLL_EXPORT JSCalendarAttendee::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
-JSObjectRef JSCalendarAttendee::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarAttendee::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
#include <GlobalContextManager.h>
#include <TimeTracer.h>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
}
-JSObjectRef JSCalendarEvent::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarEvent::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
return JSObjectMake(context, getClassRef(), priv);
}
-const JSClassRef JSCalendarEvent::getClassRef()
+const JSClassRef DLL_EXPORT JSCalendarEvent::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
#include <JSTZDate.h>
#include <sstream>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
return &(m_classInfo);
}
-JSClassRef JSCalendarEventId::getClassRef()
+JSClassRef DLL_EXPORT JSCalendarEventId::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
-JSObjectRef JSCalendarEventId::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarEventId::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
#include <JSTizenExceptionFactory.h>
#include <SecurityExceptions.h>
#include <TimeTracer.h>
+#include <Export.h>
#include "JSCalendarManager.h"
#include "JSCalendar.h"
}
}
-const JSClassRef JSCalendarManager::getClassRef()
+const JSClassRef DLL_EXPORT JSCalendarManager::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
#include <JSTZDate.h>
#include <GlobalContextManager.h>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
return &(m_classInfo);
}
-JSClassRef JSCalendarRecurrenceRule::getClassRef()
+JSClassRef DLL_EXPORT JSCalendarRecurrenceRule::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
-JSObjectRef JSCalendarRecurrenceRule::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarRecurrenceRule::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
#include <JSTizenExceptionFactory.h>
#include <GlobalContextManager.h>
#include <Logger.h>
+#include <Export.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
}
-JSObjectRef JSCalendarTask::constructor(JSContextRef context,
+JSObjectRef DLL_EXPORT JSCalendarTask::constructor(JSContextRef context,
JSObjectRef constructor,
size_t argumentCount,
const JSValueRef arguments[],
return JSObjectMake(context, getClassRef(), priv);
}
-const JSClassRef JSCalendarTask::getClassRef()
+const JSClassRef DLL_EXPORT JSCalendarTask::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
static FunctionMapping CalendarFunctions = createCalendarFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Calendar, CalendarFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createCalendarFunctions()
{
/**
static WrtDeviceApis::Commons::FunctionMapping CallHistoryFunctions = createCallHistoryFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(CallHistory, CallHistoryFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createCallHistoryFunctions()
{
using namespace WrtDeviceApis::Commons;
#include <dpl/shared_ptr.h>
#include <dpl/type_list.h>
#include <CommonsJavaScript/JSCallbackManager.h>
+#include "Singleton.h"
+#include "Export.h"
#include "Logger.h"
namespace DeviceAPI {
};
} // Common
-}// DeviceAPI
+} // DeviceAPI
#endif // _TIZEN_COMMONS_ASYNC_CALLBACK_MANAGER_H_
//
// Tizen Web Device API
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+// Copyright (c) 2013 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.
// limitations under the License.
//
+#ifndef __TIZEN_EXPORT_H__
+#define __TIZEN_EXPORT_H__
-#include "DataSyncListenerManager.h"
-#include <dpl/singleton_impl.h>
-
-IMPLEMENT_SINGLETON(DeviceAPI::DataSync::DataSyncListenerManager)
+#if defined(__GNUC__) && __GNUC__ >= 4
+ #define DLL_EXPORT __attribute__((visibility("default")))
+ #define DLL_LOCAL __attribute__((visibility("hidden")))
+#else
+ #define DLL_EXPORT
+ #define DLL_LOCAL
+#endif
+#endif // __TIZEN_EXPORT_H__
#include <map>
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
+#include "Singleton.h"
+#include "Export.h"
#include "Logger.h"
namespace DeviceAPI {
};
} // Common
-}// DeviceAPI
+} // DeviceAPI
#endif // _TIZEN_COMMONS_ILISTENER_MANAGER_H_
--- /dev/null
+//
+// Tizen Web Device API
+// 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 Singleton.h
+ * @author Kisub Song (kisubs.song@samsung.com)
+ * @version 0.1
+ * @brief
+ */
+
+#include <Export.h>
+
+#ifndef _TIZEN_COMMONS_SINGLETON_H_
+#define _TIZEN_COMMONS_SINGLETON_H_
+
+#define SINGLETON_DEFINITION(CLASSNAME) \
+ class DLL_EXPORT CLASSNAME##Singleton : private CLASSNAME { \
+ private: \
+ CLASSNAME##Singleton() {} \
+ static CLASSNAME##Singleton &InternalInstance(); \
+ public: \
+ virtual ~CLASSNAME##Singleton() {} \
+ static CLASSNAME &Instance(); \
+ };
+
+#define SINGLETON_IMPLEMENTATION(CLASSNAME) \
+ CLASSNAME##Singleton& CLASSNAME##Singleton::InternalInstance() { \
+ static CLASSNAME##Singleton instance; \
+ return instance; \
+ } \
+ CLASSNAME& CLASSNAME##Singleton::Instance() { \
+ CLASSNAME##Singleton& instance = CLASSNAME##Singleton::InternalInstance(); \
+ return instance; \
+ }
+
+#endif // _TIZEN_COMMONS_SINGLETON_H_
#include <vector>
#include <iostream>
#include <termios.h>
+#include <JSUtil.h>
#undef LOG_TAG
#define LOG_TAG "TIZEN_DEVICEAPI"
JSValueRef StandaloneConsole::RunLineEx(const char* line, JSValueRef *exception){
JSStringRef jsScript = JSStringCreateWithUTF8CString(line);
+ int size = strlen(line);
+ if( size != JSStringGetLength(jsScript) ){
+ cout <<"error - fail to converting JSStringRef"<<endl;
+ }
JSValueRef ret = JSEvaluateScript(mGlobalContext, jsScript, NULL, NULL, 0, exception);
JSStringRelease(jsScript);
return ret;
if( length > 0 )
{
- char buff[length];
- memset(buff, 0, length);
+ char buff[length+1];
+ memset(buff, 0, length+1);
int r = fread(buff, 1, length, f);
fclose(f);
PKG_CHECK_MODULES(platform_pkgs_contact REQUIRED contacts-service2 libpcrecpp)
+ADD_DEFINITIONS("-fvisibility=hidden")
+
INCLUDE_DIRECTORIES(
${TOP}/Tizen
${INCLUDE_COMMON}
*/
#include "ContactAsyncCallbackManager.h"
-#include <dpl/singleton_impl.h>
-
-using namespace DPL;
-
-IMPLEMENT_SINGLETON(DeviceAPI::Contact::ContactAsyncCallbackManager)
namespace DeviceAPI {
namespace Contact {
+SINGLETON_IMPLEMENTATION(ContactAsyncCallbackManager)
+
} // Contact
} // DeviceAPI
#ifndef _TIZEN_CONTACT_ASYNC_CALLBACK_MANAGER_H_
#define _TIZEN_CONTACT_ASYNC_CALLBACK_MANAGER_H_
-#include <dpl/singleton.h>
#include <AsyncCallbackManager.h>
namespace DeviceAPI {
class ContactAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackManager
{
-public:
+private:
ContactAsyncCallbackManager()
{
}
+public:
virtual ~ContactAsyncCallbackManager()
{
}
- friend class DPL::Singleton<ContactAsyncCallbackManager>;
+ friend class ContactAsyncCallbackManagerSingleton;
};
-typedef DPL::Singleton<ContactAsyncCallbackManager> ContactAsyncCallbackManagerSingleton;
+SINGLETON_DEFINITION(ContactAsyncCallbackManager)
} // Contact
} // DeviceAPI
#include <ArgumentValidator.h>
#include <JSWebAPIError.h>
#include <JSUtil.h>
+#include <Export.h>
namespace DeviceAPI {
namespace Contact {
-class ContactConverter : public WrtDeviceApis::CommonsJavaScript::Converter
+class DLL_EXPORT ContactConverter : public WrtDeviceApis::CommonsJavaScript::Converter
{
public:
using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
*/
#include "ContactListenerManager.h"
-#include <dpl/singleton_impl.h>
-
-using namespace DPL;
-
-IMPLEMENT_SINGLETON(DeviceAPI::Contact::ContactListenerManager)
namespace DeviceAPI {
namespace Contact {
+SINGLETON_IMPLEMENTATION(ContactListenerManager)
+
} // Contact
} // DeviceAPI
#include <map>
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "AddressBookController.h"
#include "ContactManagerController.h"
namespace DeviceAPI {
namespace Contact {
-
class ContactListenerManager : public DeviceAPI::Common::IListenerController
{
-public:
+private:
ContactListenerManager()
{
}
+public:
virtual ~ContactListenerManager()
{
}
+
+ friend class ContactListenerManagerSingleton;
};
-typedef DPL::Singleton<ContactListenerManager> ContactListenerManagerSingleton;
+
+SINGLETON_DEFINITION(ContactListenerManager)
+
class ContactsChangeListenerCanceller : public DeviceAPI::Common::IListenerItem
{
#include <string>
#include <vector>
#include <dpl/shared_ptr.h>
+#include <Export.h>
namespace DeviceAPI {
namespace Contact {
-class ContactRef;
+class DLL_EXPORT ContactRef;
typedef DPL::SharedPtr<ContactRef> ContactRefPtr;
typedef std::vector<ContactRefPtr> ContactRefArray;
typedef DPL::SharedPtr<ContactRefArray> ContactRefArrayPtr;
-class ContactRef
+class DLL_EXPORT ContactRef
{
public:
ContactRef();
#include <JSWebAPIError.h>
#include <TimeTracer.h>
#include <Logger.h>
+#include <Export.h>
#define FILTER_CLASS_NAME "Contact"
JSClassRef JSContact::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContact::getClassRef() {
+JSClassRef DLL_EXPORT JSContact::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ContactConverter.h"
#include "JSContactAddress.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "ContactAddress"
JSClassRef JSContactAddress::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactAddress::getClassRef() {
+JSClassRef DLL_EXPORT JSContactAddress::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ContactConverter.h"
#include "JSContactAnniversary.h"
#include <Logger.h>
+#include <Export.h>
#define FILTER_CLASS_NAME "Anniversary"
#define CONTACT_ATTR_DATE "date"
JSClassRef JSContactAnniversary::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactAnniversary::getClassRef() {
+JSClassRef DLL_EXPORT JSContactAnniversary::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ContactConverter.h"
#include "JSContactEmailAddress.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "EmailAddress"
JSClassRef JSContactEmailAddress::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactEmailAddress::getClassRef() {
+JSClassRef DLL_EXPORT JSContactEmailAddress::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include <JSTizenException.h>
#include "ContactConverter.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "ContactGroup"
#define CONTACT_PROP_ATTR_ID "id"
JSClassRef JSContactGroup::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactGroup::getClassRef()
+JSClassRef DLL_EXPORT JSContactGroup::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include <JSWebAPIError.h>
#include <TimeTracer.h>
#include <Logger.h>
+#include <Export.h>
namespace DeviceAPI {
namespace Contact {
{ 0, 0, 0 }
};
-JSClassRef JSContactManager::getClassRef()
+JSClassRef DLL_EXPORT JSContactManager::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include "ContactConverter.h"
#include "JSContactName.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "ContactName"
#define CONTACT_PROP_ATTR_PREFIX "prefix"
JSClassRef JSContactName::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactName::getClassRef()
+JSClassRef DLL_EXPORT JSContactName::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include <JSTizenException.h>
#include "ContactConverter.h"
#include <Logger.h>
+#include <Export.h>
#define ORGANIZATION_CLASS_NAME "ContactOrganization"
JSClassRef JSContactOrganization::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactOrganization::getClassRef() {
+JSClassRef DLL_EXPORT JSContactOrganization::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ContactConverter.h"
#include "JSContactPhoneNumber.h"
#include <Logger.h>
+#include <Export.h>
#define FILTER_CLASS_NAME "ContactPhoneNumber"
JSClassRef JSContactPhoneNumber::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactPhoneNumber::getClassRef() {
+JSClassRef DLL_EXPORT JSContactPhoneNumber::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include "ContactConverter.h"
#include "JSContactRef.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "ContactRef"
#define CONTACT_PROP_ATTR_ADDRESS_BOOK_ID "addressBookId"
JSClassRef JSContactRef::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactRef::getClassRef()
+JSClassRef DLL_EXPORT JSContactRef::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include "ContactConverter.h"
#include "JSContactWebSite.h"
#include <Logger.h>
+#include <Export.h>
#define CONTACT_CLASS_NAME "ContactWebSite"
JSClassRef JSContactWebSite::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSContactWebSite::getClassRef() {
+JSClassRef DLL_EXPORT JSContactWebSite::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
#include <JSWebAPIError.h>
#include <TimeTracer.h>
#include <Logger.h>
+#include <Export.h>
#define FILTER_CLASS_NAME "Person"
JSClassRef JSPerson::m_classRef = JSClassCreate(&m_classInfo);
-JSClassRef JSPerson::getClassRef() {
+JSClassRef DLL_EXPORT JSPerson::getClassRef() {
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
}
static FunctionMapping ContactFunctions =
createContactFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Contact, ContactFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createContactFunctions()
{
/**
static FunctionMapping ContentFunctions = createContentFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Content, ContentFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createContentFunctions()
{
/**
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(DataControl, DataConrolFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createDataConrolFunctions()
{
DataSyncManager.cpp
DataSyncConverter.cpp
DataSyncResponseDispatcher.cpp
- DataSyncListenerManager.cpp
JSSyncInfo.cpp
JSSyncStatistics.cpp
JSSyncProfileInfo.cpp
+++ /dev/null
-//
-// Tizen Web Device API
-// 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.
-//
-
-
-#ifndef _TIZEN_DATASYNC_LISTENER_MANAGER_H_
-#define _TIZEN_DATASYNC_LISTENER_MANAGER_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
-#include <IListenerManager.h>
-#include "DataSyncResponseDispatcher.h"
-#include "JSDataSyncManager.h"
-#include "IDataSyncManager.h"
-#include <sstream>
-#include <Logger.h>
-
-namespace DeviceAPI {
-namespace DataSync {
-
-class DataSyncListenerManager : public DeviceAPI::Common::IListenerController
-{
- public:
- DataSyncListenerManager()
- {
- }
-
- virtual ~DataSyncListenerManager()
- {
- }
-};
-typedef DPL::Singleton<DataSyncListenerManager> DataSyncListenerManagerSingleton;
-
-class DataSyncListenerCanceller : public DeviceAPI::Common::IListenerItem
-{
- public:
- DataSyncListenerCanceller(JSContextRef context, JSObjectRef object, long watchId) :
- DeviceAPI::Common::IListenerItem(context, object, watchId)
- {
- }
-
- virtual ~DataSyncListenerCanceller()
- {
- }
-
- virtual void cancelListener()
- {
- DataSyncManagerPrivObject *privateObject = static_cast<DataSyncManagerPrivObject*>(JSObjectGetPrivate(m_object));
- if (!privateObject) {
- LoggerW("Object is null.");
- return;
- }
-
- IDataSyncManagerPtr datasyncManager = privateObject->getObject();
-
- Try {
- LoggerD("Remove change listeners for datasync operation with id: "<<m_watchId);
- IEventStopSyncPtr dplEvent(new IEventStopSync());
- std::stringstream ss;
- ss<<m_watchId;
- dplEvent->setProfileId(std::string(ss.str()));
- dplEvent->setForSynchronousCall();
- datasyncManager->stopSync(dplEvent);
- } Catch(WrtDeviceApis::Commons::Exception) {
- LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
- }
- }
-};
-typedef DPL::SharedPtr<DataSyncListenerCanceller> DataSyncListenerCancellerPtr;
-
-}
-}
-
-#endif // _TIZEN_DATASYNC_LISTENER_MANAGER_H_
\ No newline at end of file
// limitations under the License.
//
+
#include "DataSyncResponseDispatcher.h"
#include "DataSyncConverter.h"
#include "DataSyncMultiCallback.h"
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <Logger.h>
+#include <GlobalContextManager.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
Try
- {
+ {
JSContextRef context = multiCallbacks->getOnProgress()->getContext();
+ if( !GlobalContextManager::getInstance()->isAliveGlobalContext(context)){
+ LoggerW("Global context invalidated.");
+ return;
+ }
+
if (event->getResult()) {
DataSyncConverter converter(context);
JSValueRef profileId = converter.toJSValueRef(event->getProfileId());
// limitations under the License.
//
+
#include <string>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include "plugin_config.h"
#include "DataSyncResponseDispatcher.h"
#include "DataSyncMultiCallback.h"
-#include "DataSyncListenerManager.h"
#include <Logger.h>
+#include <GlobalContextManager.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
IDataSyncManagerPtr datasyncManager = privateObject->getObject();
- JSContextRef globalContext = privateObject->getContext();
+ JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
DataSyncConverter converter(context);
if (dplEvent->getResult()) {
if(dplEvent->getEmitter()) {
LoggerD("watcherId: "<<profileId.at(0));
- DataSyncListenerCancellerPtr canceller = DataSyncListenerCancellerPtr(new DataSyncListenerCanceller(globalContext, thisObject, profileId.at(0)));
- IListenerItemPtr listenerItem = DPL::StaticPointerCast<IListenerItem>(canceller);
- DataSyncListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
}
LoggerD("Starting the sync succeeded.");
static FunctionMapping DataSyncFunctions = createDataSyncFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(DataSync, DataSyncFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createDataSyncFunctions()
{
/**
// limitations under the License.
//
+
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSSyncInfo.h"
#include "JSSyncServiceInfo.h"
#include "JSSyncProfileInfo.h"
-#include "DataSyncListenerManager.h"
#include <Logger.h>
+#include <GlobalContextManager.h>
namespace Options{
class_definition_options_t DataSyncOptions =
void on_frame_load_callback(const void * context)
{
LoggerD("[Tizen\\DataSync] on_frame_load_callback (" << context << ")");
+ DeviceAPI::Common::GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
LoggerD("[Tizen\\DataSync] on_frame_unload_callback (" << context << ")");
-
- DataSyncListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
+ DeviceAPI::Common::GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
PLUGIN_ON_WIDGET_START(on_widget_start_callback)
static FunctionMapping DownloadFunctions =
createDownloadFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Download, DownloadFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createDownloadFunctions()
{
/**
PKG_CHECK_MODULES(platform_pkgs_filesystem REQUIRED capi-appfw-application libpcrecpp ecore)
+ADD_DEFINITIONS("-fvisibility=hidden")
+
INCLUDE_DIRECTORIES(
${INCLUDE_COMMON}
${platform_pkgs_filesystem_INCLUDE_DIRS}
//
#include "FilesystemAsyncCallbackManager.h"
-#include <dpl/singleton_impl.h>
-using namespace DPL;
+namespace DeviceAPI {
+namespace Filesystem {
-IMPLEMENT_SINGLETON(DeviceAPI::Filesystem::FilesystemAsyncCallbackManager)
+SINGLETON_IMPLEMENTATION(FilesystemAsyncCallbackManager)
+
+}
+}
#ifndef _TIZEN_FILESYSTEM_ASYNC_CALLBACK_MANAGER_H_
#define _TIZEN_FILESYSTEM_ASYNC_CALLBACK_MANAGER_H_
-#include <dpl/singleton.h>
#include <AsyncCallbackManager.h>
namespace DeviceAPI {
class FilesystemAsyncCallbackManager : public DeviceAPI::Common::AsyncCallbackManager
{
-public:
+private:
FilesystemAsyncCallbackManager()
{
}
+public:
virtual ~FilesystemAsyncCallbackManager()
{
}
- friend class DPL::Singleton<FilesystemAsyncCallbackManager>;
+ friend class FilesystemAsyncCallbackManagerSingleton;
};
-typedef DPL::Singleton<FilesystemAsyncCallbackManager> FilesystemAsyncCallbackManagerSingleton;
+SINGLETON_DEFINITION(FilesystemAsyncCallbackManager)
} // Tizen1_0
} // TizenApis
//
#include "FilesystemListenerManager.h"
-#include <dpl/singleton_impl.h>
-using namespace DPL;
+namespace DeviceAPI {
+namespace Filesystem {
-IMPLEMENT_SINGLETON(DeviceAPI::Filesystem::FilesystemListenerManager)
+SINGLETON_IMPLEMENTATION(FilesystemListenerManager)
+
+}
+}
#include <map>
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
-#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "IManager.h"
#include "StorageStaticController.h"
class FilesystemListenerManager : public DeviceAPI::Common::IListenerController
{
-public:
+private:
FilesystemListenerManager()
{
}
+public:
virtual ~FilesystemListenerManager()
{
}
+
+ friend class FilesystemListenerManagerSingleton;
};
-typedef DPL::Singleton<FilesystemListenerManager> FilesystemListenerManagerSingleton;
+SINGLETON_DEFINITION(FilesystemListenerManager)
class FilesystemListenerCanceller : public DeviceAPI::Common::IListenerItem
{
#include <WidgetDB/WidgetDBMgr.h>
#include <iconv.h>
#include "FilesystemUtils.h"
+#include <Export.h>
#include <Logger.h>
using namespace WrtDeviceApis;
namespace DeviceAPI {
namespace Filesystem {
namespace Utils{
-const RootToPathMap& getRootToPathMap()
+const RootToPathMap DLL_EXPORT & getRootToPathMap()
{
static RootToPathMap result;
if (result.empty()) {
return result;
}
-const PathToRootMap& getPathToRootMap()
+const PathToRootMap DLL_EXPORT & getPathToRootMap()
{
static PathToRootMap result;
if (result.empty()) {
return result;
}
-IPathPtr fromVirtualPath(JSContextRef context,
+IPathPtr DLL_EXPORT fromVirtualPath(JSContextRef context,
const std::string& arg)
{
LoggerD("arg:[" << arg << "]");
return result;
}
-std::string toVirtualPath(JSContextRef context, const std::string& arg) {
+std::string DLL_EXPORT toVirtualPath(JSContextRef context, const std::string& arg) {
int widgetId = WrtAccessSingleton::Instance().getWidgetId();
WidgetDB::Api::IWidgetDBPtr widgetDB =
// ThrowMsg(Commons::ConversionException, "Path doesn't contain a valid location type.");
}
-bool isUriPath(const std::string& path) {
+bool DLL_EXPORT isUriPath(const std::string& path) {
const char* uriPrefix = "file://";
const char* stringFromPath = path.c_str();
return false;
}
-bool isPathValid(const std::string& path) {
+bool DLL_EXPORT isPathValid(const std::string& path) {
static const std::string currentDirBegin(PATH_INVALID_COMPONENT_CURRENT_DIR + IPath::getSeparator());
static const std::string parentDirBegin(PATH_INVALID_COMPONENT_PARENT_DIR +
IPath::getSeparator());
return true;
}
-void toUTF8String(std::string fromEncoding, const char* from, const size_t fromLength, std::string &outputString)
+void DLL_EXPORT toUTF8String(std::string fromEncoding, const char* from, const size_t fromLength, std::string &outputString)
{
const char *fromEncodingSet = fromEncoding.c_str();
char *outputBuf = NULL;
#include <JSWebAPIError.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
+#include <Export.h>
#include <TimeTracer.h>
#include "FilesystemUtils.h"
}
}
-const JSClassRef JSFile::getClassRef()
+const JSClassRef DLL_EXPORT JSFile::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include <JSTizenException.h>
#include <SecurityExceptions.h>
#include <TimeTracer.h>
+#include <Export.h>
#include "Converter.h"
#include "Encodings.h"
delete privateObject;
}
-const JSClassRef JSFilestream::getClassRef()
+const JSClassRef DLL_EXPORT JSFilestream::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include <JSWebAPIError.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
+#include <Export.h>
#include "JSFile.h"
#include "FilesystemUtils.h"
#include "Converter.h"
{ 0, 0, 0 }
};
-const JSClassRef JSFilesystemManager::getClassRef()
+const JSClassRef DLL_EXPORT JSFilesystemManager::getClassRef()
{
if (!m_classRef) {
m_classRef = JSClassCreate(&m_classInfo);
#include <CommonsJavaScript/JSUtils.h>
//#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
+#include <Export.h>
#include "StorageProperties.h"
#include "JSStorage.h"
#include "Converter.h"
{ 0, 0, 0, 0 }
};
-const JSClassRef JSStorage::getClassRef()
+const JSClassRef DLL_EXPORT JSStorage::getClassRef()
{
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
namespace DeviceAPI {
namespace Filesystem {
+#pragma GCC visibility push(default)
+
const char* FILESYSTEM_PARAM_LOCATION = "param:location";
const char* FILESYSTEM_DEVICE_CAP_READ = "filesystem.read";
const char* FILESYSTEM_DEVICE_CAP_WRITE = "filesystem.write";
}
outFunction->deviceCapabilities = devCaps;
}
+
+#pragma GCC visibility pop
+
}
}
Connection::~Connection()
{
- assert(!m_connected && "DBus connection has not been closed.");
+ if(m_connected)
+ {
+ LoggerE("DBus connection has not been closed.");
+ }
delete m_messageDispatcher;
if (dbus_error_is_set(&m_error)) {
dbus_error_free(&m_error);
void Connection::setWorkerThread(DPL::Thread* thread)
{
- assert(!m_connected && "Connection has already been established.");
+ if(m_connected)
+ {
+ LoggerE("Connection has already been established.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection has already been established.");
+ }
m_messageDispatcher->SwitchToThread(thread);
}
void Connection::addFilterInternal(const std::string& rule)
{
- assert(m_connection && "Connection has to be established first.");
+ if(!m_connection)
+ {
+ LoggerE("Connection has to be established first.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection has to be established first.");
+ }
dbus_bus_add_match(m_connection, rule.c_str(), &m_error);
if (dbus_error_is_set(&m_error)) {
std::string message = m_error.message;
void Connection::removeFilterInternal(const std::string& rule)
{
- assert(m_connection && "Connection has to be established first.");
- dbus_bus_remove_match(m_connection, rule.c_str(), &m_error);
- if (dbus_error_is_set(&m_error)) {
- std::string message = m_error.message;
- dbus_error_free(&m_error);
- LoggerD("removeFilterInternal error : " << message);
-// ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "Invalid rule: " << message);
+ if(!m_connection)
+ {
+ LoggerE("Connection has to be established first.");
}
+ else
+ {
+ dbus_bus_remove_match(m_connection, rule.c_str(), &m_error);
+ if (dbus_error_is_set(&m_error)) {
+ std::string message = m_error.message;
+ dbus_error_free(&m_error);
+ LoggerD("removeFilterInternal error : " << message);
+ }
+ }
}
dbus_bool_t Connection::addWatch(DBusWatch* watch,
void* data)
{
LoggerD("ENTER");
- assert(data && "Connection should be passed as user data.");
+ if(!data)
+ {
+ LoggerE("Connection should be passed as user data.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection should be passed as user data.");
+ }
Connection* this_ = static_cast<Connection*>(data);
WatchPtr wrapper(new Watch(watch));
if (wrapper->isEnabled()) {
void* data)
{
LoggerD("ENTER");
- assert(data && "Connection should be passed as user data.");
+ if(!data)
+ {
+ LoggerE("Connection should be passed as user data.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection should be passed as user data.");
+ }
Connection* this_ = static_cast<Connection*>(data);
Watch wrapper(watch);
if (wrapper.isEnabled()) {
void* data)
{
LoggerD("ENTER");
- assert(data && "Connection should be passed as user data.");
+ if(!data)
+ {
+ LoggerE("Connection should be passed as user data.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection should be passed as user data.");
+ }
Connection* this_ = static_cast<Connection*>(data);
Watch wrapper(watch);
if (wrapper.isEnabled()) {
Connection::MessageDispatcher::MessageDispatcher(Connection* connection) :
m_connection(connection)
{
- assert(m_connection && "Connection cannot be NULL.");
+ if(!m_connection)
+ {
+ LoggerE("Connection cannot be NULL.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Connection cannot be NULL.");
+ }
DPL::Event::ControllerEventHandler<AddDescriptorSyncEvent>::Touch();
DPL::Event::ControllerEventHandler<RemoveDescriptorSyncEvent>::Touch();
}
Connection::Watch::Watch(DBusWatch* watch) : m_watch(watch)
{
- assert(m_watch && "Watch cannot be NULL.");
+ if(!m_watch)
+ {
+ LoggerE("Watch cannot be NULL.");
+ }
}
DPL::WaitableHandle Connection::Watch::getHandle() const
//
#include "Message.h"
-#include <cassert>
#include <Commons/Exception.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
namespace DBus {
Message::Message(DBusMessage* message) : m_message(message)
{
- assert(m_message && "Message cannot be NULL.");
+ if(!m_message)
+ {
+ LoggerE("Message cannot be NULL.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Message cannot be NULL.");
+ }
addRef();
}
Message::ReadIterator_::ReadIterator_(DBusMessage* message)
{
- assert(message && "Message cannot be NULL.");
+ if(!message)
+ {
+ LoggerE("Message cannot be NULL.");
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Message cannot be NULL.");
+ }
m_valid = dbus_message_iter_init(message, &m_iterator);
}
LoggerD("Account ID = " << accountId);
m_accountId = accountId;
reload();
- setMessageStatus(MESSAGE_STATUS_LOADED);
} catch (const WrtDeviceApis::Commons::PlatformException& ex) {
LoggerE("Exception: " << ex.DumpToString());
//setFolderType(EmailConverter::toFolderType(m_mailbox->mailbox_type));
setFolderType(EmailConverter::toFolderType(m_mail->mailbox_type));
+ setMessageStatus(EmailConverter::toMessageStatus(m_mail->mailbox_type));
LOG_EXIT
}
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "html Body File Open Error");
}
- m_mail->body_download_status = true;
+ m_mail->body_download_status = 1;
setBodyValidity(true);
"Couldn't find message " << m_mail->mail_id << ". [" << error << "]");
}
+ if(result->body_download_status != 1)
+ {
+ LoggerD("result->body_download_status " << result->body_download_status);
+ int mail_id_count = 1;
+ int mail_id_array[1];
+ email_mail_attribute_type attribute_type;
+ email_mail_attribute_value_t attribute_value;
+
+ mail_id_array[0] = m_mail->mail_id;
+ attribute_type = EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS;
+ attribute_value.integer_type_value = 1;
+
+ email_update_mail_attribute(m_accountId, mail_id_array, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, attribute_value);
+ }
+
+ readHeader();
+ readInfo();
+
if (m_mail->file_path_plain)
free(m_mail->file_path_plain);
m_mail->file_path_plain = strdup(result->file_path_plain);
}
}
+MessageStatus toMessageStatus(email_mailbox_type_e mailboxType)
+{
+ LOG_ENTER
+ switch (mailboxType) {
+ case EMAIL_MAILBOX_TYPE_INBOX: return MESSAGE_STATUS_LOADED;
+ case EMAIL_MAILBOX_TYPE_OUTBOX: return MESSAGE_STATUS_SENDING;
+ case EMAIL_MAILBOX_TYPE_SENTBOX: return MESSAGE_STATUS_SENT;
+ case EMAIL_MAILBOX_TYPE_DRAFT: return MESSAGE_STATUS_DRAFT;
+ default:
+ return MESSAGE_STATUS_LOADED;
+ }
+}
+
}
}
FolderType toFolderType(email_mailbox_type_e mailboxType);
FolderType toFolderType(int mailboxType);
+MessageStatus toMessageStatus(email_mailbox_type_e mailboxType);
}
}
// argu 4. Sorting mode (optional & nullable)
JSValueRef param4 = validator.toJSValueRef(3, true);
- if ((argumentCount >= 4)
- && (!JSValueIsNull(context, param4))
- && (!JSValueIsUndefined(context, param4)))
+ if((argumentCount >= 4) && (!JSValueIsNull(context, param4)))
{
DeviceAPI::Tizen::SortModePtr sortMode = filterConverter->toSortMode(param4);
- event->setSortMode(sortMode);
+
+ if(sortMode)
+ {
+ LoggerD("sortMode is set");
+ event->setSortMode(sortMode);
+ }
}
// argu 5. limit (optional & nullable)
// argu 4. Sorting mode (optional & nullable)
JSValueRef param4 = validator.toJSValueRef(3, true);
- if ((argumentCount >= 4)
- && (!JSValueIsNull(context, param4))
- && (!JSValueIsUndefined(context, param4)))
+ if((argumentCount >= 4) && (!JSValueIsNull(context, param4)))
{
DeviceAPI::Tizen::SortModePtr sortMode = filterConverter->toSortMode(param4);
- event->setSortMode(sortMode);
+
+ if(sortMode)
+ {
+ LoggerD("sortMode is set");
+ event->setSortMode(sortMode);
+ }
}
// argu 5. limit (optional & nullable)
throw DeviceAPI::Common::TypeMismatchException("serviceId is not defined.");
}
- // argu 2. filter ( optional )
+ // argu 2. filter ( optional && nullable)
DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+
if (filter) {
- DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+ LoggerE("filter is set");
privData->setFilter(filter);
}
+ else
+ {
+ if(!validator.isNull(1) && !validator.isOmitted(1))
+ {
+ LoggerE("wrong filter");
+ throw DeviceAPI::Common::TypeMismatchException("Invalid filter.");
+ }
+ }
if(callbackManager)
{
throw DeviceAPI::Common::TypeMismatchException("serviceId is not defined.");
}
- // argu 2. filter ( optional )
+ // argu 2. filter ( optional && nullable)
DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+
if (filter) {
- DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+ LoggerE("filter is set");
privData->setFilter(filter);
}
+ else
+ {
+ if(!validator.isNull(1) && !validator.isOmitted(1))
+ {
+ LoggerE("wrong filter");
+ throw DeviceAPI::Common::TypeMismatchException("Invalid filter.");
+ }
+ }
+
if(callbackManager)
{
throw DeviceAPI::Common::TypeMismatchException("serviceId is not defined.");
}
- // argu 2. filter ( optional )
+ // argu 2. filter ( optional && nullable)
DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+
if (filter) {
- DeviceAPI::Tizen::FilterPtr filter = filterConverter->toFilter(validator.toJSValueRef(1));
+ LoggerE("filter is set");
privData->setFilter(filter);
}
+ else
+ {
+ if(!validator.isNull(1) && !validator.isOmitted(1))
+ {
+ LoggerE("wrong filter");
+ throw DeviceAPI::Common::TypeMismatchException("Invalid filter.");
+ }
+ }
+
if(callbackManager)
{
if (err == EMAIL_ERROR_NONE) {
LoggerD("attachment Name : " << attachment_data->attachment_name);
LoggerD("attachment ID : " << attachment_data->attachment_id);
+ LoggerD("attachment attachment_mime_type : " << attachment_data->attachment_mime_type);
attachment->init(attachment_data->attachment_path, false);
+ if(attachment_data->attachment_mime_type)
+ {
+ attachment->setMimeType(attachment_data->attachment_mime_type);
+ }
+ LoggerD("attachment getMimeTypes : " << attachment->getMimeType());
}
else
{
}Catch(WrtDeviceApis::Commons::NotFoundException) {
LoggerE("Try to deregister by unmatched service");
return;
+ }Catch(WrtDeviceApis::Commons::PlatformException) {
+ LoggerE("Try to deregister by unmatched service");
+ return;
}
+
}
};
static WrtDeviceApis::Commons::FunctionMapping NFCFunctions =
createNFCFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(NFC, NFCFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createNFCFunctions()
{
using namespace WrtDeviceApis::Commons;
static FunctionMapping createNotificationFunctions();
static FunctionMapping NotificationFunctions = createNotificationFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Notification, NotificationFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createNotificationFunctions()
{
FunctionMapping pushMapping;
static FunctionMapping PackageFunctions =
createPackageFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Package, PackageFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createPackageFunctions()
{
/**
LoggerE("Platform error while changing screen state %d", ret);
throw UnknownException("Platform error while changing screen state");
}
+
+ int timeout=100;
+ while(timeout--){
+ if( isScreenOn() == onoff )
+ break;
+ usleep(100000);
+ }
+
}
void PowerManager::restoreScreenBrightness(){
static FunctionMapping PowerFunctions =
createPowerFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Power, PowerFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createPowerFunctions()
{
/**
free(tmp);
}
} else {
- UnknownException error(msg);
+ UnknownException error(msg == NULL ? "Unknown" : msg);
JSObjectRef errorObj = JSWebAPIError::makeJSWebAPIError(callback->getContext(), error);
callback->invokeCallback("onerror", errorObj);
}
if (result == PUSH_RESULT_SUCCESS) {
callback->invokeCallback("onsuccess");
} else {
- UnknownException error(msg);
+ UnknownException error(msg == NULL ? "Unknown" : msg);
JSObjectRef errorObj = JSWebAPIError::makeJSWebAPIError(callback->getContext(), error);
callback->invokeCallback("onerror", errorObj);
}
static FunctionMapping createPushFunctions();
static FunctionMapping PushFunctions = createPushFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Push, PushFunctions);
+#pragma GCC visibility pop
+
static FunctionMapping createPushFunctions()
{
/**
SEReader::~SEReader()
{
LoggerD("entered");
- m_reader->closeSessions();
m_reader = NULL;
}
static WrtDeviceApis::Commons::FunctionMapping SecureElementFunctions =
createSecureElementFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(SecureElement, SecureElementFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createSecureElementFunctions()
{
using namespace WrtDeviceApis::Commons;
#undef SECUREELEMENT_FEATURE_API_SE
#undef SECUREELEMENT_FEATURE_API_SECUREELEMENT
#undef SECUREELEMENT_DEVICE_CAP_SE
-#undef SECUREELEMENT_DEVICE_CAP_SECUREELEMENT
\ No newline at end of file
+#undef SECUREELEMENT_DEVICE_CAP_SECUREELEMENT
static WrtDeviceApis::Commons::FunctionMapping SecureStorageFunctions =
createSecureStorageFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(SecureStorage, SecureStorageFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createSecureStorageFunctions()
{
using namespace WrtDeviceApis::Commons;
std::string settingPath = event->getSettingValue();
LoggerD("RealSettingPath : " << settingPath);
- Try
- {
- settingPath = DeviceAPI::Filesystem::Utils::toVirtualPath(gContext, settingPath);
- LoggerD("VirtualSettingPath : " << settingPath);
- }
- Catch(WrtDeviceApis::Commons::ConversionException) {
- LoggerD("not the virtual path");
- LoggerD("RealSettingSettingPath : " << settingPath);
- }
-
if (settingPath.size() == 0)
{
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Unknown error");
callbackManager->callOnError(error);
return;
}
-// return converter.toJSValueRef(iconPath);
+
callbackManager->callOnSuccess(converter.toJSValueRef(settingPath));
}
static WrtDeviceApis::Commons::FunctionMapping SystemSettingFunctions =
createSystemSettingFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(SystemSetting, SystemSettingFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createSystemSettingFunctions()
{
using namespace WrtDeviceApis::Commons;
static WrtDeviceApis::Commons::FunctionMapping SysteminfoFunctions =
createSysteminfoFunctions();
+#pragma GCC visibility push(default)
+
DEFINE_FUNCTION_GETTER(Systeminfo, SysteminfoFunctions);
+#pragma GCC visibility pop
+
static WrtDeviceApis::Commons::FunctionMapping createSysteminfoFunctions()
{
/**