/**
* @brief Definition for the attribute key denoting "time of day".
- * @details This can be used as a key of context_trigger_rule_entry_add_option_string(),
- * or left operands of context_trigger_rule_entry_add_comparison_int().@n
- * When being used as option, it is time interval of the day. For example, "13-15" denotes "from 1 PM to 3 PM".
- * When being used with #CONTEXT_TRIGGER_EVENT_TIME or #CONTEXT_TRIGGER_CONDITION_TIME, it's unit is "minute",
+ * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
+ * When being used with #CONTEXT_TRIGGER_CONDITION_TIME, it's unit is "minute",
* the valid range of the corresponding right operands is thus from 0 (12:00 AM) to 1439 (11:59 PM).
* @since_tizen 2.4
*/
/**
* @brief Definition for the attribute key denoting "day of week".
- * @details This can be used as a key of context_trigger_rule_entry_add_option_string(),
- * or left operands of context_trigger_rule_entry_add_comparison_string().@n
+ * @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
* As the right operands of this attribute, one of the following values are allowed:
* #CONTEXT_TRIGGER_MON, #CONTEXT_TRIGGER_TUE, #CONTEXT_TRIGGER_WED, #CONTEXT_TRIGGER_THU, #CONTEXT_TRIGGER_FRI,
* #CONTEXT_TRIGGER_SAT, #CONTEXT_TRIGGER_SUN, #CONTEXT_TRIGGER_WEEKDAY, and #CONTEXT_TRIGGER_WEEKEND.
#define CONTEXT_TRIGGER_STATE "State"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "BSSID".
* @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find available right operands.
#define CONTEXT_TRIGGER_ACCURACY "Accuracy"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "medium".
* @details This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find available right operands.
#define CONTEXT_TRIGGER_PLACE_ID "PlaceId"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "application id".
* @details This can be used as a key of context_trigger_rule_entry_add_option_string().@n
* See the programming guide to find the corresponding trigger events.
#define CONTEXT_TRIGGER_APP_ID "AppId"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "address".
* @details This can be used as a key of context_trigger_rule_entry_add_option_string(),
* or context_trigger_rule_entry_add_comparison_string().@n
#define CONTEXT_TRIGGER_ADDRESS "Address"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "rank".
* @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
* See the programming guide to find available right operands.
#define CONTEXT_TRIGGER_RANK "Rank"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute key denoting "total count".
* @details This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
* See the programming guide to find available right operands.
/**
* @brief Definition for the attribute value denoting Weekdays.
- * @details This can be used as a value of context_trigger_rule_entry_add_option_string()
- * or right operands of context_trigger_rule_entry_add_comparison_string().@n
+ * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding option keys or left operand attribute keys.
* @since_tizen 2.4
*/
/**
* @brief Definition for the attribute value denoting Weekends.
- * @details This can be used as a value of context_trigger_rule_entry_add_option_string()
- * or right operands of context_trigger_rule_entry_add_comparison_string().@n
+ * @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding option keys or left operand attribute keys.
* @since_tizen 2.4
*/
#define CONTEXT_TRIGGER_SEARCHING "Searching"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "connecting" state.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_UNCONNECTED "Unconnected"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "idle" state.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_IDLE "Idle"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "voice" type.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_VOICE "Voice"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "video" type.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_BLUETOOTH "Bluetooth"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "received" event.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_RECEIVED "Received"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "sent" event.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_SENT "Sent"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "SMS" type.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
#define CONTEXT_TRIGGER_SMS "SMS"
/**
+ * @deprecated Deprecated since 4.0.
* @brief Definition for the attribute value denoting the "MMS" type.
* @details This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
* See the programming guide to find the corresponding left operand attribute keys.
* @since_tizen 2.4
*/
typedef enum {
- CONTEXT_TRIGGER_EVENT_TIME = 0x10001, /**< At certain times of day and days of week @n Privilege: http://tizen.org/privilege/alarm.set */
+ CONTEXT_TRIGGER_EVENT_TIME = 0x10001, /**< At certain times of day and days of week @n Privilege: http://tizen.org/privilege/alarm.set (Deprecated since 4.0) */
CONTEXT_TRIGGER_EVENT_BATTERY = 0x10100, /**< Battery level changed */
CONTEXT_TRIGGER_EVENT_CHARGER, /**< Charger connected/disconnected */
CONTEXT_TRIGGER_EVENT_GPS, /**< GPS state changed */
CONTEXT_TRIGGER_EVENT_HEADPHONE, /**< Headphone connected/disconnected */
CONTEXT_TRIGGER_EVENT_USB, /**< USB connected/disconnected */
CONTEXT_TRIGGER_EVENT_WIFI, /**< WiFi state changed @n Privilege: http://tizen.org/privilege/network.get */
- CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE = 0x10200, /**< Power saving mode enabled/disabled */
- CONTEXT_TRIGGER_EVENT_CALL = 0x10300, /**< Call state changed @n Privilege: http://tizen.org/privilege/telephony */
- CONTEXT_TRIGGER_EVENT_EMAIL, /**< Email sent/received */
- CONTEXT_TRIGGER_EVENT_MESSAGE, /**< Message sent/received @n Privilege: http://tizen.org/privilege/message.read */
+ CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE = 0x10200, /**< Power saving mode enabled/disabled (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_EVENT_CALL = 0x10300, /**< Call state changed @n Privilege: http://tizen.org/privilege/telephony (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_EVENT_EMAIL, /**< Email sent/received (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_EVENT_MESSAGE, /**< Message sent/received @n Privilege: http://tizen.org/privilege/message.read (Deprecated since 4.0) */
CONTEXT_TRIGGER_EVENT_CONTACTS, /**< Contacts changed (Since 3.0) @n Privilege: http://tizen.org/privilege/contact.read */
CONTEXT_TRIGGER_EVENT_ACTIVITY_STATIONARY = 0x10400, /**< 'Stationary' activity detected */
CONTEXT_TRIGGER_EVENT_ACTIVITY_WALKING, /**< 'Walking' activity detected */
CONTEXT_TRIGGER_CONDITION_HEADPHONE, /**< Headphone connection */
CONTEXT_TRIGGER_CONDITION_USB, /**< USB connection */
CONTEXT_TRIGGER_CONDITION_WIFI, /**< WiFi state @n Privilege: http://tizen.org/privilege/network.get */
- CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE = 0x20200, /**< Power saving mode setting */
- CONTEXT_TRIGGER_CONDITION_CALL = 0x20300, /**< Call state @n Privilege: http://tizen.org/privilege/telephony */
- CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY = 0x20600, /**< Frequency of app use @n Privilege: http://tizen.org/privilege/apphistory.read */
- CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY, /**< Frequency of communication via call or message @n Privilege: http://tizen.org/privilege/callhistory.read */
- CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY, /**< Frequency of music playback @n Privilege: http://tizen.org/privilege/mediahistory.read */
- CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY, /**< Frequency of video playback @n Privilege: http://tizen.org/privilege/mediahistory.read */
+ CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE = 0x20200, /**< Power saving mode setting (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_CONDITION_CALL = 0x20300, /**< Call state @n Privilege: http://tizen.org/privilege/telephony (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY = 0x20600, /**< Frequency of app use @n Privilege: http://tizen.org/privilege/apphistory.read (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY, /**< Frequency of communication via call or message @n Privilege: http://tizen.org/privilege/callhistory.read (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY, /**< Frequency of music playback @n Privilege: http://tizen.org/privilege/mediahistory.read (Deprecated since 4.0) */
+ CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY, /**< Frequency of video playback @n Privilege: http://tizen.org/privilege/mediahistory.read (Deprecated since 4.0) */
} context_trigger_condition_e;
/**
int context_trigger_rule_entry_add_option_int(context_trigger_rule_entry_h entry, const char* option_key, int value);
/**
+ * @deprecated Deprecated since 4.0.
* @brief Sets a string type option to an event or condition entry.
* @details See the programming guide to find available option keys for each event/condition item.
* @since_tizen 2.4
* @see context_trigger_rule_entry_add_option()
* @see context_trigger_rule_entry_add_option_int()
*/
-int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value);
+int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value) TIZEN_DEPRECATED_API;
/**
+ * @deprecated Deprecated since 4.0.
* @brief Sets an option to a condition entry, which references an attribute that will be extracted from the event.
* @details See the programming guide to find available option keys for each condition item.
* @since_tizen 2.4
* @see context_trigger_rule_entry_add_option_int()
* @see context_trigger_rule_entry_add_option_string()
*/
-int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key);
+int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key) TIZEN_DEPRECATED_API;
/**
* @brief Adds an attribute key to an entry.
int context_trigger_rule_entry_add_comparison_string(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* value);
/**
+ * @deprecated Deprecated since 4.0.
* @brief Adds a comparison between an attribute of a condition and an attribute extracted from the event.
* @details The key needs to be registered in advance, via context_trigger_rule_entry_add_key().
* @since_tizen 2.4
* @see context_trigger_rule_entry_add_comparison_int()
* @see context_trigger_rule_entry_add_comparison_string()
*/
-int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* event_data_key);
+int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* comp_operator, const char* event_data_key) TIZEN_DEPRECATED_API;
/**
* @brief Defines a custom contextual data item with its template.
#include "rule_validator.h"
#include "rule_util.h"
+#define TRIGGER_DEPRECATED_FUNCTION_MSG "DEPRECATION WARNING: %s is deprecated and will be removed from next release."
+#define TRIGGER_DEPRECATED_EVENT_MSG "DEPRECATION WARNING: This event is deprecated and will be removed from next release."
+#define TRIGGER_DEPRECATED_CONDITION_MSG "DEPRECATION WARNING: This condition is deprecated and will be removed from next release."
+
//#define DOUBLE_PRECISION 2
#define TYPE_EVENT 1
#define TYPE_CONDITION 2
static std::string convert_condition_to_string(context_trigger_condition_e item);
static std::string convert_logical_type_to_string(context_trigger_logical_type_e logical_type);
static std::string get_custom_item_subject(const char* provider, const char* item);
+static bool event_is_deprecated(context_trigger_event_e item);
+static bool condition_is_deprecated(context_trigger_condition_e item);
//static std::string int_to_string(int value);
//static std::string double_to_string(int value);
_D("BEGIN");
ASSERT_NOT_NULL(entry);
+ if (event_is_deprecated(event_item)) {
+ _W(TRIGGER_DEPRECATED_EVENT_MSG);
+ }
+
std::string eitem_str = convert_event_to_string(event_item);
if (eitem_str.empty()) {
return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER;
_D("BEGIN");
ASSERT_NOT_NULL(supported);
+ if (event_is_deprecated(event_item)) {
+ _W(TRIGGER_DEPRECATED_EVENT_MSG);
+ }
+
*supported = false;
std::string eitem_str = convert_event_to_string(event_item);
_D("BEGIN");
ASSERT_NOT_NULL(entry);
+ if (condition_is_deprecated(condition_item)) {
+ _W(TRIGGER_DEPRECATED_CONDITION_MSG);
+ }
+
std::string citem_str = convert_condition_to_string(condition_item);
if (citem_str.empty()) {
return CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER;
_D("BEGIN");
ASSERT_NOT_NULL(supported);
+ if (condition_is_deprecated(condition_item)) {
+ _W(TRIGGER_DEPRECATED_CONDITION_MSG);
+ }
+
*supported = false;
std::string citem_str = convert_condition_to_string(condition_item);
SO_EXPORT int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h entry, const char* option_key, const char* value)
{
_D("BEGIN");
+ _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__);
ASSERT_NOT_NULL(entry && option_key && value);
bool ret = true;
SO_EXPORT int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, const char* option_key, const char* event_data_key)
{
_D("BEGIN");
+ _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__);
ASSERT_NOT_NULL(entry && option_key && event_data_key);
// Err: Only conditin can reference data from event
SO_EXPORT int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry, const char* key, const char* op, const char* event_data_key)
{
_D("BEGIN");
+ _W(TRIGGER_DEPRECATED_FUNCTION_MSG, __FUNCTION__);
ASSERT_NOT_NULL(entry && key && op && event_data_key);
// Err: Only condition can reference data from event
return subject_name;
}
+bool event_is_deprecated(context_trigger_event_e item)
+{
+ bool ret = false;
+ switch (item) {
+ case CONTEXT_TRIGGER_EVENT_TIME:
+ case CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE:
+ case CONTEXT_TRIGGER_EVENT_CALL:
+ case CONTEXT_TRIGGER_EVENT_EMAIL:
+ case CONTEXT_TRIGGER_EVENT_MESSAGE:
+ ret = true;
+ break;
+ default:
+ break;
+ }
+ return ret;
+}
+
+bool condition_is_deprecated(context_trigger_condition_e item)
+{
+ bool ret = false;
+ switch (item) {
+ case CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE:
+ case CONTEXT_TRIGGER_CONDITION_CALL:
+ case CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY:
+ case CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY:
+ case CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY:
+ case CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY:
+ ret = true;
+ break;
+ default:
+ break;
+ }
+ return ret;
+}
+
/*
std::string int_to_string(int value)
{