AuboCaps  0.4.1
keyboard_input_callback.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_KEYBOARD_INPUT_CALLBACK_H
2 #define AUBO_SCOPE_KEYBOARD_INPUT_CALLBACK_H
3 
4 namespace arcs {
5 namespace aubo_scope {
6 
7 /**
8  * Callback used when the virtual keyboard/keypad is exited by the end user.
9  * Override this abstract class to execute custom code when the end user accepts
10  * or cancels the input.
11  *
12  * @param <T> The (generic) type parameter for the interface representing the
13  * type of input data entered by the end user, e.g. {@link Integer} and {@link
14  * Double}.
15  */
16 template <typename T>
18 {
19  /**
20  * This method is called if the end user accepts the keyboard/keypad input.
21  * Overriding this method is mandatory.
22  *
23  * @param value accepted value.
24  */
25  virtual void onOk(T value) = 0;
26 
27  /**
28  * This method is called if the end user cancels the input. Overriding this
29  * method is optional.
30  */
31  virtual void onCancel() {}
32 };
33 
34 } // namespace aubo_scope
35 } // namespace arcs
36 
37 #endif
virtual void onOk(T value)=0
This method is called if the end user accepts the keyboard/keypad input.
Callback used when the virtual keyboard/keypad is exited by the end user.
virtual void onCancel()
This method is called if the end user cancels the input.