-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCore.UI.Notifications.pas
More file actions
44 lines (33 loc) · 1.5 KB
/
Core.UI.Notifications.pas
File metadata and controls
44 lines (33 loc) · 1.5 KB
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
unit Core.UI.Notifications;
interface
type
TNotificationFlag = (nfInfo, nfWarning, nfError);
TNotificationFlags = set of TNotificationFlag;
TNotificationCallback = procedure(Sender: TObject; Value: Integer) of object;
INotification = interface
function _GetTitle: string;
procedure _SetTitle(const Value: string);
function Notify(Msg: string): Boolean; overload;
function Notify(Msg: string; Callback: TNotificationCallback): Boolean; overload;
function Notify(Msg: string; Flags: TNotificationFlags): Boolean; overload;
function Notify(Msg: string; Flags: TNotificationFlags; Callback: TNotificationCallback): Boolean; overload;
function Notify(Msg: string; Title: string): Boolean; overload;
function Notify(Msg: string; Title: string; Flags: TNotificationFlags): Boolean; overload;
function Notify(Msg: string; Title: string; Flags: TNotificationFlags; Callback: TNotificationCallback): Boolean; overload;
property Title: string read _GetTitle write _SetTitle;
end;
TNotificationService = class
private class
var FNotification: INotification;
class function GetIsAvailable: Boolean; static;
public
class property Notification: INotification read FNotification write FNotification;
class property IsAvailable: Boolean read GetIsAvailable;
end;
implementation
{ TNotificationService }
class function TNotificationService.GetIsAvailable: Boolean;
begin
Result := Assigned(FNotification);
end;
end.