杨万青 566dd13cf8 Add copyright infomation
Change-Id: Icf60cf1e36ea2a64e27055bf0c53ec99cf0051b2
2016-02-04 12:42:21 +08:00

50 lines
1006 B
C++

/**
* Copyright (C) 2015 Deepin Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
**/
#ifndef TRAYICON_H
#define TRAYICON_H
#include <QWindow>
#include <QFrame>
#include <QImage>
class QPaintEvent;
class QMouseEvent;
class TrayIcon : public QFrame
{
Q_OBJECT
public:
explicit TrayIcon(WId winId, QWidget *parent = 0);
~TrayIcon();
void maskOn();
void maskOff();
void hideIcon();
void updateIcon();
protected:
void paintEvent(QPaintEvent *);
// void mousePressEvent(QMouseEvent *);
private:
WId m_windowId;
WId m_containerWid;
bool m_masked;
bool m_hided;
QTimer * m_timer;
QImage m_image;
void wrapWindow();
QImage getImageNonComposite();
void sendClick(uint8_t, int, int);
};
#endif // TRAYICON_H