[context][ACR-272] Updated context trigger event/condition enumerations
authorSomin Kim <somin926.kim@samsung.com>
Fri, 12 Jun 2015 07:07:29 +0000 (16:07 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Fri, 12 Jun 2015 07:07:29 +0000 (16:07 +0900)
Change-Id: I5ad47198fd81ff8b870802df2f60f72f58dd7011
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
org.tizen.guides/html/native/context/trigger_n.htm

index 8e60518..9f6fb7d 100644 (file)
@@ -108,14 +108,14 @@ context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &amp;rule);
 </pre></li>
 
 <li>Define the event (&quot;at 10 PM every day&quot;). 
-<p>A <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_ON_TIME</span> type event entry is created, and a key-value comparison of <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY == 22</span> is set to the event.
+<p>A <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_TIME</span> type event entry is created, and a key-value comparison of <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY == 1320</span> is set to the event.
 </p>
 <pre class="prettyprint">
 // Composing an event
 context_trigger_rule_entry_h event = NULL;
-context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &amp;event);
+context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &amp;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);
                        <th>Valid operands</th>
                </tr>
                <tr>
-                       <td rowspan="2"><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_ON_TIME</span></td>
+                       <td rowspan="2"><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_TIME</span></td>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY</span></td>
                        <td>Integer</td>
-                       <td>From 0 to 23 (hour)</td>
+                       <td>From 0 to 1439 (minute)</td>
                </tr>
                <tr>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_DAY_OF_WEEK</span></td>
@@ -167,13 +167,12 @@ context_trigger_rule_entry_destroy(condition);
                        </span></td>
                </tr>
                <tr>
-                       <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY</span></td>
+                       <td rowspan="3"><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_TIME</span></td>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY</span></td>
                        <td>Integer</td>
                        <td>From 0 to 1439 (minute)</td>
                </tr>
                <tr>
-                       <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_DAY_OF_WEEK</span></td>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_DAY_OF_WEEK</span></td>
                        <td>String</td>
                        <td><span style="font-family: Courier New,Courier,monospace">
@@ -182,7 +181,6 @@ context_trigger_rule_entry_destroy(condition);
                        </span></td>
                </tr>
                <tr>
-                       <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_DAY_OF_MONTH</span></td>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_DAY_OF_MONTH</span></td>
                        <td>Integer</td>
                        <td>From 1 to 31</td>
@@ -214,14 +212,8 @@ context_trigger_rule_entry_destroy(condition);
                </tr>
                <tr>
                        <td>
-                               <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_FLIGHT_MODE</span>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE</span></p>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_SILENT_MODE</span></p>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_VIBRATION_MODE</span></p>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_FLIGHT_MODE</span></p>
+                               <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE</span>
                                <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE</span></p>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_SILENT_MODE</span></p>
-                               <p><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_CONDITION_VIBRATION_MODE</span></p>
                        </td>
                        <td><span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_IS_ENABLED</span></td>
                        <td>Integer</td>
@@ -523,16 +515,16 @@ context_trigger_rule_set_action_notification(disjunction_rule, ...);
 
 <li>Combining attributes into an event or condition
 
-<p>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 <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_ON_TIME</span> to define a rule &quot;at 4 PM every Monday&quot;, the comparisons regarding the 2 attributes, <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY</span> and <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_DAY_OF_WEEK</span> must be satisfied together.</p>
+<p>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 <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_EVENT_TIME</span> to define a rule &quot;at 4 PM every Monday&quot;, the comparisons regarding the 2 attributes, <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TIME_OF_DAY</span> and <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_DAY_OF_WEEK</span> must be satisfied together.</p>
 <p>On the contrary, using <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_APP_USE_FREQUENCY</span>, 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 <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_RANK</span> and <span style="font-family: Courier New,Courier,monospace">CONTEXT_TRIGGER_TOTAL_COUNT</span> must be connected by a logical disjunction.</p>
 <p>The following example illustrates the cases described above:</p>
 
 <pre class="prettyprint">
 // Composing an event &quot;at 4 PM every Monday&quot;
 context_trigger_rule_entry_h time_event;
-context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, <span class="highlight">CONTEXT_TRIGGER_LOGICAL_CONJUNCTION</span>, &amp;time_event);
+context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_TIME, <span class="highlight">CONTEXT_TRIGGER_LOGICAL_CONJUNCTION</span>, &amp;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 &quot;if the current time is between 18:30 and 21:30&quot;
 context_trigger_rule_entry_h time_condition;
-context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &amp;time_condition);
+context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &amp;time_condition);
 context_trigger_rule_entry_add_key(time_condition, <span class="highlight">CONTEXT_TRIGGER_LOGICAL_CONJUNCTION</span>,  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);