2023-02-16 13:51:55 +08:00
|
|
|
// Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
|
|
|
// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
|
2022-09-06 11:36:55 +08:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
2017-09-18 14:33:44 +08:00
|
|
|
|
2016-08-02 10:34:44 +08:00
|
|
|
#ifndef SOUNDPLUGIN_H
|
|
|
|
#define SOUNDPLUGIN_H
|
|
|
|
|
|
|
|
#include "pluginsiteminterface.h"
|
|
|
|
|
2022-11-01 08:13:27 +00:00
|
|
|
class SoundWidget;
|
|
|
|
class SoundDevicesWidget;
|
|
|
|
|
2016-08-02 10:34:44 +08:00
|
|
|
class SoundPlugin : public QObject, PluginsItemInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2018-11-13 20:07:52 +08:00
|
|
|
Q_INTERFACES(PluginsItemInterface)
|
|
|
|
Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "sound.json")
|
2016-08-02 10:34:44 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SoundPlugin(QObject *parent = 0);
|
|
|
|
|
2020-06-13 19:19:30 +08:00
|
|
|
const QString pluginName() const override;
|
|
|
|
const QString pluginDisplayName() const override;
|
|
|
|
void init(PluginProxyInterface *proxyInter) override;
|
|
|
|
void pluginStateSwitched() override;
|
|
|
|
bool pluginIsAllowDisable() override { return true; }
|
|
|
|
bool pluginIsDisable() override;
|
|
|
|
QWidget *itemWidget(const QString &itemKey) override;
|
|
|
|
QWidget *itemTipsWidget(const QString &itemKey) override;
|
|
|
|
QWidget *itemPopupApplet(const QString &itemKey) override;
|
|
|
|
int itemSortKey(const QString &itemKey) override;
|
|
|
|
void setSortKey(const QString &itemKey, const int order) override;
|
2019-01-30 18:00:46 +08:00
|
|
|
void pluginSettingsChanged() override;
|
2022-12-02 15:41:34 +08:00
|
|
|
QIcon icon(const DockPart &dockPart, DGuiApplicationHelper::ColorType themeType) override;
|
|
|
|
PluginMode status() const override;
|
2022-11-28 14:37:54 +08:00
|
|
|
PluginFlags flags() const override;
|
2022-12-02 18:30:35 +08:00
|
|
|
bool eventHandler(QEvent *event) override;
|
2019-01-30 18:00:46 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void refreshPluginItemsVisible();
|
2018-03-06 15:18:53 +08:00
|
|
|
|
2016-08-02 10:34:44 +08:00
|
|
|
private:
|
2022-11-01 08:13:27 +00:00
|
|
|
QScopedPointer<SoundWidget> m_soundWidget;
|
|
|
|
QScopedPointer<SoundDevicesWidget> m_soundDeviceWidget;
|
2016-08-02 10:34:44 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SOUNDPLUGIN_H
|