libvirtualhid 19
Cross-platform C++ library for virtual HID devices.
lvh::Touchscreen Class Referencefinal

Virtual touchscreen device handle. More...

#include <src/include/libvirtualhid/runtime.hpp>

Inheritance diagram for lvh::Touchscreen:
[legend]
Collaboration diagram for lvh::Touchscreen:
[legend]

Public Member Functions

OperationStatus close () override
 Close the virtual device.
 
DeviceId device_id () const override
 Get the device identifier assigned by the runtime.
 
std::vector< DeviceNodedevice_nodes () const override
 Get platform-visible nodes associated with the device.
 
bool is_open () const override
 Check whether the device is open.
 
TouchContact last_submitted_contact () const
 Get the most recently submitted touch contact.
 
Touchscreenoperator= (const Touchscreen &)=delete
 Copy assignment is disabled because the handle owns device lifetime.
 
Touchscreenoperator= (Touchscreen &&other) noexcept
 Move assign a touchscreen handle.
 
OperationStatus place_contact (const TouchContact &contact)
 Place or move a touch contact.
 
const DeviceProfileprofile () const override
 Get the profile used to create this device.
 
OperationStatus release_contact (std::int32_t contact_id)
 Release a touch contact.
 
std::size_t submit_count () const
 Get the number of successful submit operations.
 
 Touchscreen (const Touchscreen &)=delete
 Copy construction is disabled because the handle owns device lifetime.
 
 Touchscreen (detail::RuntimeConstructionToken token, std::shared_ptr< detail::TouchscreenDevice > device)
 Construct a touchscreen handle for Runtime-owned state.
 
 Touchscreen (Touchscreen &&other) noexcept
 Move construct a touchscreen handle.
 
 ~Touchscreen () override
 Destroy the touchscreen handle and close the virtual device if it is still open.
 
- Public Member Functions inherited from lvh::VirtualDevice
virtual ~VirtualDevice ()=default
 Destroy the virtual device handle.
 

Detailed Description

Virtual touchscreen device handle.

Constructor & Destructor Documentation

◆ Touchscreen() [1/2]

lvh::Touchscreen::Touchscreen ( Touchscreen && other)
noexcept

Move construct a touchscreen handle.

Parameters
otherHandle to move from.

◆ Touchscreen() [2/2]

lvh::Touchscreen::Touchscreen ( detail::RuntimeConstructionToken token,
std::shared_ptr< detail::TouchscreenDevice > device )

Construct a touchscreen handle for Runtime-owned state.

Parameters
tokenRuntime construction token.
deviceShared touchscreen state.

Member Function Documentation

◆ close()

OperationStatus lvh::Touchscreen::close ( )
overridevirtual

Close the virtual device.

Returns
Close operation status.

Implements lvh::VirtualDevice.

◆ device_id()

DeviceId lvh::Touchscreen::device_id ( ) const
overridevirtual

Get the device identifier assigned by the runtime.

Returns
Device identifier.

Implements lvh::VirtualDevice.

◆ device_nodes()

std::vector< DeviceNode > lvh::Touchscreen::device_nodes ( ) const
overridevirtual

Get platform-visible nodes associated with the device.

Returns
Device nodes and diagnostic paths currently known to the backend.

Implements lvh::VirtualDevice.

◆ is_open()

bool lvh::Touchscreen::is_open ( ) const
overridevirtual

Check whether the device is open.

Returns
true when the device can accept operations.

Implements lvh::VirtualDevice.

◆ last_submitted_contact()

TouchContact lvh::Touchscreen::last_submitted_contact ( ) const

Get the most recently submitted touch contact.

Returns
Last submitted touch contact.

◆ operator=() [1/2]

Touchscreen & lvh::Touchscreen::operator= ( const Touchscreen & )
delete

Copy assignment is disabled because the handle owns device lifetime.

Returns
This touchscreen handle.

◆ operator=() [2/2]

Touchscreen & lvh::Touchscreen::operator= ( Touchscreen && other)
noexcept

Move assign a touchscreen handle.

Parameters
otherHandle to move from.
Returns
This touchscreen handle.

◆ place_contact()

OperationStatus lvh::Touchscreen::place_contact ( const TouchContact & contact)

Place or move a touch contact.

Parameters
contactTouch contact state.
Returns
Submit operation status.

◆ profile()

const DeviceProfile & lvh::Touchscreen::profile ( ) const
overridevirtual

Get the profile used to create this device.

Returns
Device profile.

Implements lvh::VirtualDevice.

◆ release_contact()

OperationStatus lvh::Touchscreen::release_contact ( std::int32_t contact_id)

Release a touch contact.

Parameters
contact_idConsumer-stable contact identifier.
Returns
Submit operation status.

◆ submit_count()

std::size_t lvh::Touchscreen::submit_count ( ) const

Get the number of successful submit operations.

Returns
Submit count.

The documentation for this class was generated from the following file: