Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.36
+Version: 0.4.38
Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
}
if (!JSValueIsUndefined(m_context, beforeData)) {
TimeUtilConverter timeConverter(m_context);
- result->setDuration(timeConverter.getDurationPropertis(beforeData));
+ result->setDuration(timeConverter.getDurationProperties(beforeData));
}
if (!JSValueIsUndefined(m_context, methodData)) {
result->setMethod(toEventAlarmType(toString(methodData)));
}
} else if (JSValueIsObjectOfClass(context, arguments[0], JSTimeDuration::getClassRef())){
LoggerD("before case");
- alarm->setDuration(timeConverter.getDurationPropertis(arguments[0]));
+ alarm->setDuration(timeConverter.getDurationProperties(arguments[0]));
if (argumentCount>=2) {
alarm->setMethod(converter.toEventAlarmType(converter.toString(arguments[1])));
ThrowMsg(ConversionException, "Wrong before type.");
}
TimeUtilConverter timeConverter(context);
- alarm->setDuration(timeConverter.getDurationPropertis(value));
+ alarm->setDuration(timeConverter.getDurationProperties(value));
return true;
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_DESCRIPTION)) {
alarm->setDescription(converter.toString(value));
//set filter
if ( MEDIA_CONTENT_ERROR_NONE == media_filter_create(&filter))
{
- string condition="FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1";
+ string condition="(FOLDER_STORAGE_TYPE = 0 OR FOLDER_STORAGE_TYPE = 1)";
LoggerI("condition:" + condition);
media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
if ( MEDIA_CONTENT_ERROR_NONE !=
#include "EventCopy.h"
-#include <dpl/assert.h>
+
namespace DeviceAPI {
namespace Filesystem {
m_dest(dest),
m_options(OPT_NONE)
{
- Assert(src && "Source path not set.");
- Assert(dest && "Destination path not set.");
}
IPathPtr EventCopy::getDestination() const
#include "EventCreate.h"
-#include <dpl/assert.h>
namespace DeviceAPI {
namespace Filesystem {
m_type(type),
m_options(OPT_NONE)
{
- Assert(path && "Path is not set.");
}
IPathPtr EventCreate::getPath() const
#include "EventListNodes.h"
-#include <dpl/assert.h>
+#include <Commons/Exception.h>
#include "INode.h"
#include "Enums.h"
namespace Filesystem {
EventListNodes::EventListNodes(const INodePtr& node) : m_node(node)
{
- Assert(m_node && "Node can't be NULL.");
+ if (node == NULL)
+ {
+ ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Can not new an object");
+ }
}
INodePtr EventListNodes::getNode() const
} // Filesystem
-} // TizenApis
\ No newline at end of file
+} // TizenApis
#include "EventMove.h"
-#include <dpl/assert.h>
namespace DeviceAPI {
namespace Filesystem {
m_dest(dest),
m_options(OPT_NONE)
{
- Assert(src && "Source path not set.");
- Assert(dest && "Destination path not set.");
+
}
IPathPtr EventMove::getDestination() const
#include "EventRemove.h"
-#include <dpl/assert.h>
namespace DeviceAPI {
namespace Filesystem {
m_path(path),
m_options(OPT_NONE)
{
- Assert(m_path && "Path is not set.");
}
IPathPtr EventRemove::getPath() const
#include <map>
#include <string>
-#include <dpl/assert.h>
#include <Commons/Exception.h>
#include "Enums.h"
#include "IManager.h"
JSValueRef* exception)
{
JSStoragePriv *priv = static_cast<JSStoragePriv*>(JSObjectGetPrivate(object));
- assert(priv && "Private object not set.");
Try {
+ if (!priv) {
+ ThrowMsg(Commons::PlatformException, "Can not new an object");
+ }
StorageProperties *storages = priv->getObject();
Converter convert(context);
#include <iterator>
#include <stdlib.h>
#include <limits.h>
-#include <dpl/assert.h>
#include <Commons/Exception.h>
#include <Commons/StringUtils.h>
#include "Path.h"
LoggerD("ENTER");
EventGetNodeDataPtr data =
DPL::DynamicPointerCast<EventGetNodeData>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data->getCallbackManager());
DPL::DynamicPointerCast<JSFile::ListFilesPrivateData>(event->getPrivateData());
JSCallbackManagerPtr data = privData->getCallbackManager();
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
LoggerD("--| ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
LoggerD("--| ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
void ResponseDispatcher::OnAnswerReceived(const EventGetStoragePtr& event)
{
DPL::SharedPtr<JSCallbackManager> data = DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
void ResponseDispatcher::OnAnswerReceived(const EventListStoragesPtr& event)
{
DPL::SharedPtr<JSCallbackManager> data = DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
- Assert(NULL != data);
FilesystemAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(data);
#include <stdio.h>
#include <new>
-#include <dpl/assert.h>
#include <dpl/scoped_array.h>
#include <Commons/Exception.h>
m_parent(parent),
m_mode(mode)
{
- Assert(m_parent && "Stream needs to have parent.");
std::ios_base::openmode mode_ = std::ios_base::binary;
if (mode & AM_READ) { mode_ |= std::ios_base::in; }
#include <map>
#include <utility>
-#include <dpl/assert.h>
#include <Commons/FunctionDefinition.h>
#include <Commons/FunctionDeclaration.h>
#include <Commons/Exception.h>
WrtDeviceApis::Commons::AceFunction* outFunction)
{
using namespace WrtDeviceApis::Commons;
-
- Assert(outFunction && (permissions != Filesystem::PERM_NONE));
-
AceDeviceCapParam paramLocation = AceDeviceCapParam(
FILESYSTEM_PARAM_LOCATION, path);
{
using namespace WrtDeviceApis::Commons;
- Assert(outFunction);
-
AceDeviceCapParam paramLocation = AceDeviceCapParam(
FILESYSTEM_PARAM_LOCATION,
path);
{
makeConversationFromEmailThreadId(threadId);
}
- else if(msgType == EMPTY_MESSAGE)
+ else if((msgType == EMPTY_MESSAGE_CONVERSATION)||(msgType == EMPTY_EMAIL_CONVERSATION))
{
- // do nothing
+ makeEmptyConversation(threadId, msgType);
}
else
{
return m_result;
}
+
+void Conversation::makeEmptyConversation(unsigned int threadIndex, MessageType msgType)
+{
+ LoggerD("Enter");
+ if(msgType == EMPTY_MESSAGE_CONVERSATION)
+ {
+ m_type = SMS;
+ m_Id = 0;
+ }
+ else
+ {
+ m_type = EMAIL;
+ m_Id = threadIndex;
+ }
+ m_time = 0;
+ m_messageCount = 0;
+ m_unreadMessages = 0;
+ m_preview = "";
+ m_read = false;
+ m_from = "";
+ m_subject = "";
+ m_lastMessageId = 0;
+ m_direction = 0;
+ m_result = true;
+}
+
+
Conversation::~Conversation()
{
}
// void makeConversationFromThread(msg_thread_view_t msg_thread);
void makeConversationFromThread(msg_struct_t msg_thread);
bool makeConversationFromEmailThreadId(unsigned int emailTreadId);
+ void makeEmptyConversation(unsigned int threadIndex, MessageType msgType);
void setConvId(const int id);
#if 0
// setter
tmpAtt->setAttachmentID(attachment[i].attachment_id);
tmpAtt->setDownloaded(attachment[i].save_status);
tmpAtt->setIsInlineAttachment((bool)attachment[i].inline_content_status);
+ if(attachment[i].attachment_mime_type)
+ {
+ tmpAtt->setMimeType(attachment[i].attachment_mime_type);
+ }
tmpAtt->setNth(i+1);
LoggerD(" setNth(i+1) : " << i+1);
if(attachment[i].inline_content_status == 0)
attachment_info->attachment_path = String::strdup( buf );
attachment_info->save_status = true;
attachment_info->inline_content_status = 0;
+ if(att->getMimeType().size() > 0)
+ {
+ attachment_info->attachment_mime_type = String::strdup(att->getMimeType());
+ }
LoggerD("attachment_info->attachment_name=" << attachment_info->attachment_name);
LoggerD("attachment_info->attachment_path=" << attachment_info->attachment_path);
LoggerD("attachment_info->save_status=" << attachment_info->save_status);
LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
+ LoggerD("attachment_info->attachment_mime_type=" << attachment_info->attachment_mime_type);
LoggerD("Copy Command=" << cp_cmd.str());
if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
attachment_info->save_status = true;
attachment_info->inline_content_status = 1;
LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
+ if(att->getMimeType().size() > 0)
+ {
+ attachment_info->attachment_mime_type = String::strdup(att->getMimeType());
+ }
LoggerD("Copy Command=" << cp_cmd.str());
if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to copy file");
}
}
+ LoggerD("attachment_info->attachment_mime_type=" << attachment_info->attachment_mime_type);
/*
int result = system(cp_cmd.str().c_str());
BINARYSMS,
VIRTUAL_MESSAGE,
EMPTY_MESSAGE,
+ EMPTY_MESSAGE_CONVERSATION,
+ EMPTY_EMAIL_CONVERSATION,
MESSAGETYPE_COUNT
};
static PropertyStructArray propertiesMessagesChange =
{
+ { ATTRIBUTE_ID, PrimitiveType_String },
{ ATTRIBUTE_SERVICE_ID, PrimitiveType_String },
{ ATTRIBUTE_CONVERSATION_ID, PrimitiveType_String },
{ ATTRIBUTE_FOLDER_ID, PrimitiveType_String },
stream >> id;
IMessagePtr msg = MessageFactory::createMessage(EMPTY_MESSAGE, id);
- IConversationPtr conversation(new Conversation());
+ IConversationPtr conversation(new Conversation(mail_id, EMPTY_EMAIL_CONVERSATION));
FolderType folder = msg->getCurrentFolder();
jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
LoggerI("Email received. mail_id: " << mail_id);
IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
- IConversationPtr conversation(new Conversation(thread_id, EMAIL));
+ IConversationPtr conversation(new Conversation(mail_id, EMAIL));
FolderType folder = msg->getCurrentFolder();
jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
{ // TODO also RECEIVE_THREAD_ITEM?
LoggerI("Email received. delete thread Id : " << mail_id);
- IConversationPtr conversation(new Conversation());
+ IConversationPtr conversation(new Conversation(mail_id, EMPTY_EMAIL_CONVERSATION));
conversation->setConvId(mail_id);
jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_DELETED);
jsEvent->setConversation(conversation);
DeviceAPI::Tizen::FilterPtr filter = multiCallbacks->getFilter();
IMessagePtr msg = event->getMessage();
- if(filter != NULL && msg->getMessageType() != EMPTY_MESSAGE)
+ if(filter != NULL)
{
LoggerD("Filter exist");
StorageChangesMessageGeneratorPtr queryGenerator(new StorageChangesMessageGenerator(event->getMessage(), event->getConversation()));
DeviceAPI::Tizen::IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<DeviceAPI::Tizen::IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
std::vector<IMessagePtr> msgs; // for msg
- // IMessagePtr msg = event->getMessage();
if(queryGenerator->getCompareResult())
{
LoggerD("Message call back");
namespace DeviceAPI {
namespace Messaging {
+ const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID = "id";
const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID = "serviceId";
const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CONVERSATION_ID = "conversationId";
const std::string StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FOLDER_ID = "folderId";
static PropertyStructArray properties =
{
+ {StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String},
{StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String},
{StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CONVERSATION_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String},
{StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FOLDER_ID.c_str(), DeviceAPI::Tizen::PrimitiveType_String},
static StorageChangesMessageFilterValidatorPtr getStorageChangesMessageFilterValidator();
public:
+ static const std::string ATTRIBUTE_ID;
static const std::string ATTRIBUTE_SERVICE_ID;
static const std::string ATTRIBUTE_CONVERSATION_ID;
static const std::string ATTRIBUTE_FOLDER_ID;
m_messageType(MESSAGE_TYPE_NOT_INITIALIZED) , m_serviceId(-1)
{
+ m_id = msg->getIdRef();
m_type = msg->getMessageType();
m_folder = msg->getCurrentFolder();
m_dateTime = msg->getDateTime();
std::string valueString;
// Check msg_type and filter_type
+ if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_ID)==0){
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_id:[" << m_id << "]");
+
+ valueString = m_id;
+ if(getMatchFlagResult(value, valueString, matchFlag))
+ {
+ m_result.push_back(TRUE);
+ LoggerD("<<< id is same");
+ }
+ else
+ {
+ m_result.push_back(FALSE);
+ LoggerD("<<< id is different");
+ }
+ return;
+ }
+
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID)==0){
LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
std::vector<bool> m_result;
std::vector<int> m_operand;
-// std::string m_id;
+ std::string m_id;
MessageType m_type;
FolderType m_folder;
struct tm m_dateTime;
<device-capability>notification</device-capability>
</api-feature>
-</plugin-properties>
\ No newline at end of file
+ <api-feature>
+ <name>http://tizen.org/privilege/notification.read</name>
+ </api-feature>
+
+ <api-feature>
+ <name>http://tizen.org/privilege/notification.write</name>
+ <device-capability>notification</device-capability>
+ </api-feature>
+
+</plugin-properties>
return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBackFlash);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATION)) {
bool location = false;
- if (system_info_get_value_bool(SYSTEM_INFO_KEY_CPS_SUPPORTED, &location) == SYSTEM_INFO_ERROR_NONE) {
- LoggerD("location : " << location);
- deviceCapabilitiesInfo->location = location;
+ bool locationGps = false;
+ bool locationWps = false;
+ if (system_info_get_value_bool(SYSTEM_INFO_KEY_GPS_SUPPORTED, &locationGps) == SYSTEM_INFO_ERROR_NONE) {
+ LoggerD("locationGps : " << locationGps);
+ }
+ if (system_info_get_value_bool(SYSTEM_INFO_KEY_WPS_SUPPORTED, &locationWps) == SYSTEM_INFO_ERROR_NONE) {
+ LoggerD("locationWps : " << locationWps);
+ }
+ if (locationGps || locationWps) {
+ location = true;
}
+ deviceCapabilitiesInfo->location = location;
return convert.toJSValueRef(deviceCapabilitiesInfo->location);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONGPS)) {
bool locationGps = false;
DurationProperties duration;
if (argumentCount == 0)
- duration= converter.getDurationPropertis(JSValueMakeUndefined(context));
+ duration= converter.getDurationProperties(JSValueMakeUndefined(context));
else
- duration= converter.getDurationPropertis(arguments[0]);
+ duration= converter.getDurationProperties(arguments[0]);
LoggerD("unit : " << duration.unit << " Length:" << duration.length);
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
TimeUtilConverter converter(context);
- DurationProperties first = converter.getDurationPropertis(thisObject);
+ DurationProperties first = converter.getDurationProperties(thisObject);
DurationProperties second;
if (argumentCount == 0)
- second= converter.getDurationPropertis(JSValueMakeUndefined(context));
+ second= converter.getDurationProperties(JSValueMakeUndefined(context));
else
- second= converter.getDurationPropertis(arguments[0]);
+ second= converter.getDurationProperties(arguments[0]);
DurationProperties diff;
if (first.unit > second.unit) {
return duration;
}
-DurationProperties TimeUtilConverter::getDurationPropertis(JSValueRef value) {
+DurationProperties TimeUtilConverter::getDurationProperties(JSValueRef value) {
DurationProperties duration;
duration.length = getDurationLength(value);
duration.unit = getDurationUnit(value);
JSObjectRef makeDurationObject(const DurationProperties &duration);
JSObjectRef makeMillisecondDurationObject(const long long length);
DurationPropertiesPtr getDuration(JSValueRef value);
- DurationProperties getDurationPropertis(JSValueRef value);
+ DurationProperties getDurationProperties(JSValueRef value);
long long getDurationLength(JSValueRef value);
long long getDurationLength(JSObjectRef object);
short getDurationUnit(JSValueRef value);