2014-09-10 14:49:33 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: include/taskbarbutton.h
|
|
|
|
// Purpose: Defines wxTaskBarButton class for manipulating buttons on the
|
|
|
|
// windows taskbar.
|
|
|
|
// Author: Chaobin Zhang <zhchbin@gmail.com>
|
|
|
|
// Created: 2014-04-30
|
|
|
|
// Copyright: (c) 2014 wxWidgets development team
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_TASKBARBUTTON_H_
|
|
|
|
#define _WX_TASKBARBUTTON_H_
|
|
|
|
|
|
|
|
#if wxUSE_TASKBARBUTTON
|
|
|
|
|
2014-09-10 14:51:29 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2014-09-10 14:49:33 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxTaskBarButton: define wxTaskBarButton interface.
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2014-09-10 14:49:55 +00:00
|
|
|
/**
|
|
|
|
State of the task bar button.
|
|
|
|
*/
|
2014-09-10 14:51:51 +00:00
|
|
|
enum WXDLLIMPEXP_CORE wxTaskBarButtonState
|
2014-09-10 14:49:55 +00:00
|
|
|
{
|
|
|
|
wxTASKBAR_BUTTON_NO_PROGRESS = 0,
|
|
|
|
wxTASKBAR_BUTTON_INDETERMINATE = 1,
|
|
|
|
wxTASKBAR_BUTTON_NORMAL = 2,
|
|
|
|
wxTASKBAR_BUTTON_ERROR = 4,
|
|
|
|
wxTASKBAR_BUTTON_PAUSED = 8
|
|
|
|
};
|
|
|
|
|
2014-09-10 14:51:51 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxThumbBarButton {
|
2014-09-10 14:50:08 +00:00
|
|
|
public:
|
|
|
|
wxThumbBarButton(int id,
|
|
|
|
const wxIcon& icon,
|
2014-09-10 14:51:29 +00:00
|
|
|
const wxString& tooltip = wxString(),
|
|
|
|
bool enable = true,
|
|
|
|
bool dismissOnClick = false,
|
|
|
|
bool hasBackground = true,
|
|
|
|
bool shown = true,
|
|
|
|
bool interactive = true);
|
2014-09-10 14:50:08 +00:00
|
|
|
|
|
|
|
virtual ~wxThumbBarButton() {}
|
|
|
|
|
|
|
|
int GetID() const { return m_id; }
|
|
|
|
const wxIcon& GetIcon() const { return m_icon; }
|
|
|
|
const wxString& GetTooltip() const { return m_tooltip; }
|
2014-09-10 14:51:29 +00:00
|
|
|
bool IsEnable() const { return m_enable; }
|
|
|
|
bool IsDismissOnClick() const { return m_dismissOnClick; }
|
|
|
|
bool HasBackground() const { return m_hasBackground; }
|
|
|
|
bool IsShown() const { return m_shown; }
|
|
|
|
bool IsInteractive() const { return m_interactive; }
|
2014-09-10 14:50:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int m_id;
|
|
|
|
wxIcon m_icon;
|
|
|
|
wxString m_tooltip;
|
2014-09-10 14:51:29 +00:00
|
|
|
bool m_enable;
|
|
|
|
bool m_dismissOnClick;
|
|
|
|
bool m_hasBackground;
|
|
|
|
bool m_shown;
|
|
|
|
bool m_interactive;
|
2014-09-10 14:50:08 +00:00
|
|
|
};
|
|
|
|
|
2014-09-10 14:51:51 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxTaskBarButton
|
2014-09-10 14:49:33 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxTaskBarButton() { }
|
|
|
|
virtual ~wxTaskBarButton() { }
|
|
|
|
|
|
|
|
// Operations:
|
2014-09-10 14:51:09 +00:00
|
|
|
virtual void SetProgressRange(int range) = 0;
|
2014-09-10 14:49:33 +00:00
|
|
|
virtual void SetProgressValue(int value) = 0;
|
2014-09-10 14:51:09 +00:00
|
|
|
virtual void PulseProgress() = 0;
|
2014-09-10 14:50:58 +00:00
|
|
|
virtual void Show(bool show = true) = 0;
|
2014-09-10 14:49:55 +00:00
|
|
|
virtual void Hide() = 0;
|
|
|
|
virtual void SetThumbnailTooltip(const wxString& tooltip) = 0;
|
|
|
|
virtual void SetProgressState(wxTaskBarButtonState state) = 0;
|
2014-09-10 14:50:38 +00:00
|
|
|
virtual void SetOverlayIcon(const wxIcon& icon,
|
|
|
|
const wxString& description = wxString()) = 0;
|
2014-09-10 14:49:55 +00:00
|
|
|
virtual void SetThumbnailClip(const wxRect& rect) = 0;
|
2014-09-10 14:51:18 +00:00
|
|
|
virtual void SetThumbnailContents(const wxWindow *child) = 0;
|
2014-09-10 14:51:29 +00:00
|
|
|
virtual bool InsertThumbBarButton(size_t pos, wxThumbBarButton *button) = 0;
|
|
|
|
virtual bool AppendThumbBarButton(wxThumbBarButton *button) = 0;
|
|
|
|
virtual bool RemoveThumbBarButton(wxThumbBarButton *button) = 0;
|
|
|
|
virtual bool RemoveThumbBarButton(int id) = 0;
|
2014-09-10 14:50:08 +00:00
|
|
|
|
2014-09-10 14:49:33 +00:00
|
|
|
private:
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxTaskBarButton);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__WXMSW__)
|
|
|
|
#include "wx/msw/taskbarbutton.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // wxUSE_TASKBARBUTTON
|
|
|
|
|
|
|
|
#endif // _WX_TASKBARBUTTON_H_
|