Merge branch 'dde-dock' of gitcafe.com:Hualet/dde-workspace-2015 into dde-dock

This commit is contained in:
杨万青 2015-06-29 20:37:14 +08:00
commit 046ea770c3
3 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,39 @@
#ifndef ABSTRACTDOCKITEM_H
#define ABSTRACTDOCKITEM_H
#include <QWidget>
#include <QFrame>
#include <QMouseEvent>
#include <QRectF>
class AbstractDockItem : public QFrame
{
Q_OBJECT
public:
explicit AbstractDockItem(QWidget *parent = 0);
virtual ~AbstractDockItem() = 0;
virtual QWidget * getContents() = 0;
virtual void setTitle(const QString &title) = 0;
virtual void setIcon(const QString &iconPath, int size = 42) = 0;
virtual void setMoveable(bool value) = 0;
virtual bool moveable() = 0;
virtual void setActived(bool value) = 0;
virtual bool actived() = 0;
virtual void setIndex(int value) = 0;
virtual int index() = 0;
protected:
QPixmap * m_appIcon = NULL;
bool m_itemMoveable = true;
bool m_itemActived = false;
QString m_itemTitle = "";
QString m_itemIconPath = "";
int m_itemIndex = 0;
};
#endif // ABSTRACTDOCKITEM_H

View File

@ -39,7 +39,9 @@ HEADERS += mainwidget.h \
Widgets/docklayout.h \
Widgets/windowpreview.h \
Widgets/dockitem.h \
Widgets/screenmask.h
Widgets/screenmask.h \
dockplugininterface.h \
abstractdockitem.h
RESOURCES += \
images.qrc

View File

@ -0,0 +1,23 @@
#ifndef DOCKPLUGININTERFACE_H
#define DOCKPLUGININTERFACE_H
#include <QObject>
#include "abstractdockitem.h"
class DockPluginInterface : public QObject
{
Q_OBJECT
public:
virtual ~DockPluginInterface() {}
virtual QList<AbstractDockItem*> items();
};
QT_BEGIN_NAMESPACE
#define DockPluginInterface_iid "org.deepin.Dock.PluginInterface"
Q_DECLARE_INTERFACE(DockPluginInterface, DockPluginInterface_iid)
QT_END_NAMESPACE
#endif // DOCKPLUGININTERFACE_H