-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
512 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. | ||
* | ||
* Author: sbw <[email protected]> | ||
* | ||
* Maintainer: sbw <[email protected]> | ||
* | ||
* 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 | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef CONSTANTS_H | ||
#define CONSTANTS_H | ||
|
||
#include <QtCore> | ||
|
||
namespace Dock { | ||
|
||
#define DOCK_PLUGIN_MIME "dock/plugin" | ||
#define DOCK_PLUGIN_API_VERSION "1.2.3" | ||
|
||
#define PROP_DISPLAY_MODE "DisplayMode" | ||
|
||
#define PLUGIN_BACKGROUND_MAX_SIZE 40 | ||
#define PLUGIN_BACKGROUND_MIN_SIZE 20 | ||
|
||
#define PLUGIN_ICON_MAX_SIZE 20 | ||
#define PLUGIN_ITEM_WIDTH 300 | ||
|
||
// 需求变更成插件图标始终保持20x20,但16x16的资源还在。所以暂时保留此宏 | ||
#define PLUGIN_ICON_MIN_SIZE 20 | ||
|
||
// 插件最小尺寸,图标采用深色 | ||
#define PLUGIN_MIN_ICON_NAME "-dark" | ||
|
||
// dock最大尺寸 | ||
#define DOCK_MAX_SIZE 100 | ||
/// | ||
/// \brief The DisplayMode enum | ||
/// spec dock display mode | ||
/// | ||
enum DisplayMode { | ||
Fashion = 0, | ||
Efficient = 1, | ||
// deprecreated | ||
// Classic = 2, | ||
}; | ||
|
||
#define PROP_HIDE_MODE "HideMode" | ||
/// | ||
/// \brief The HideMode enum | ||
/// spec dock hide behavior | ||
/// | ||
enum HideMode { | ||
KeepShowing = 0, | ||
KeepHidden = 1, | ||
SmartHide = 3, | ||
}; | ||
|
||
#define PROP_POSITION "Position" | ||
/// | ||
/// \brief The Position enum | ||
/// spec dock position, dock always placed at primary screen, | ||
/// so all position is the primary screen edge. | ||
/// | ||
enum Position { | ||
Top = 0, | ||
Right = 1, | ||
Bottom = 2, | ||
Left = 3, | ||
}; | ||
|
||
#define PROP_HIDE_STATE "HideState" | ||
/// | ||
/// \brief The HideState enum | ||
/// spec current dock should hide or shown. | ||
/// this argument works only HideMode is SmartHide | ||
/// | ||
enum HideState { | ||
Unknown = 0, | ||
Show = 1, | ||
Hide = 2, | ||
}; | ||
|
||
#define IS_TOUCH_STATE "isTouchState" | ||
|
||
} | ||
|
||
Q_DECLARE_METATYPE(Dock::DisplayMode) | ||
Q_DECLARE_METATYPE(Dock::Position) | ||
|
||
#endif // CONSTANTS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. | ||
* | ||
* Author: sbw <[email protected]> | ||
* | ||
* Maintainer: sbw <[email protected]> | ||
* | ||
* 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 | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef PLUGINPROXYINTERFACE_H | ||
#define PLUGINPROXYINTERFACE_H | ||
|
||
#include "constants.h" | ||
|
||
#include <QtCore> | ||
|
||
class PluginsItemInterface; | ||
class PluginProxyInterface | ||
{ | ||
public: | ||
/// | ||
/// \brief itemAdded | ||
/// add a new dock item | ||
/// if itemkey of this plugin inter already exist, the new item | ||
/// will be ignored, so if you need to add multiple item, you need | ||
/// to ensure all itemKey is different. | ||
/// \param itemInter | ||
/// your plugin interface | ||
/// \param itemKey | ||
/// your item unique key | ||
/// | ||
virtual void itemAdded(PluginsItemInterface * const itemInter, const QString &itemKey) = 0; | ||
/// | ||
/// \brief itemUpdate | ||
/// update(repaint) spec item | ||
/// \param itemInter | ||
/// \param itemKey | ||
/// | ||
virtual void itemUpdate(PluginsItemInterface * const itemInter, const QString &itemKey) = 0; | ||
/// | ||
/// \brief itemRemoved | ||
/// remove spec item, if spec item is not exist, dock will to nothing. | ||
/// dock will NOT delete your object, you should manage memory by your self. | ||
/// \param itemInter | ||
/// \param itemKey | ||
/// | ||
virtual void itemRemoved(PluginsItemInterface * const itemInter, const QString &itemKey) = 0; | ||
/// | ||
/// \brief requestContextMenu | ||
/// request show context menu | ||
/// | ||
//virtual void requestContextMenu(PluginsItemInterface * const itemInter, const QString &itemKey) = 0; | ||
|
||
virtual void requestWindowAutoHide(PluginsItemInterface * const itemInter, const QString &itemKey, const bool autoHide) = 0; | ||
virtual void requestRefreshWindowVisible(PluginsItemInterface * const itemInter, const QString &itemKey) = 0; | ||
|
||
virtual void requestSetAppletVisible(PluginsItemInterface * const itemInter, const QString &itemKey, const bool visible) = 0; | ||
|
||
/// | ||
/// \brief saveValue | ||
/// save module config to .config/deepin/dde-dock.conf | ||
/// all key-values of all plugins will be save to that file | ||
/// and grouped by the returned value of pluginName() function which is defined in PluginsItemInterface | ||
/// \param itemInter the plugin object | ||
/// \param key the key of data | ||
/// \param value the data | ||
/// | ||
virtual void saveValue(PluginsItemInterface * const itemInter, const QString &key, const QVariant &value) = 0; | ||
|
||
/// | ||
/// \brief getValue | ||
/// SeeAlse: saveValue | ||
/// return value from .config/deepin/dde-dock.conf | ||
/// | ||
virtual const QVariant getValue(PluginsItemInterface *const itemInter, const QString &key, const QVariant& fallback = QVariant()) = 0; | ||
|
||
/// | ||
/// \brief removeValue | ||
/// remove the values specified by keyList | ||
/// remove all values of itemInter if keyList is empty | ||
/// SeeAlse: saveValue | ||
/// | ||
virtual void removeValue(PluginsItemInterface *const itemInter, const QStringList &keyList) = 0; | ||
}; | ||
|
||
#endif // PLUGINPROXYINTERFACE_H |
Oops, something went wrong.