1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-11-21 23:39:26 +00:00
|
|
|
// File: wx/msw/taskbar.h
|
|
|
|
// Purpose: Defines wxTaskBarIcon class for manipulating icons on the
|
1998-05-20 14:12:05 +00:00
|
|
|
// Windows task bar.
|
|
|
|
// Author: Julian Smart
|
2004-03-23 23:20:16 +00:00
|
|
|
// Modified by: Vaclav Slavik
|
1998-05-20 14:12:05 +00:00
|
|
|
// Created: 24/3/98
|
2001-11-21 23:39:26 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
#ifndef _WX_TASKBAR_H_
|
|
|
|
#define _WX_TASKBAR_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2003-01-25 12:28:51 +00:00
|
|
|
#include "wx/icon.h"
|
|
|
|
|
2004-03-23 23:20:16 +00:00
|
|
|
// private helper class:
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_ADV wxTaskBarIconWindow;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
class WXDLLIMPEXP_ADV wxTaskBarIcon : public wxTaskBarIconBase
|
2003-04-04 22:33:47 +00:00
|
|
|
{
|
1998-05-20 14:12:05 +00:00
|
|
|
public:
|
2012-04-20 05:41:54 +00:00
|
|
|
wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE);
|
2004-03-23 23:20:16 +00:00
|
|
|
virtual ~wxTaskBarIcon();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
// Accessors
|
|
|
|
bool IsOk() const { return true; }
|
|
|
|
bool IsIconInstalled() const { return m_iconAdded; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
// Operations
|
2016-09-23 14:59:11 +00:00
|
|
|
bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString) wxOVERRIDE;
|
|
|
|
bool RemoveIcon(void) wxOVERRIDE;
|
|
|
|
bool PopupMenu(wxMenu *menu) wxOVERRIDE;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-12-01 16:25:30 +00:00
|
|
|
// MSW-specific class methods
|
|
|
|
|
2007-12-08 20:51:21 +00:00
|
|
|
#if wxUSE_TASKBARICON_BALLOONS
|
2007-12-01 16:25:30 +00:00
|
|
|
// show a balloon notification (the icon must have been already initialized
|
|
|
|
// using SetIcon)
|
|
|
|
//
|
|
|
|
// title and text are limited to 63 and 255 characters respectively, msec
|
|
|
|
// is the timeout, in milliseconds, before the balloon disappears (will be
|
|
|
|
// clamped down to the allowed 10-30s range by Windows if it's outside it)
|
|
|
|
// and flags can include wxICON_ERROR/INFO/WARNING to show a corresponding
|
|
|
|
// icon
|
|
|
|
//
|
|
|
|
// return true if balloon was shown, false on error (incorrect parameters
|
|
|
|
// or function unsupported by OS)
|
|
|
|
bool ShowBalloon(const wxString& title,
|
|
|
|
const wxString& text,
|
|
|
|
unsigned msec = 0,
|
2015-09-09 20:59:21 +00:00
|
|
|
int flags = 0,
|
|
|
|
const wxIcon& icon = wxNullIcon);
|
2007-12-08 20:51:21 +00:00
|
|
|
#endif // wxUSE_TASKBARICON_BALLOONS
|
2007-12-01 16:25:30 +00:00
|
|
|
|
2004-03-23 23:20:16 +00:00
|
|
|
protected:
|
|
|
|
friend class wxTaskBarIconWindow;
|
2007-08-14 22:44:44 +00:00
|
|
|
|
2004-03-24 20:12:14 +00:00
|
|
|
long WindowProc(unsigned int msg, unsigned int wParam, long lParam);
|
2004-03-23 23:20:16 +00:00
|
|
|
void RegisterWindowMessages();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
|
2004-03-23 23:20:16 +00:00
|
|
|
wxTaskBarIconWindow *m_win;
|
|
|
|
bool m_iconAdded;
|
|
|
|
wxIcon m_icon;
|
|
|
|
wxString m_strTooltip;
|
1998-11-22 04:20:32 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2007-08-14 22:44:44 +00:00
|
|
|
#endif // _WX_TASKBAR_H_
|