alarmui/group/alarmui_snooze.rul
branchRCL_3
changeset 23 51372538e3d3
parent 18 d68a4b5d5885
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alarmui/group/alarmui_snooze.rul	Sun Jun 20 22:55:39 2010 +0200
@@ -0,0 +1,39 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- If alarm is not active, nothing needs to be done -->
+    <if>
+        <equals>
+            <contextRef source='Alarm' type='Status.Active' value='false'/>
+        </equals>
+        <actions>
+            <!-- Do nothing -->
+        </actions>        
+    </if>
+    
+    <!-- Snooze alarm when device is turned upside down -->
+    <elseIf>
+        <and>
+            <!-- Check that turning interaction is set -->
+            <equals>
+            	   <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm'/>
+                 <string>On</string>
+            </equals>
+                 <!-- ...and previous orientation is not 'Undefined' ... -->
+            <notEqual>
+                 <contextRef source='Sensor' type='Event.Orientation.Previous'/>
+                 <string>Undefined</string>
+            </notEqual>
+                 <!-- ...and we receive a new orientation event from sensors... -->
+	    <contextChanged>
+	         <contextRef source='Sensor' type='Event.Orientation'/>
+	    </contextChanged>
+    	    <equals>
+                 <contextRef source='Sensor' type='Event.Orientation'/>
+                 <string>DisplayDownwards</string>
+    	    </equals>
+        </and>
+        <actions>
+           <!-- snooze the alarm -->
+            <AlarmUI.Snooze/>
+        </actions>
+    </elseIf>
+</script>
\ No newline at end of file