From 3642754efd7383ef1bcd80ba5cf29730e388bade Mon Sep 17 00:00:00 2001 From: Somin Kim Date: Fri, 12 Jun 2015 16:07:29 +0900 Subject: [PATCH] [context][ACR-272] Updated context trigger event/condition enumerations Change-Id: I5ad47198fd81ff8b870802df2f60f72f58dd7011 Signed-off-by: Somin Kim --- org.tizen.guides/html/native/context/trigger_n.htm | 30 ++++++++-------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/org.tizen.guides/html/native/context/trigger_n.htm b/org.tizen.guides/html/native/context/trigger_n.htm index 8e60518..9f6fb7d 100644 --- a/org.tizen.guides/html/native/context/trigger_n.htm +++ b/org.tizen.guides/html/native/context/trigger_n.htm @@ -108,14 +108,14 @@ context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
  • Define the event ("at 10 PM every day"). -

    A CONTEXT_TRIGGER_EVENT_ON_TIME type event entry is created, and a key-value comparison of CONTEXT_TRIGGER_TIME_OF_DAY == 22 is set to the event. +

    A CONTEXT_TRIGGER_EVENT_TIME type event entry is created, and a key-value comparison of CONTEXT_TRIGGER_TIME_OF_DAY == 1320 is set to the event.

     // Composing an event
     context_trigger_rule_entry_h event = NULL;
    -context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
    +context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
     context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, CONTEXT_TRIGGER_TIME_OF_DAY);
    -context_trigger_rule_entry_add_comparison_int(event, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 22);
    +context_trigger_rule_entry_add_comparison_int(event, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 1320);
     
     // Adding the event to the rule and releasing the resources
     context_trigger_rule_add_entry(rule, event);
    @@ -153,10 +153,10 @@ context_trigger_rule_entry_destroy(condition);
     			Valid operands
     		
     		
    -			CONTEXT_TRIGGER_EVENT_ON_TIME
    +			CONTEXT_TRIGGER_EVENT_TIME
     			CONTEXT_TRIGGER_TIME_OF_DAY
     			Integer
    -			From 0 to 23 (hour)
    +			From 0 to 1439 (minute)
     		
     		
     			CONTEXT_TRIGGER_DAY_OF_WEEK
    @@ -167,13 +167,12 @@ context_trigger_rule_entry_destroy(condition);
     			
     		
     		
    -			CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY
    +			CONTEXT_TRIGGER_CONDITION_TIME
     			CONTEXT_TRIGGER_TIME_OF_DAY
     			Integer
     			From 0 to 1439 (minute)
     		
     		
    -			CONTEXT_TRIGGER_CONDITION_DAY_OF_WEEK
     			CONTEXT_TRIGGER_DAY_OF_WEEK
     			String
     			
    @@ -182,7 +181,6 @@ context_trigger_rule_entry_destroy(condition);
     			
     		
     		
    -			CONTEXT_TRIGGER_CONDITION_DAY_OF_MONTH
     			CONTEXT_TRIGGER_DAY_OF_MONTH
     			Integer
     			From 1 to 31
    @@ -214,14 +212,8 @@ context_trigger_rule_entry_destroy(condition);
     		
     		
     			
    -				CONTEXT_TRIGGER_EVENT_FLIGHT_MODE
    -				

    CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE

    -

    CONTEXT_TRIGGER_EVENT_SILENT_MODE

    -

    CONTEXT_TRIGGER_EVENT_VIBRATION_MODE

    -

    CONTEXT_TRIGGER_CONDITION_FLIGHT_MODE

    + CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE

    CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE

    -

    CONTEXT_TRIGGER_CONDITION_SILENT_MODE

    -

    CONTEXT_TRIGGER_CONDITION_VIBRATION_MODE

    CONTEXT_TRIGGER_IS_ENABLED Integer @@ -523,16 +515,16 @@ context_trigger_rule_set_action_notification(disjunction_rule, ...);
  • Combining attributes into an event or condition -

    Some event and condition items provide multiple attributes. The logical connection between attributes must be set properly to fulfill the requirement. For example, when you use CONTEXT_TRIGGER_EVENT_ON_TIME to define a rule "at 4 PM every Monday", the comparisons regarding the 2 attributes, CONTEXT_TRIGGER_TIME_OF_DAY and CONTEXT_TRIGGER_DAY_OF_WEEK must be satisfied together.

    +

    Some event and condition items provide multiple attributes. The logical connection between attributes must be set properly to fulfill the requirement. For example, when you use CONTEXT_TRIGGER_EVENT_TIME to define a rule "at 4 PM every Monday", the comparisons regarding the 2 attributes, CONTEXT_TRIGGER_TIME_OF_DAY and CONTEXT_TRIGGER_DAY_OF_WEEK must be satisfied together.

    On the contrary, using CONTEXT_TRIGGER_APP_USE_FREQUENCY, if you want to check whether a specific application belongs to the 5 most frequently used applications, or the application was used at least 10 times, both comparisons against CONTEXT_TRIGGER_RANK and CONTEXT_TRIGGER_TOTAL_COUNT must be connected by a logical disjunction.

    The following example illustrates the cases described above:

     // Composing an event "at 4 PM every Monday"
     context_trigger_rule_entry_h time_event;
    -context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &time_event);
    +context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &time_event);
     context_trigger_rule_entry_add_key(time_event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION,  CONTEXT_TRIGGER_TIME_OF_DAY);
    -context_trigger_rule_entry_add_comparison_int(time_event, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 16);
    +context_trigger_rule_entry_add_comparison_int(time_event, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 960);
     context_trigger_rule_entry_add_key(time_event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION,  CONTEXT_TRIGGER_DAY_OF_WEEK);
     context_trigger_rule_entry_add_comparison_string(time_event, CONTEXT_TRIGGER_DAY_OF_WEEK, CONTEXT_TRIGGER_EQUAL_TO, CONTEXT_TRIGGER_MON);
     
    @@ -560,7 +552,7 @@ context_trigger_rule_entry_add_comparison_string(battery_condition, CONTEXT_TRIG
     
     // Composing a condition "if the current time is between 18:30 and 21:30"
     context_trigger_rule_entry_h time_condition;
    -context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &time_condition);
    +context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &time_condition);
     context_trigger_rule_entry_add_key(time_condition, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION,  CONTEXT_TRIGGER_TIME_OF_DAY);
     context_trigger_rule_entry_add_comparison_int(time_condition, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_GREATER_THAN_OR_EQUAL_TO, 1110);
     context_trigger_rule_entry_add_comparison_int(time_condition, CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_LESS_THAN_OR_EQUAL_TO, 1290);
    -- 
    2.7.4