1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _adv.sip
8//
9//---------------------------------------------------------------------------
10
11%ModuleHeaderCode
12#include <wx/taskbar.h>
13%End
14
15
16//---------------------------------------------------------------------------
17
18enum wxTaskBarIconType
19{
20    wxTBI_DOCK,
21    wxTBI_CUSTOM_STATUSITEM,
22    wxTBI_DEFAULT_TYPE
23};
24
25wxEventType wxEVT_TASKBAR_MOVE   /PyName=wxEVT_TASKBAR_MOVE/;
26
27wxEventType wxEVT_TASKBAR_LEFT_DOWN   /PyName=wxEVT_TASKBAR_LEFT_DOWN/;
28
29wxEventType wxEVT_TASKBAR_LEFT_UP   /PyName=wxEVT_TASKBAR_LEFT_UP/;
30
31wxEventType wxEVT_TASKBAR_RIGHT_DOWN   /PyName=wxEVT_TASKBAR_RIGHT_DOWN/;
32
33wxEventType wxEVT_TASKBAR_RIGHT_UP   /PyName=wxEVT_TASKBAR_RIGHT_UP/;
34
35wxEventType wxEVT_TASKBAR_LEFT_DCLICK   /PyName=wxEVT_TASKBAR_LEFT_DCLICK/;
36
37wxEventType wxEVT_TASKBAR_RIGHT_DCLICK   /PyName=wxEVT_TASKBAR_RIGHT_DCLICK/;
38
39wxEventType wxEVT_TASKBAR_CLICK   /PyName=wxEVT_TASKBAR_CLICK/;
40
41wxEventType wxEVT_TASKBAR_BALLOON_TIMEOUT   /PyName=wxEVT_TASKBAR_BALLOON_TIMEOUT/;
42
43wxEventType wxEVT_TASKBAR_BALLOON_CLICK   /PyName=wxEVT_TASKBAR_BALLOON_CLICK/;
44
45class wxTaskBarIconEvent : wxEvent
46{
47    %Docstring
48        TaskBarIconEvent(evtType, tbIcon)
49
50        The event class used by wxTaskBarIcon.
51    %End
52    %TypeHeaderCode
53        #include <wx/taskbar.h>
54    %End
55
56public:
57    wxTaskBarIconEvent(
58        wxEventType evtType,
59        wxTaskBarIcon * tbIcon
60    );
61
62    public:
63    virtual wxEvent* Clone() const /Factory/;
64
65
66    private:
67        wxTaskBarIconEvent& operator=(const wxTaskBarIconEvent&);
68
69
70};  // end of class wxTaskBarIconEvent
71
72
73class wxTaskBarIcon : wxEvtHandler
74{
75    %Docstring
76        TaskBarIcon(iconType=TBI_DEFAULT_TYPE)
77
78        This class represents a taskbar icon.
79    %End
80    %TypeHeaderCode
81        #include <wx/taskbar.h>
82    %End
83
84public:
85    wxTaskBarIcon(
86        wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE
87    );
88    %PreMethodCode
89        if (!wxPyCheckForApp()) return NULL;
90    %End
91
92    virtual
93    ~wxTaskBarIcon();
94
95    void Destroy()   /TransferThis/;
96    %Docstring
97        Destroy()
98
99        This method is similar to wxWindow::Destroy and can be used to
100        schedule the task bar icon object for the delayed destruction: it will
101        be deleted during the next event loop iteration, which allows the task
102        bar icon to process any pending events for it before being destroyed.
103    %End
104
105    bool IsIconInstalled() const;
106    %Docstring
107        IsIconInstalled() -> bool
108
109        Returns true if SetIcon() was called with no subsequent RemoveIcon().
110    %End
111
112    bool IsOk() const;
113    %Docstring
114        IsOk() -> bool
115
116        Returns true if the object initialized successfully.
117    %End
118
119    virtual
120    bool PopupMenu(
121        wxMenu * menu
122    );
123    %Docstring
124        PopupMenu(menu) -> bool
125
126        Pops up a menu at the current mouse position.
127    %End
128
129    virtual
130    bool RemoveIcon();
131    %Docstring
132        RemoveIcon() -> bool
133
134        Removes the icon previously set with SetIcon().
135    %End
136
137    virtual
138    bool SetIcon(
139        const wxIcon & icon,
140        const wxString & tooltip = wxEmptyString
141    );
142    %Docstring
143        SetIcon(icon, tooltip=wx.EmptyString) -> bool
144
145        Sets the icon, and optional tooltip text.
146    %End
147
148    static
149    bool IsAvailable();
150    %Docstring
151        IsAvailable() -> bool
152
153        Returns true if system tray is available in the desktop environment
154        the app runs under.
155    %End
156
157    bool ShowBalloon(const wxString& title,  const wxString& text, unsigned msec = 0,  int flags = 0);
158    %Docstring
159        ShowBalloon(title, text, msec=0, flags=0) -> bool
160
161        Show a balloon notification (the icon must have been already
162        initialized using SetIcon).  Only implemented for Windows.
163
164        The ``title`` and ``text`` parameters are limited to 63 and 255
165        characters respectively, ``msec`` is the timeout, in milliseconds,
166        before the balloon disappears (will be clamped down to the allowed
167        10-30s range by Windows if it's outside it) and ``flags`` can
168        include wxICON_ERROR/INFO/WARNING to show a corresponding icon.
169
170        Returns ``True`` if balloon was shown, ``False`` on error (incorrect
171        parameters or function unsupported by OS).
172    %End
173    %MethodCode
174        PyErr_Clear();
175        Py_BEGIN_ALLOW_THREADS
176        sipRes = _wxTaskBarIcon_ShowBalloon(sipCpp, title, text, msec, flags);
177        Py_END_ALLOW_THREADS
178        if (PyErr_Occurred()) sipIsErr = 1;
179    %End
180    %TypeCode
181    bool _wxTaskBarIcon_ShowBalloon(wxTaskBarIcon* self, const wxString* title, const wxString* text, unsigned msec, int flags)
182    {
183        #ifdef __WXMSW__
184            return self->ShowBalloon(*title, *text, msec, flags);
185        #else
186            return false;
187        #endif
188    }
189    %End
190
191    public:
192
193
194
195protected:
196    virtual
197    wxMenu * CreatePopupMenu()   /Transfer/;
198    %Docstring
199        CreatePopupMenu() -> wx.Menu
200
201        This method is called by the library when the user requests popup menu
202        (on Windows and Unix platforms, this is when the user right-clicks the
203        icon).
204    %End
205    %VirtualCatcherCode
206        // VirtualCatcherCode for wxTaskBarIcon.CreatePopupMenu
207        PyObject *sipResObj = sipCallMethod(0, sipMethod, "");
208        if (!sipResObj || sipParseResult(0, sipMethod, sipResObj, "H0", sipType_wxMenu, &sipRes) < 0)
209            PyErr_Print();
210        if (sipRes) {
211            sipTransferTo(sipResObj, Py_None);
212        }
213    %End
214
215};  // end of class wxTaskBarIcon
216
217
218%Extract(id=pycode_adv)
219EVT_TASKBAR_MOVE = wx.PyEventBinder (         wxEVT_TASKBAR_MOVE )
220EVT_TASKBAR_LEFT_DOWN = wx.PyEventBinder (    wxEVT_TASKBAR_LEFT_DOWN )
221EVT_TASKBAR_LEFT_UP = wx.PyEventBinder (      wxEVT_TASKBAR_LEFT_UP )
222EVT_TASKBAR_RIGHT_DOWN = wx.PyEventBinder (   wxEVT_TASKBAR_RIGHT_DOWN )
223EVT_TASKBAR_RIGHT_UP = wx.PyEventBinder (     wxEVT_TASKBAR_RIGHT_UP )
224EVT_TASKBAR_LEFT_DCLICK = wx.PyEventBinder (  wxEVT_TASKBAR_LEFT_DCLICK )
225EVT_TASKBAR_RIGHT_DCLICK = wx.PyEventBinder ( wxEVT_TASKBAR_RIGHT_DCLICK )
226EVT_TASKBAR_CLICK =  wx.PyEventBinder (       wxEVT_TASKBAR_CLICK )
227EVT_TASKBAR_BALLOON_TIMEOUT = wx.PyEventBinder ( wxEVT_TASKBAR_BALLOON_TIMEOUT )
228EVT_TASKBAR_BALLOON_CLICK = wx.PyEventBinder ( wxEVT_TASKBAR_BALLOON_CLICK )
229
230%End
231
232
233//---------------------------------------------------------------------------
234
235