blob: 02996fbba8f7a8d90c696ad9554da6c8646d3790 [file] [log] [blame]
// Copyright 2022 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef RGBKBD_INTERNAL_RGB_KEYBOARD_H_
#define RGBKBD_INTERNAL_RGB_KEYBOARD_H_
#include <memory>
#include <optional>
#include <base/files/scoped_file.h>
#include <dbus/rgbkbd/dbus-constants.h>
#include <libec/ec_usb_endpoint.h>
#include <stdint.h>
#include "rgbkbd/rgb_keyboard.h"
namespace rgbkbd {
class InternalRgbKeyboard : public RgbKeyboard {
public:
InternalRgbKeyboard() = default;
InternalRgbKeyboard(const InternalRgbKeyboard&) = delete;
InternalRgbKeyboard& operator=(const InternalRgbKeyboard&) = delete;
~InternalRgbKeyboard() override = default;
bool SetKeyColor(uint32_t key, uint8_t r, uint8_t g, uint8_t b) override;
bool SetAllKeyColors(uint8_t r, uint8_t g, uint8_t b) override;
RgbKeyboardCapabilities GetRgbKeyboardCapabilities() override;
private:
std::optional<RgbKeyboardCapabilities> capabilities_;
std::unique_ptr<ec::EcUsbEndpointInterface> usb_endpoint_;
base::ScopedFD ec_fd_;
};
} // namespace rgbkbd
#endif // RGBKBD_INTERNAL_RGB_KEYBOARD_H_