Dokit
dev
v0.6.0
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.2
v0.1.1
v0.1.0
User docs
Internal
Coverage
Internal development documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
setnamecommand.h
1
// SPDX-FileCopyrightText: 2022-2026 Paul Colby <git@colby.id.au>
2
// SPDX-License-Identifier: LGPL-3.0-or-later
3
4
#include "devicecommand.h"
5
6
QTPOKIT_FORWARD_DECLARE_CLASS
(
StatusService
)
7
8
class
SetNameCommand
: public
DeviceCommand
9
{
10
Q_OBJECT
11
12
public
:
13
explicit
SetNameCommand
(
QObject
*
const
parent
=
nullptr
);
14
15
QStringList
requiredOptions
(
const
QCommandLineParser
&parser)
const override
;
16
QStringList
supportedOptions
(
const
QCommandLineParser
&parser)
const override
;
17
18
public
slots:
19
QStringList
processOptions
(
const
QCommandLineParser
&parser)
override
;
20
21
protected
:
22
AbstractPokitService
*
getService
()
override
;
23
24
protected
slots:
25
void
serviceDetailsDiscovered
()
override
;
26
27
private
:
28
QString
newName
;
///< New name to set on the Pokit device.
29
StatusService
*
service
{
nullptr
};
///< Bluetooth service this command interacts with.
30
31
private
slots:
32
void
deviceNameWritten();
33
34
QTPOKIT_BEFRIEND_TEST
(
SetNameCommand
)
35
};
AbstractPokitService
The AbstractPokitService class provides a common base for Pokit services classes.
Definition
abstractpokitservice.h:27
DeviceCommand::DeviceCommand
DeviceCommand(QObject *const parent=nullptr)
Construct a new DeviceCommand object with parent.
Definition
devicecommand.cpp:21
SetNameCommand
The SetNameCommand class implements the set-name CLI command.
Definition
setnamecommand.h:9
SetNameCommand::serviceDetailsDiscovered
void serviceDetailsDiscovered() override
Handles service detail discovery events.
Definition
setnamecommand.cpp:84
SetNameCommand::newName
QString newName
New name to set on the Pokit device.
Definition
setnamecommand.h:28
SetNameCommand::processOptions
QStringList processOptions(const QCommandLineParser &parser) override
Processes the relevant options from the command line parser.
Definition
setnamecommand.cpp:46
SetNameCommand::supportedOptions
QStringList supportedOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names supported by this command.
Definition
setnamecommand.cpp:35
SetNameCommand::requiredOptions
QStringList requiredOptions(const QCommandLineParser &parser) const override
Returns a list of CLI option names required by this command.
Definition
setnamecommand.cpp:28
SetNameCommand::getService
AbstractPokitService * getService() override
Returns a Pokit service object for the derived command class.
Definition
setnamecommand.cpp:67
SetNameCommand::SetNameCommand
SetNameCommand(QObject *const parent=nullptr)
Construct a new SetNameCommand object with parent.
Definition
setnamecommand.cpp:23
SetNameCommand::service
StatusService * service
Bluetooth service this command interacts with.
Definition
setnamecommand.h:29
StatusService
The StatusService class accesses the Pokit Status service of Pokit devices.
Definition
statusservice.h:23
QCommandLineParser
QObject::QObject
QObject(QObject *parent)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QString
QStringList
QTPOKIT_FORWARD_DECLARE_CLASS
#define QTPOKIT_FORWARD_DECLARE_CLASS(name)
Macro for forward declaring classes in the QtPokit library's top-most namespace (if one is defined).
Definition
qtpokit_global.h:94
QTPOKIT_BEFRIEND_TEST
#define QTPOKIT_BEFRIEND_TEST(Class)
Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
Definition
qtpokit_global.h:118
dokit
dokit
src
cli
setnamecommand.h
Generated by
1.18.0