ukui-notification/notification-ukcc-plugin/noticemenu.h

55 lines
1.4 KiB
C
Raw Normal View History

#ifndef NOTICEMENU_H
#define NOTICEMENU_H
#include <QObject>
#include <QMenu>
#include <QRadioButton>
#include <QButtonGroup>
#include <QFrame>
#include <kswitchbutton.h>
#include "notification-settings/applications-settings.h"
using namespace kdk;
class NoticeMenu : public QMenu
{
Q_OBJECT
public:
NoticeMenu(QWidget *parent = nullptr);
void initStaus(const UkuiNotification::SingleApplicationSettings &settings);
void setVoiceEnable(bool state);
void setDetailShowOnLockScreenEnable(bool state);
void setShowOnLockScreenEnable(bool state);
void setPopupStyle(UkuiNotification::SettingsProperty::Property style);
static QFrame *setLine();
private:
void initUi();
void setFrame(QFrame *frame, QString str, KSwitchButton *btn);
void setFrame(QFrame *frame, QString str, QRadioButton *btn);
void setConnect();
private:
KSwitchButton *m_voiceBtn = nullptr;
KSwitchButton *m_detailBtn = nullptr;
KSwitchButton *m_showBtn = nullptr;
QButtonGroup *m_styleGrounp = nullptr;
QRadioButton *m_noneBtn = nullptr;
QRadioButton *m_mutativeBtn = nullptr;
QRadioButton *m_alwaysBtn = nullptr;
protected:
void showEvent(QShowEvent *event);
Q_SIGNALS:
void voiceSignals(bool checked);
void detailSignals(bool checked);
void showSignals(bool checked);
void styleBtnSignals(int id);
};
#endif // NOTICEMENU_H