neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_hid_devices.hpp
Go to the documentation of this file.
1
// i_hid_devices.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include <
neolib/core/i_vector.hpp
>
24
#include <
neogfx/hid/i_hid_device.hpp
>
25
26
namespace
neogfx
27
{
28
typedef
hid_device_uuid
hid_device_class_uuid
;
29
typedef
hid_device_uuid
hid_device_subclass_uuid
;
30
31
class
i_hid_devices
:
public
i_service
32
{
33
public
:
34
declare_event
(device_connected,
i_hid_device
&)
35
declare_event
(device_disconnected,
i_hid_device
&)
36
public
:
37
typedef
neolib::i_vector<i_ref_ptr<i_hid_device>
>
device_list
;
38
public
:
39
virtual
~i_hid_devices
() =
default
;
40
public
:
41
virtual
void
enumerate_devices
() = 0;
42
virtual
const
device_list
&
devices
()
const
= 0;
43
virtual
void
add_device
(
i_hid_device
& aDevice) = 0;
44
virtual
void
remove_device
(
i_hid_device
& aDevice) = 0;
45
public
:
46
virtual
hid_device_class
device_class
(
const
hid_device_class_uuid
& aClassUuid)
const
= 0;
47
virtual
hid_device_subclass
device_subclass
(
const
hid_device_subclass_uuid
& aClassUuid)
const
= 0;
48
virtual
const
i_string
&
product_name
(
hid_device_class
aClass,
const
hid_device_uuid
& aProductId)
const
= 0;
49
public
:
50
template
<
typename
Device>
51
ref_ptr<Device>
add_device
()
52
{
53
auto
newDevice = make_ref<Device>();
54
add_device
(*newDevice);
55
return
newDevice;
56
}
57
public
:
58
static
uuid
const
&
iid
() {
static
uuid
const
sIid{ 0xc97d8f86, 0xa1db, 0x4c8b, 0x8531, { 0x90, 0xba, 0x5b, 0x34, 0x27, 0x47 } };
return
sIid; }
59
};
60
}
neogfx::i_hid_device
Definition
i_hid_device.hpp:66
neogfx::i_hid_devices
Definition
i_hid_devices.hpp:32
neogfx::i_hid_devices::product_name
virtual const i_string & product_name(hid_device_class aClass, const hid_device_uuid &aProductId) const =0
neogfx::i_hid_devices::remove_device
virtual void remove_device(i_hid_device &aDevice)=0
neogfx::i_hid_devices::devices
virtual const device_list & devices() const =0
neogfx::i_hid_devices::device_subclass
virtual hid_device_subclass device_subclass(const hid_device_subclass_uuid &aClassUuid) const =0
neogfx::i_hid_devices::device_list
neolib::i_vector< i_ref_ptr< i_hid_device > > device_list
Definition
i_hid_devices.hpp:37
neogfx::i_hid_devices::iid
static uuid const & iid()
Definition
i_hid_devices.hpp:58
neogfx::i_hid_devices::declare_event
declare_event(device_connected, i_hid_device &) declare_event(device_disconnected
neogfx::i_hid_devices::~i_hid_devices
virtual ~i_hid_devices()=default
neogfx::i_hid_devices::enumerate_devices
virtual void enumerate_devices()=0
neogfx::i_hid_devices::add_device
virtual void add_device(i_hid_device &aDevice)=0
neogfx::i_hid_devices::add_device
ref_ptr< Device > add_device()
Definition
i_hid_devices.hpp:51
neogfx::i_hid_devices::device_class
virtual hid_device_class device_class(const hid_device_class_uuid &aClassUuid) const =0
neolib::i_string
Definition
i_string.hpp:49
neolib::i_vector
Definition
i_vector.hpp:45
neolib::ref_ptr
Definition
reference_counted.hpp:185
neolib::services::i_service
Definition
services.hpp:57
i_hid_device.hpp
i_vector.hpp
neogfx
Definition
action.hpp:28
neogfx::hid_device_class
hid_device_class
Definition
i_hid_device.hpp:36
neogfx::hid_device_subclass_uuid
hid_device_uuid hid_device_subclass_uuid
Definition
i_hid_devices.hpp:29
neogfx::hid_device_class_uuid
hid_device_uuid hid_device_class_uuid
Definition
i_hid_devices.hpp:28
neogfx::hid_device_subclass
hid_device_subclass
Definition
i_hid_device.hpp:44
neogfx.hpp
declare_event
#define declare_event(declName,...)
Definition
i_event.hpp:305
neolib::uuid
Definition
uuid.hpp:51
include
neogfx
hid
i_hid_devices.hpp
Generated by
1.9.8