MESSAGE("Sources: ${SRCS}")
# Dependencies
-SET(DEPS "aul bundle pkgmgr-info capi-appfw-app-control context-common")
+SET(DEPS "aul bundle capi-appfw-app-control context-common")
# Common Options
INCLUDE(FindPkgConfig)
INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
INSTALL(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
- FILES_MATCHING PATTERN "*.h"
+ FILES_MATCHING
+ PATTERN "context_trigger_internal.h" EXCLUDE
+ PATTERN "*.h"
)
SET(VERSION ${FULLVER})
--- /dev/null
+/*
+ * Copyright (c) 2015 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_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__
+#define __TIZEN_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__
+
+#include <context_trigger.h>
+
+/**
+ * @brief Sets a D-Bus method call as the action of a rule.
+ * @since_tizen 2.4
+ *
+ * @param[in] rule The rule to set the action on
+ * @param[in] bus_name Destination remote bus name
+ * @param[in] object_path Path of the remote object
+ * @param[in] interface_name D-Bus interface to invoke method on
+ * @param[in] method_name The name of the method to invoke
+ * @param[in] user_data A user-defined string to be delivered as the first parameter of the method.
+ * @c NULL if not passing any values.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #CONTEXT_TRIGGER_ERROR_NONE Successful
+ * @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed
+ */
+int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule,
+ const char *bus_name, const char *object_path, const char *interface_name,
+ const char *method_name, const char *user_data);
+
+#endif
#define CT_RULE_ACTION_TYPE_APP_CONTROL "app_control"
#define CT_RULE_ACTION_TYPE_NOTIFICATION "notification"
+#define CT_RULE_ACTION_TYPE_DBUS_CALL "dbus_call"
#define CT_RULE_ID "ID"
#define CT_RULE_DESCRIPTION "DESCRIPTION"
#define CT_RULE_ACTION_NOTI_CONTENT "ACTION_NOTI_CONTENT"
#define CT_RULE_ACTION_NOTI_ICON_PATH "ACTION_NOTI_ICON_PATH"
+#define CT_RULE_ACTION_DBUS_NAME "ACTION_DBUS_NAME"
+#define CT_RULE_ACTION_DBUS_OBJECT "ACTION_DBUS_OBJ"
+#define CT_RULE_ACTION_DBUS_INTERFACE "ACTION_DBUS_IFACE"
+#define CT_RULE_ACTION_DBUS_METHOD "ACTION_DBUS_METHOD"
+#define CT_RULE_ACTION_DBUS_USER_DATA "ACTION_DBUS_USERDATA"
+
#define CT_RESPONSE "RES"
#define CT_EVENT_TIME "timer/event"
Name: context
Summary: Tizen Context Framework Native API
-Version: 0.5.3
+Version: 0.5.5
Release: 1
Group: System/API
License: Apache-2.0
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(capi-appfw-app-control)
-BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(context-common)
%description
#include <bundle.h>
#include <bundle_internal.h>
#include <context_trigger.h>
+#include <context_trigger_internal.h>
#include <context_trigger_types_internal.h>
#include <request_handler.h>
#include "rule_validator.h"
return CONTEXT_TRIGGER_ERROR_NONE;
}
+#if 0
+EXTAPI int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule,
+ const char *bus_name, const char *object_path, const char *interface_name, const char *method_name, const char *user_data)
+{
+ ASSERT_NOT_NULL(rule && bus_name && object_path && interface_name && method_name);
+
+ // if action arleady exists
+ std::string type;
+ if ((rule->jrule).get(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_TYPE, &type))
+ return CONTEXT_TRIGGER_ERROR_INVALID_RULE;
+
+ // Set D-Bus info
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_TYPE, CT_RULE_ACTION_TYPE_DBUS_CALL);
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_NAME, bus_name);
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_OBJECT, object_path);
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_INTERFACE, interface_name);
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_METHOD, method_name);
+ (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_USER_DATA, (user_data ? user_data : ""));
+
+ return CONTEXT_TRIGGER_ERROR_NONE;
+}
+#endif
+
// Set description
EXTAPI int context_trigger_rule_set_description(context_trigger_rule_h rule, const char* description)
{