-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCordova.LocalModifications.pas
120 lines (97 loc) · 5.23 KB
/
Cordova.LocalModifications.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
unit Cordova.LocalModifications;
interface
uses
ECMA.Date, W3C.DOM4, W3C.Html5;
type
JScheduleArguments = class external
skipPermission: Boolean;
end;
JNotification = class external
id: Integer;
title: String;
text: String;
every: String;
everyAsInteger: Integer; external 'every';
at: JDate;
firtAt: JDate;
badge: Integer;
sound: String;
data: String;
// android only
icon: String;
smallIcon: String;
ongoing: Boolean;
autoClear: Boolean;
led: String;
ledOnTime: String;
ledOffTime: String;
color: String;
end;
TPresentCallback = procedure(present: Boolean);
TGetIDsCallback = procedure(ids: array of Integer);
TGetSingleCallback = procedure(notification: JNotification);
TGetCallback = procedure(notifications: array of JNotification);
JLocalNotification = class external 'cordova.plugins.notification.local'
procedure schedule(notifications: JNotification); overload;
procedure schedule(notifications: JNotification; callback: procedure); overload;
procedure schedule(notifications: JNotification; callback: procedure;
scope: Variant); overload;
procedure schedule(notifications: array of JNotification; callback: procedure;
scope: Variant; args: JScheduleArguments); overload;
procedure update(notifications: JNotification; callback: procedure); overload;
procedure update(notifications: JNotification; callback: procedure;
scope: Variant); overload;
procedure update(notifications: JNotification; callback: procedure;
scope: Variant; args: JScheduleArguments); overload;
procedure setDetaults(defaults: Variant);
function getDetaults: Variant;
procedure clear(id: array of String; callback: procedure; Scope: Variant); overload;
procedure clear(id: array of String; callback: procedure); overload;
procedure clearAll(callback: procedure; Scope: Variant); overload;
procedure clearAll(callback: procedure); overload;
procedure cancel(id: array of String; callback: procedure; Scope: Variant); overload;
procedure cancel(id: array of String; callback: procedure); overload;
procedure cancelAll(callback: procedure; Scope: Variant); overload;
procedure cancelAll(callback: procedure); overload;
procedure isPresent(id: String; callback: TPresentCallback; Scope: Variant); overload;
procedure isPresent(id: String; callback: TPresentCallback); overload;
procedure isScheduled(id: String; callback: TPresentCallback; Scope: Variant); overload;
procedure isScheduled(id: String; callback: TPresentCallback); overload;
procedure isTriggered(id: String; callback: TPresentCallback; Scope: Variant); overload;
procedure isTriggered(id: String; callback: TPresentCallback); overload;
procedure getAllIds(callback: TGetIDsCallback); overload;
procedure getAllIds(callback: TGetIDsCallback; Scope: Variant); overload;
procedure getIds(callback: TGetIDsCallback); overload;
procedure getIds(callback: TGetIDsCallback; Scope: Variant); overload;
procedure getScheduledIds(callback: TGetIDsCallback); overload;
procedure getScheduledIds(callback: TGetIDsCallback; Scope: Variant); overload;
procedure get(id: Integer; callback: TGetSingleCallback); overload;
procedure get(id: Integer; callback: TGetSingleCallback; Scope: Variant); overload;
procedure get(ids: array of Integer; callback: TGetCallback); overload;
procedure get(ids: array of Integer; callback: TGetCallback; Scope: Variant); overload;
procedure get(callback: TGetCallback); overload;
procedure get(callback: TGetCallback; Scope: Variant); overload;
procedure getAll(callback: TGetCallback); overload;
procedure getAll(callback: TGetCallback; Scope: Variant); overload;
procedure getScheduled(ids: array of Integer; callback: TGetCallback; Scope: Variant); overload;
procedure getScheduled(ids: array of Integer; callback: TGetCallback); overload;
procedure getScheduled(callback: TGetCallback; Scope: Variant); overload;
procedure getScheduled(callback: TGetCallback); overload;
procedure getAllScheduled(callback: TGetCallback; Scope: Variant); overload;
procedure getAllScheduled(callback: TGetCallback); overload;
procedure getTriggered(ids: array of Integer; callback: TGetCallback); overload;
procedure getTriggered(ids: array of Integer; callback: TGetCallback; Scope: Variant); overload;
procedure getTriggered(callback: TGetCallback); overload;
procedure getTriggered(callback: TGetCallback; Scope: Variant); overload;
procedure getAllTriggered(callback: TGetCallback); overload;
procedure getAllTriggered(callback: TGetCallback; Scope: Variant); overload;
procedure hasPermission(callback: procedure); overload;
procedure hasPermission(callback: procedure; Scope: Variant); overload;
procedure registerPermission(callback: procedure); overload;
procedure registerPermission(callback: procedure; Scope: Variant); overload;
procedure on(event: String; callback: TEventHandler); overload;
procedure on(event: String; callback: TEventHandler; Scope: Variant); overload;
procedure un(event: String; callback: TEventHandler);
end;
var
LocalNotification external 'cordova.plugins.notification.local': JLocalNotification;