ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kperfwidget.h
Go to the documentation of this file.
1 #ifndef KPERFWIDGET_H
2 #define KPERFWIDGET_H
3 
4 #include <QWidget>
5 #include <QCheckBox>
6 #include <QComboBox>
7 #include <QSignalMapper>
8 #include "kbperf.h"
9 #include "kbprofile.h"
10 #include "colorbutton.h"
11 
12 namespace Ui {
13 class KPerfWidget;
14 }
15 
16 class KPerfWidget : public QWidget
17 {
18  Q_OBJECT
19 
20 public:
21  explicit KPerfWidget(QWidget *parent = 0);
22  ~KPerfWidget();
23 
24  void setPerf(KbPerf* newPerf, KbProfile* newProfile);
25 
26  static const int I_COUNT = KbPerf::I_COUNT;
27  static const int HW_I_COUNT = KbPerf::HW_I_COUNT;
29  typedef KbPerf::i_hw i_hw;
30 
31 private:
33 
36 
37  // Hardware indicator dropdowns
38  enum HwMode {
42  RGB,
44  };
45  HwMode raw2Mode(bool sw_enable, i_hw hw_enable);
46 
52  void mode2Raw(HwMode mode, bool& sw_enable, i_hw& hw_enable);
53 
54  struct IndicatorUi {
55  QCheckBox* enable;
56  QComboBox* hwEnable;
58  };
60  QList<QWidget*> k95Widgets;
61 
62  QSignalMapper updateMapper;
63 
64 private slots:
65  void uiUpdated(int index);
66  void on_intensityBox_valueChanged(int arg1);
67  void on_copyButton_clicked();
68 };
69 
70 #endif // KPERFWIDGET_H
static const int HW_I_COUNT
Definition: kbperf.h:107
static const int HW_I_COUNT
Definition: kperfwidget.h:27
indicator
Definition: kbperf.h:88
void on_intensityBox_valueChanged(int arg1)
IndicatorUi indicators[I_COUNT]
Definition: kperfwidget.h:59
Ui::KPerfWidget * ui
Definition: kperfwidget.h:32
static const int I_COUNT
Definition: kperfwidget.h:26
KbProfile * profile
Definition: kperfwidget.h:35
KbPerf::indicator indicator
Definition: kperfwidget.h:28
void on_copyButton_clicked()
KPerfWidget(QWidget *parent=0)
KPerfWidget::KPerfWidget sets up the UI for Keyboard Performace panel.
Definition: kperfwidget.cpp:10
HwMode raw2Mode(bool sw_enable, i_hw hw_enable)
KPerfWidget::raw2Mode return hardware mode depending on setiings in sw_enable and hw_enable...
Definition: kperfwidget.cpp:72
void uiUpdated(int index)
ColorButton * color3
Definition: kperfwidget.h:57
Definition: kbperf.h:15
QSignalMapper updateMapper
Definition: kperfwidget.h:62
KbPerf::i_hw i_hw
Definition: kperfwidget.h:29
void mode2Raw(HwMode mode, bool &sw_enable, i_hw &hw_enable)
KPerfWidget::mode2Raw Set values of sw_enable and hw_enable to hte value corresponding to input var m...
ColorButton * color2
Definition: kperfwidget.h:57
KbPerf * perf
Definition: kperfwidget.h:34
ColorButton * color1
Definition: kperfwidget.h:57
i_hw
Definition: kbperf.h:101
void setPerf(KbPerf *newPerf, KbProfile *newProfile)
QList< QWidget * > k95Widgets
Definition: kperfwidget.h:60
static const int I_COUNT
Definition: kbperf.h:107
~KPerfWidget()
KPerfWidget::~KPerfWidget nothing unusual - just delete the ui object.
Definition: kperfwidget.cpp:61