dde-dock/plugins/airplane-mode/airplanemodeitem.h
范朋程 2d958dd670 chore: V23接口改造适配
V23接口改造适配

Log: V23接口改造适配
Influence: 无
Task: https://pms.uniontech.com/task-view-207483.html
Change-Id: Ide530c023ea41f86fad2e8001ec67f1afaa897ab
2022-12-06 14:40:35 +08:00

68 lines
1.7 KiB
C++

/*
* Copyright (C) 2020 ~ 2022 Deepin Technology Co., Ltd.
*
* Author: weizhixiang <weizhixiang@uniontech.com>
*
* Maintainer: weizhixiang <weizhixiang@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 AIRPLANEMODEITEM_H
#define AIRPLANEMODEITEM_H
#include "org_deepin_dde_airplanemode1.h"
#include <QWidget>
using DBusAirplaneMode = org::deepin::dde::AirplaneMode1;
namespace Dock {
class TipsWidget;
}
class AirplaneModeApplet;
class AirplaneModeItem : public QWidget
{
Q_OBJECT
public:
explicit AirplaneModeItem(QWidget *parent = nullptr);
QWidget *tipsWidget();
QWidget *popupApplet();
const QString contextMenu() const;
void invokeMenuItem(const QString menuId, const bool checked);
void refreshIcon();
void updateTips();
bool airplaneEnable();
protected:
void resizeEvent(QResizeEvent *e);
void paintEvent(QPaintEvent *e);
signals:
void airplaneEnableChanged(bool enable);
private:
Dock::TipsWidget *m_tipsLabel;
AirplaneModeApplet *m_applet;
DBusAirplaneMode *m_airplaneModeInter;
QPixmap m_iconPixmap;
};
#endif // AIRPLANEMODEITEM_H