AuboCaps
0.4.1
Main Page
Namespaces
Classes
Files
File List
File Members
include
aubo_caps
domain
user_interface
keyboard_text_input.h
Go to the documentation of this file.
1
#ifndef AUBO_SCOPE_KEYBOARD_TEXT_INPUT_H
2
#define AUBO_SCOPE_KEYBOARD_TEXT_INPUT_H
3
4
#include <memory>
5
#include <functional>
6
7
#include <
aubo_caps/domain/user_interface/keyboard_input_callback.h
>
8
#include <
aubo_caps/domain/user_interface/input_validator.h
>
9
10
class
QWidget;
11
12
namespace
arcs
{
13
namespace
aubo_scope {
14
15
ARCS_CLASS_FORWARD
(KeyboardTextInput);
16
17
/**
18
* Interface representing the virtual keyboard used for configuring it and
19
* requesting it to be displayed in PolyScope.
20
*/
21
class
ARCS_ABI_EXPORT
KeyboardTextInput
22
{
23
public
:
24
KeyboardTextInput
(
KeyboardTextInput
&f);
25
KeyboardTextInput
(
KeyboardTextInput
&&f);
26
virtual
~
KeyboardTextInput
();
27
28
/**
29
* <p>
30
* Sets an input validator for the virtual keyboard. This validator will be
31
* used to validate the input entered by the user. Some standard validators
32
* are available in
33
* {@link domain.userinteraction.inputvalidation.InputValidationFactory}.
34
* </p>
35
*
36
* <p>
37
* Specifying an input validator is recommended, but optional.
38
* </p>
39
*
40
* In case {@link InputValidator#isValid(Object)} (in this case parameter is
41
* {@link String}) returns <code>false</code>, the accept button on the
42
* virtual keyboard will be disabled and the error message from {@link
43
* InputValidator#getMessage(Object)} (parameter is {@link String}) will be
44
* shown.
45
*
46
* @param validator the validator to be used to validate keyboard user
47
* input.
48
* @return this KeyboardTextInput object.
49
* @throws NullPointerException in case the validator is <code>null</code>.
50
*/
51
void
setErrorValidator(
52
const
std::shared_ptr<
InputValidator<std::string>
> &validator);
53
54
/**
55
* Sets the text which will be displayed when the virtual keyboard is shown.
56
*
57
* @param initialText the initial text for the virtual keyboard.
58
* @return this KeyboardTextInput object.
59
*/
60
virtual
void
setInitialValue(
const
std::string &initialText);
61
62
/**
63
* This method requests the virtual standard keyboard to be shown.
64
*
65
* @param component the JTextField that will be used to define the screen
66
* position of the virtual keyboard. The component must be visible on the
67
* screen at the time of showing the keypad.
68
* @param callback the callback to be used when the user exits the keyboard
69
* by accepting or canceling the input.
70
* @throws NullPointerException in case any parameter is <code>null</code>.
71
*/
72
void
show(QWidget *component,
73
const
std::function<
void
(
bool
,
const
std::string &)> &callback);
74
75
private
:
76
friend
class
DataSwitch;
77
KeyboardTextInput
();
78
void
*d_{
nullptr
};
79
};
80
}
// namespace aubo_scope
81
}
// namespace arcs
82
83
#endif
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs::aubo_scope::KeyboardTextInput
Interface representing the virtual keyboard used for configuring it and requesting it to be displayed...
Definition:
keyboard_text_input.h:21
ARCS_ABI_EXPORT
#define ARCS_ABI_EXPORT
Definition:
class_forward.h:16
arcs
Definition:
contribution_provider.h:7
arcs::aubo_scope::InputValidator< std::string >
keyboard_input_callback.h
input_validator.h
Generated by
1.8.11