summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxNotificationMessage.xml
blob: 14e3007174f3f761260480028ddfe212a1d79a47 (plain)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxNotificationMessage</title>
</header>
<module>wxNotificationMessage</module>
<modulesummary>Functions for wxNotificationMessage class</modulesummary>
<description><p>This class allows showing the user a message non intrusively.
      </p><p>Currently it is implemented natively for Windows, macOS, GTK and uses generic toast notifications under the other platforms. It's not recommended but <c>wxGenericNotificationMessage</c> can be used instead of the native ones. This might make sense if your application requires features not available in the native implementation.
      </p><p>Notice that this class is not a window and so doesn't derive from <seeerl marker="wxWindow"><c>wxWindow</c></seeerl>.
      </p><p>Platform Notes</p> <p>Par: Up to Windows 8 balloon notifications are displayed from an icon in the notification area of the taskbar. If your application uses a <seeerl marker="wxTaskBarIcon"><c>wxTaskBarIcon</c></seeerl> you should call <seemfa marker="#useTaskBarIcon/1"><c>useTaskBarIcon/1</c></seemfa> to ensure that only one icon is shown in the notification area. Windows 10 displays all notifications as popup toasts. To suppress the additional icon in the notification area on Windows 10 and for toast notification support on Windows 8 it is recommended to call <seemfa marker="#mSWUseToasts/1"><c>mSWUseToasts/1</c></seemfa> before showing the first notification message.
      </p><p>Par: The macOS implementation uses Notification Center to display native notifications. In order to use actions your notifications must use the alert style. This can be enabled by the user in system settings or by setting the <c>NSUserNotificationAlertStyle</c> value in Info.plist to <c>alert</c>. Please note that the user always has the option to change the notification style.
      </p><p>Since: 2.9.0 
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxEvtHandler"><c>wxEvtHandler</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_notification_message.html">wxNotificationMessage</url></p>
  </description><section><title>Events</title><p>Event types emitted from this class: <seeerl marker="wxCommandEvent"><c>notification_message_click</c></seeerl>, <seeerl marker="wxCommandEvent"><c>notification_message_dismissed</c></seeerl>, <seeerl marker="wxCommandEvent"><c>notification_message_action</c></seeerl></p></section>
<datatypes><datatype><name name="wxNotificationMessage"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>Default constructor, use <c>setParent/2</c>, <c>setTitle/2</c> and <c>setMessage/2</c> to initialize the object before showing it. </fsummary>
    <desc><p>Default constructor, use <seemfa marker="#setParent/2"><c>setParent/2</c></seemfa>, <seemfa marker="#setTitle/2"><c>setTitle/2</c></seemfa> and <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa> to initialize the object before showing it. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>new/2</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="2" clause_i="1" since=""/>
    <fsummary>Create a notification object with the given attributes. </fsummary>
    <desc><p>Create a notification object with the given attributes. 
      </p><p>See <seemfa marker="#setTitle/2"><c>setTitle/2</c></seemfa>, <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa>, <seemfa marker="#setParent/2"><c>setParent/2</c></seemfa> and <seemfa marker="#setFlags/2"><c>setFlags/2</c></seemfa> for the description of the corresponding parameters. 
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor does not hide the notification. </fsummary>
    <desc><p>Destructor does not hide the notification. 
      </p><p>The notification can continue to be shown even after the C++ object was destroyed, call <seemfa marker="#close/1"><c>close/1</c></seemfa> explicitly if it needs to be hidden. 
      </p></desc>
  </func>
  
  <func>
    <name name="addAction" arity="2" clause_i="1" since=""/>
    <fsummary>See: <c>addAction/3</c></fsummary>
  </func>
  
  <func>
    <name name="addAction" arity="3" clause_i="1" since=""/>
    <fsummary>Add an action to the notification. </fsummary>
    <desc><p>Add an action to the notification. 
      </p><p>If supported by the implementation this are usually buttons in the notification selectable by the user.
      </p><p>Return: false if the current implementation or OS version does not support actions in notifications.
      </p><p>Since: 3.1.0 
      </p></desc>
  </func>
  
  <func>
    <name name="close" arity="1" clause_i="1" since=""/>
    <fsummary>Hides the notification. </fsummary>
    <desc><p>Hides the notification. 
      </p><p>Returns true if it was hidden or false if it couldn't be done (e.g. on some systems automatically hidden notifications can't be hidden manually). 
      </p></desc>
  </func>
  
  <func>
    <name name="setFlags" arity="2" clause_i="1" since=""/>
    <fsummary>This parameter can be currently used to specify the icon to show in the notification. </fsummary>
    <desc><p>This parameter can be currently used to specify the icon to show in the notification. 
      </p><p>Valid values are <c>wxICON_INFORMATION</c>, <c>wxICON_WARNING</c> and <c>wxICON_ERROR</c> (notice that <c>wxICON_QUESTION</c> is not allowed here). Some implementations of this class may not support the icons.
      </p><p>See: <seemfa marker="#setIcon/2"><c>setIcon/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setIcon" arity="2" clause_i="1" since=""/>
    <fsummary>Specify a custom icon to be displayed in the notification. </fsummary>
    <desc><p>Specify a custom icon to be displayed in the notification. 
      </p><p>Some implementations of this class may not support custom icons.
      </p><p>See: <seemfa marker="#setFlags/2"><c>setFlags/2</c></seemfa>
      </p><p>Since: 3.1.0 
      </p></desc>
  </func>
  
  <func>
    <name name="setMessage" arity="2" clause_i="1" since=""/>
    <fsummary>Set the main text of the notification. </fsummary>
    <desc><p>Set the main text of the notification. 
      </p><p>This should be a more detailed description than the title but still limited to reasonable length (not more than 256 characters). 
      </p></desc>
  </func>
  
  <func>
    <name name="setParent" arity="2" clause_i="1" since=""/>
    <fsummary>Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default. </fsummary>
    <desc><p>Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default. 
      </p></desc>
  </func>
  
  <func>
    <name name="setTitle" arity="2" clause_i="1" since=""/>
    <fsummary>Set the title, it must be a concise string (not more than 64 characters), use <c>setMessage/2</c> to give the user more details. </fsummary>
    <desc><p>Set the title, it must be a concise string (not more than 64 characters), use <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa> to give the user more details. 
      </p></desc>
  </func>
  
  <func>
    <name name="show" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>show/2</c></fsummary>
  </func>
  
  <func>
    <name name="show" arity="2" clause_i="1" since=""/>
    <fsummary>Show the notification to the user and hides it after <c>timeout</c> seconds are elapsed. </fsummary>
    <desc><p>Show the notification to the user and hides it after <c>timeout</c> seconds are elapsed. 
      </p><p>Special values <c>Timeout_Auto</c> and <c>Timeout_Never</c> can be used here, notice that you shouldn't rely on <c>timeout</c> being exactly respected because the current platform may only support default timeout value and also because the user may be able to close the notification.
      </p><p>Note: When using native notifications in wxGTK, the timeout is ignored for the notifications with <c>wxICON_WARNING</c> or <c>wxICON_ERROR</c> flags, they always remain shown unless they're explicitly hidden by the user, i.e. behave as if Timeout_Auto were given.
      </p><p>Return: false if an error occurred. 
      </p></desc>
  </func>
  
  <func>
    <name name="useTaskBarIcon" arity="1" clause_i="1" since=""/>
    <fsummary>If the application already uses a <c>wxTaskBarIcon</c>, it should be connected to notifications by using this method. </fsummary>
    <desc><p>If the application already uses a <seeerl marker="wxTaskBarIcon"><c>wxTaskBarIcon</c></seeerl>, it should be connected to notifications by using this method. 
      </p><p>This has no effect if toast notifications are used.
      </p><p>Return: the task bar icon which was used previously (may be <c>NULL</c>)
      </p><p>Only for:wxmsw</p></desc>
  </func>
  
  <func>
    <name name="mSWUseToasts" arity="0" clause_i="1" since=""/>
    <fsummary>See: <c>mSWUseToasts/1</c></fsummary>
  </func>
  
  <func>
    <name name="mSWUseToasts" arity="1" clause_i="1" since=""/>
    <fsummary>Enables toast notifications available since Windows 8 and suppresses the additional icon in the notification area on Windows 10. </fsummary>
    <desc><p>Enables toast notifications available since Windows 8 and suppresses the additional icon in the notification area on Windows 10. 
      </p><p>Toast notifications <c>require</c> a shortcut to the application in the start menu. The start menu shortcut needs to contain an Application User Model ID. It is recommended that the applications setup creates the shortcut and the application specifies the setup created shortcut in <c>shortcutPath</c>. A call to this method will verify (and if necessary modify) the shortcut before enabling toast notifications.
      </p><p>Return: false if toast notifications could not be enabled.
      </p><p>Only for:wxmsw</p><p>See: <c>wxAppConsole::SetAppName()</c> (not implemented in wx), <c>wxAppConsole::SetVendorName()</c> (not implemented in wx)
      </p><p>Since: 3.1.0 
      </p></desc>
  </func>
  </funcs>
</erlref>