2016-06-03 16:06:11 +08:00
|
|
|
#ifndef APPITEM_H
|
|
|
|
#define APPITEM_H
|
|
|
|
|
|
|
|
#include "dockitem.h"
|
|
|
|
#include "dbus/dbusdockentry.h"
|
2016-06-06 14:57:07 +08:00
|
|
|
#include "dbus/dbusclientmanager.h"
|
2016-06-03 16:06:11 +08:00
|
|
|
|
|
|
|
class AppItem : public DockItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit AppItem(const QDBusObjectPath &entry, QWidget *parent = nullptr);
|
|
|
|
|
2016-06-14 11:22:19 +08:00
|
|
|
const QString appId() const;
|
|
|
|
|
2016-06-03 16:06:11 +08:00
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent *e);
|
2016-06-06 14:28:28 +08:00
|
|
|
void mouseReleaseEvent(QMouseEvent *e);
|
2016-06-07 14:40:45 +08:00
|
|
|
void mousePressEvent(QMouseEvent *e);
|
|
|
|
void mouseMoveEvent(QMouseEvent *e);
|
2016-06-15 11:20:05 +08:00
|
|
|
void resizeEvent(QResizeEvent *e);
|
2016-06-06 14:28:28 +08:00
|
|
|
|
2016-06-07 14:40:45 +08:00
|
|
|
void startDrag();
|
2016-06-06 14:57:07 +08:00
|
|
|
void initClientManager();
|
2016-06-14 16:01:01 +08:00
|
|
|
|
|
|
|
private slots:
|
2016-06-15 11:20:05 +08:00
|
|
|
void updateTitle();
|
|
|
|
void updateIcon();
|
2016-06-03 16:06:11 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
DBusDockEntry *m_itemEntry;
|
2016-06-06 14:28:28 +08:00
|
|
|
|
2016-06-07 16:01:37 +08:00
|
|
|
bool m_draging;
|
|
|
|
|
2016-06-14 11:22:19 +08:00
|
|
|
WindowDict m_titles;
|
|
|
|
QString m_id;
|
2016-06-14 16:01:01 +08:00
|
|
|
QPixmap m_icon;
|
2016-06-06 14:57:07 +08:00
|
|
|
|
2016-06-07 14:40:45 +08:00
|
|
|
QPoint m_mousePressPos;
|
|
|
|
|
2016-06-06 14:57:07 +08:00
|
|
|
static DBusClientManager *ClientInter;
|
2016-06-14 11:22:19 +08:00
|
|
|
// static uint ActiveWindowId;
|
2016-06-03 16:06:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPITEM_H
|