40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include "components/button/iconButton.hpp"
|
|
#include "connection/dbus/bluetooth.hpp"
|
|
|
|
#include "gtkmm/box.h"
|
|
#include "gtkmm/scrolledwindow.h"
|
|
|
|
#include "widgets/controlCenter/bluetoothSettingsRow.hpp"
|
|
|
|
class BluetoothSettings : public Gtk::Box {
|
|
public:
|
|
BluetoothSettings();
|
|
|
|
private:
|
|
std::shared_ptr<BluetoothController> bluetoothController = BluetoothController::getInstance();
|
|
std::map<std::string, BluetoothDevice> activeBluetoothDevices;
|
|
std::map<std::string, std::shared_ptr<BluetoothSettingsRow>> deviceRows;
|
|
|
|
std::shared_ptr<IconButton> powerButton = std::make_shared<IconButton>(Icon::POWER_SETTINGS_NEW);
|
|
std::shared_ptr<IconButton> scanButton = std::make_shared<IconButton>(Icon::BLUETOOTH_SEARCHING);
|
|
|
|
Gtk::Box buttonRow;
|
|
Gtk::Box connectedDevicesBox;
|
|
Gtk::ScrolledWindow connectedDevicesScroll;
|
|
Gtk::Box availableDevicesBox;
|
|
Gtk::ScrolledWindow availableDevicesScroll;
|
|
|
|
bool bluetoothIsPowered = false;
|
|
bool bluetoothIsScanning = false;
|
|
|
|
void addBluetoothDevice(const BluetoothDevice &device);
|
|
void removeBluetoothDevice(const std::string &object_path);
|
|
void updateBluetoothDevice(const BluetoothDevice &device);
|
|
|
|
void setBluetoothPowered(bool powered);
|
|
void setScanning(bool scanning);
|
|
}; |