PageRenderTime 13ms CodeModel.GetById 7ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/titanium/mobile/android/NotificationManager.hx

http://github.com/visup/haxe-titanium-api
Haxe | 87 lines | 21 code | 5 blank | 61 comment | 0 complexity | fee795b50cb123b071bf1418c9325b24 MD5 | raw file
 1package titanium.mobile.android;
 2
 3
 4/**
 5NotificationManager class
 6
 7Documentation available at:
 8http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Android.NotificationManager-module
 9
10- namespace
11
12Titanium.Android.NotificationManager
13
14- type
15
16module
17
18- description
19
20Module to notify users of events that happen. It is a thin wrapper on [NotificationManager](http://developer.android.com/reference/android/app/NotificationManager.html).
21
22- since
23
241.5
25
26- platforms
27
28android
29
30- methods
31cancel: Cancel a previously shown notification.
32cancelAll: Cancel all previously shown notifications.
33notify: Add a persistent notification to the status bar.
34
35- method : cancel
36id[int]: The id you assigned to a notification.
37
38- method : cancelAll
39
40- method : notify
41id[int] : An id that may be used to cancel a shown notification.
42notification[`Titanium.Android.Notification`] : An instance of `Titanium.Android.Notification` created with `Titanium.Android.createNotification`.
43
44- properties
45
46DEFAULT_ALL[int] : Use all default values (where applicable).
47DEFAULT_LIGHTS[int] : Use the default notification lights.
48DEFAULT_SOUND[int] : Use the default notification sound.
49DEFAULT_VIBRATE[int] : Use the default notification vibrate.
50FLAG_AUTO_CANCEL[int] : Bit to be bitwise-ored into the flags field that should be set if the notification should be canceled when it is clicked by the user.
51FLAG_INSISTENT[int] : Bit to be bitwise-ored into the flags field that if set, the audio will be repeated until the notification is cancelled or the notification window is opened.
52FLAG_NO_CLEAR[int] : Bit to be bitwise-ored into the flags field that should be set if the notification should not be canceled when the user clicks the Clear all button.
53FLAG_ONGOING_EVENT[int] : Bit to be bitwise-ored into the flags field that should be set if this notification is in reference to something that is ongoing, like a phone call.
54FLAG_ONLY_ALERT_ONCE[int] : Bit to be bitwise-ored into the flags field that should be set if you want the sound and/or vibration play each time the notification is sent, even if it has not been canceled before that.
55FLAG_SHOW_LIGHTS[int] : Bit to be bitwise-ored into the flags field that should be set if you want the LED on for this notification.
56STREAM_DEFAULT[int] : Use this constant as the value for audioStreamType to request that the default stream type for notifications be used.
57
58- notes
59
60The constants above are taken from [Notification](http://developer.android.com/reference/android/app/Notification.html).
61
62**/
63
64#if androidos
65@:native("Titanium.Android.NotificationManager")
66extern class NotificationManager
67{		
68	// constants
69	public static var DEFAULT_ALL:Int;
70	public static var DEFAULT_LIGHTS:Int;
71	public static var DEFAULT_SOUND:Int;
72	public static var DEFAULT_VIBRATE:Int;
73	public static var FLAG_AUTO_CANCEL:Int;
74	public static var FLAG_INSISTENT:Int;
75	public static var FLAG_NO_CLEAR:Int;
76	public static var FLAG_ONGOING_EVENT:Int;
77	public static var FLAG_ONLY_ALERT_ONCE:Int;
78	public static var FLAG_SHOW_LIGHTS:Int;
79	public static var STREAM_DEFAULT:Int;
80
81	// static methods
82	public static function cancel(id:Int):Void;
83	public static function cancelAll():Void;
84	public static function notify(id:Int, notification:Notification):Void;
85
86}
87#end