dde-dock/plugins/media/mediaplugin.h
donghualin 6d14fd1be7 feat: 将音乐播放功能提取为单独的插件
将dock中的音乐播放功能提取为音乐插件

Log:
Influence: 无
Task: https://pms.uniontech.com/task-view-220489.html
Change-Id: Ie58d1645fff08332a03398aa8ce9cb0e90f16ad2
2022-11-30 12:19:18 +08:00

58 lines
1.7 KiB
C++

/*
* Copyright (C) 2022 ~ 2022 Deepin Technology Co., Ltd.
*
* Author: donghualin <donghualin@uniontech.com>
*
* Maintainer: donghualin <donghualin@uniontech.com>
*
* 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 MEDIAPLUGIN_H
#define MEDIAPLUGIN_H
#include "pluginsiteminterface.h"
namespace Dock{
class TipsWidget;
}
class MediaWidget;
class MediaPlayerModel;
class MediaPlugin : public QObject, PluginsItemInterface
{
Q_OBJECT
Q_INTERFACES(PluginsItemInterface)
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "media.json")
public:
explicit MediaPlugin(QObject *parent = nullptr);
const QString pluginName() const override;
const QString pluginDisplayName() const override;
void init(PluginProxyInterface *proxyInter) override;
QWidget *itemWidget(const QString &itemKey) override;
QWidget *itemTipsWidget(const QString &itemKey) override;
QWidget *itemPopupApplet(const QString &itemKey) override;
PluginFlags flags() const override;
private:
QScopedPointer<MediaWidget> m_mediaWidget;
QScopedPointer<MediaPlayerModel> m_model;
};
#endif // DATETIMEPLUGIN_H