31 lines
702 B
C++
31 lines
702 B
C++
#pragma once
|
|
|
|
#include <gtkmm/box.h>
|
|
#include <gtkmm/button.h>
|
|
|
|
class BluetoothWidget : public Gtk::Box {
|
|
public:
|
|
BluetoothWidget();
|
|
|
|
void setPowerState(bool state);
|
|
void setIsDiscovering(bool state);
|
|
|
|
sigc::signal<void()> onPowerStateButtonClickedSignal;
|
|
sigc::signal<void()> onIsDiscoveringButtonClickedSignal;
|
|
|
|
void update();
|
|
|
|
private:
|
|
bool isPowered = false;
|
|
bool isDiscovering = false;
|
|
|
|
Gtk::Box statusArea;
|
|
Gtk::Box *deviceList = nullptr;
|
|
Gtk::Button *scanButton = nullptr;
|
|
Gtk::Button *powerButton = nullptr;
|
|
|
|
void onPowerButtonClicked();
|
|
void onScanButtonClicked();
|
|
|
|
void toggleButton(Gtk::Button *button, bool state);
|
|
}; |