Initial sdk doc import #18

Merged
merged 3 commits into from Nov 8, 2017
The table of contents is too big for display.
+103,828 −3
Split
View
@@ -10,10 +10,12 @@ Luckily, there are some utilities and alternatives that allow us to build click
Ubuntu UI-Toolkit
-----------------
-We decided not to import the documentation pages for all unmaintained components, instead we are working continuously on replacing parts where necessary with more sustainable solutions. The old documentation pages written by Canonical can be found `here <https://docs.ubuntu.com/phone/en/>`_.
+.. toctree::
+ :maxdepth: 1
+ :name: toc-appdev-sdk
-* `QML API <https://docs.ubuntu.com/phone/en/apps/api-qml-development/index>`__
-* `Cordova HTML5 API <https://docs.ubuntu.com/phone/en/apps/api-html5-development/index>`__
+ /sdk/apps/qml/index
+ /sdk/apps/html5/index
Clickable
---------
View
@@ -39,3 +39,4 @@ On this website you find instructions how to install Ubuntu Touch on your mobile
:name: sec-appdev
appdev/index
+ sdk/index
@@ -0,0 +1,171 @@
+.. _sdk_alarmapi_alarm:
+
+AlarmApi Alarm
+==============
+
+
+An Alarm.
+
+**Alarm**\ ()
+
+.. code:: html
+
+ var date = new Date();
+ <set a valid date in the future>
+
+ var api = external.getUnityObject('1.0');
+ api.AlarmApi.api.createAndSaveAlarmFor(
+ date,
+ api.AlarmApi.AlarmType.OneTime,
+ api.AlarmApi.AlarmDayOfWeek.AutoDetect,
+ "alarm triggered",
+ function(errorid) {
+ console.log(api.AlarmApi.api.errorToMessage(errorid));
+ });
+
+- Methods
+
+**cancel**\ ()
+Cancels a given Alarm.
+
+**daysOfWeek**\ (``callback``)
+Retrieves the alarm day of the week.
+
+The property holds the days of the week the alarm is scheduled. This property can have only one day set for one time alarms and multiple days for repeating alarms.
+
+**Parameters:**
+
+- ``callback`` **<Function(AlarmType)>**
+
+**destroy**\ ()
+Destroys the remote object. This proxy object is not valid anymore.
+
+**enabled**\ (``callback``)
+Retrieves the alarm's enabled state.
+
+The property specifies whether the alarm is enabled or not. Disable dalarms are not scheduled. The default value is true
+
+**Parameters:**
+
+- ``callback`` **<Function(Boolean)>**
+
+**error**\ (``callback``)
+The property holds the error code occurred during the last performed operation.
+
+**Parameters:**
+
+- ``callback`` **<Function(Error)>**
+
+**error**\ (``callback``)
+Retrieves the alarm date.
+
+The date property holds the date the alarm will be triggered. The default value is the current date and time the alarm object was created. Further reset calls will bring the value back to the time the reset was called.
+
+**Parameters:**
+
+- ``callback`` **<Function(Date)>**
+
+**message**\ (``callback``)
+Retrieves the alarm message.
+
+The property holds the message string which will be displayed when the alarm is triggered. The default value is the localized "Alarm" text
+
+**Parameters:**
+
+- ``callback`` **<Function(String)>**
+
+**reset**\ ()
+Resets a given Alarm.
+
+**save**\ ()
+Saves the alarm as a system wide alarm with the parameters previously set.
+
+**setDate**\ (``date, callback``)
+Sets the alarm date.
+
+**Parameters:**
+
+- ``date`` **<Date>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the date is set.
+
+**setDaysOfWeek**\ (``daysOfWeek, callback``)
+Sets the alarm day of the week.
+
+**Parameters:**
+
+- ``daysOfWeek`` **<AlarmDayOfWeek>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the day of the week is set.
+
+**setEnabled**\ (``enabled, callback``)
+Sets the alarm's enabled state.
+
+**Parameters:**
+
+- ``enabled`` **<Boolean>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the enabled state is set.
+
+**setMessage**\ (``message, callback``)
+Sets the alarm message.
+
+**Parameters:**
+
+- ``message`` **<String>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the message is set.
+
+**setSound**\ (``sound, callback``)
+Sets the alarm sound.
+
+**Parameters:**
+
+- ``sound`` **<String>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the sound is set.
+
+**setType**\ (``type, callback``)
+Sets the alarm type.
+
+**Parameters:**
+
+- ``type`` **<AlarmType>**
+- ``callback`` **<Function()>**
+
+ (optional) To be called after the type is set.
+
+**sound**\ (``callback``)
+Retrieves the alarm sound.
+
+The property holds the alarm's sound to be played when the alarm is triggered. An empty url will mean to play the default sound.
+
+The default value is an empty url.
+
+**Parameters:**
+
+- ``callback`` **<Function(String)>**
+
+**status**\ (``callback``)
+Retrieves the alarm status.
+
+The property holds the status of the last performed operation
+
+**Parameters:**
+
+- ``callback`` **<Function(String)>**
+
+**type**\ (``callback``)
+Retrieves the alarm type.
+
+The property holds the type of the alarm. The default value is AlarmType.OneTime
+
+**Parameters:**
+
+- ``callback`` **<Function(AlarmType)>**
+
@@ -0,0 +1,158 @@
+.. _sdk_alarmapi_alarmapi:
+
+AlarmApi AlarmApi
+=================
+
+
+The AlarmApi object
+
+**AlarmApi**\ ()
+
+.. code:: html
+
+ var date = new Date();
+ <set a valid date in the future>
+
+ var api = external.getUnityObject('1.0');
+ api.AlarmApi.api.createAndSaveAlarmFor(
+ date,
+ api.AlarmApi.AlarmType.OneTime,
+ api.AlarmApi.AlarmDayOfWeek.AutoDetect,
+ "alarm triggered",
+ function(errorid) {
+ console.log(api.AlarmApi.api.errorToMessage(errorid));
+ });
+
+- Methods
+- Properties
+
+**api.createAndSaveAlarmFor**\ (``date, type, daysOfWeek, message, callback``)
+Creates and saves a new alarm.
+
+**Parameters:**
+
+- ``date`` **<Date>**
+
+ date at which the alarm is to be triggered.
+
+- ``type`` **<AlarmType>**
+
+ type of the alarm.
+
+- ``daysOfWeek`` **<AlarmDayOfWeek>**
+
+ days of the week the alarm is scheduled.
+
+- ``message`` **<String>**
+
+ Message to be displayed when the alarm is triggered.
+
+- ``callback`` **<Function(AlarmError)>**
+
+ (optional) Function to be called when the alarm has been saved.
+
+**api.errorToMessage**\ (``error``)
+Returns a message adapted to the given error id.
+
+**Parameters:**
+
+- ``error`` **<AlarmError>**
+
+ error id.
+
+**createAlarm**\ (``callback``)
+Creates a Alarm object.
+
+**Parameters:**
+
+- ``callback`` **<Function(Alarm)>**
+
+ Function called with the created Alarm.
+
+``AlarmDayOfWeek`` <**Integer**> *(static)*
+Flags for the week days an Alarm should be triggered.
+
+Values:
+
+.. code:: html
+
+ Monday: The alarm will kick on Mondays
+
+ Tuesday: The alarm will kick on Tuesdays
+
+ Wednesday: The alarm will kick on Wednesday
+
+ Thursday: The alarm will kick on Thursday
+
+ Friday: The alarm will kick on Friday
+
+ Saturday: The alarm will kick on Saturday
+
+ Sunday: The alarm will kick on Sunday
+
+ AutoDetect: The alarm day will be detected
+ from the alarm date.
+
+.. code:: html
+
+ var api = external.getUnityObject('1.0');
+ var dayofweek = api.AlarmApi.AlarmDayOfWeek;
+ // use dayofweek.Monday or/and dayofweek.Tuesday, etc.
+
+``AlarmError`` <**Integer**> *(static)*
+Error ids returned during AlarmApi calls.
+
+Values:
+
+.. code:: html
+
+ NoError: Successful operation completion
+
+ InvalidDate: The date specified for the alarm was invalid
+
+ EarlyDate: The date specified for the alarm is an earlier
+ date than the current one
+
+ NbDaysOfWeek: The daysOfWeek parameter of the alarm was not specified
+
+ OneTimeOnMoreDays: The one-time alarm was set to be kicked in several days
+
+ InvalidEvent: The alarm event is invalid
+
+ AdaptationError: The error occurred in alarm adaptation layer.
+ Adaptations may define additional behind this value
+
+.. code:: html
+
+ var date = new Date();
+ <set a valid date in the future>
+
+ var api = external.getUnityObject('1.0');
+ api.AlarmApi.api.createAndSaveAlarmFor(
+ date,
+ api.AlarmApi.AlarmType.OneTime,
+ api.AlarmApi.AlarmDayOfWeek.AutoDetect,
+ "alarm triggered",
+ function(errorid) {
+ console.log(api.AlarmApi.api.errorToMessage(errorid));
+ });
+
+``AlarmType`` <**Object**> *(static)*
+Enumeration of the available types of Alarm.
+
+Values:
+
+.. code:: html
+
+ OneTime: The alarm occurs only once
+
+ Repeating: The alarm is a repeating one,
+ either daily, weekly on a given day
+ or on selected days
+
+.. code:: html
+
+ var api = external.getUnityObject('1.0');
+ var alarmtype = api.AlarmApi.AlarmType;
+ // use alarmtype.OneTime or alarmtype.Repeating
+
@@ -0,0 +1,8 @@
+AlarmApi
+========
+
+.. toctree::
+ :maxdepth: 1
+
+ Alarm
+ AlarmApi
Oops, something went wrong.