API Documentation
Loading...
Searching...
No Matches
Keypad.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: Keypad
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Dictionary.h>
35#include <NDEVR/ApplicationOptions.h>
36#include <NDEVR/String.h>
37#include <QWidget>
38class QTextEdit;
39class QLineEdit;
40class QTimer;
41namespace Ui
42{
43 class KeypadUI;
44}
45namespace NDEVR
46{
47 class QCustomLineEdit;
48 class Button;
49 /**--------------------------------------------------------------------------------------------------
50 \brief A popup for showing a virtual keyboard or keypad. Changes based on the allowed input to a
51 widget. Usually shown in touch mode.
52 *-----------------------------------------------------------------------------------------------**/
53 class NDEVR_WIDGETS_API Keypad : public QWidget
54 {
55 Q_OBJECT
56 public:
57 Keypad(QWidget* parent = nullptr);
59 void setLineEdit(QLineEdit* line_edit);
60 void setTextEdit(QTextEdit* line_edit);
61 [[nodiscard]] QWidget* currentWidget() const;
62 [[nodiscard]] QWidget* lastWidget() const;
63 [[nodiscard]] QCustomLineEdit* editor() const;
64 [[nodiscard]] static Keypad* DefaultKeypad();
65 void setUpperCase(bool uppercase);
66 QSize sizeHint() const override;
67 QSize minimumSizeHint() const override;
68 bool isFullKeyboard() const { return m_is_full_keyboard; }
70 void focusInEvent(QFocusEvent* focus) override;
71 void mousePressEvent(QMouseEvent* event) override;
72 void setCurrentInputHints(Qt::InputMethodHints hints);
75 public slots:
79 protected slots:
81 signals:
84 public:
86 protected:
87 void addChar(char value);
88 void setupButton(Button* b, char insert_char, bool add_to_lookup = true);
90 void backspace();
94 void complete();
95 void clear();
100 QLineEdit* m_line_edit;
101 QTextEdit* m_text_edit;
109 Ui::KeypadUI* ui;
111 Qt::InputMethodHints m_input_hints;
112 };
113}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
The default object to store data of any type that should persist through sessions of the application.
Definition Button.h:57
A core widget that allows the user to click one of many button types.
Definition Button.h:66
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
A popup for showing a virtual keyboard or keypad. Changes based on the allowed input to a.
Definition Keypad.h:54
QTimer * m_visibility_check_timer
Definition Keypad.h:110
void setTextEdit(QTextEdit *line_edit)
QWidget * currentWidget() const
QSize minimumSizeHint() const override
QCustomLineEdit * editor() const
void updateWindowTitle()
void requestHideSlot()
bool m_is_folder
Definition Keypad.h:107
QSize sizeHint() const override
bool isFullKeyboard() const
Definition Keypad.h:68
String m_original_text
Definition Keypad.h:103
void focusPreviousWidget()
Keypad(QWidget *parent=nullptr)
QLineEdit * m_line_edit
Definition Keypad.h:100
void requestPopupSlot()
static Keypad * DefaultKeypad()
QTextEdit * m_text_edit
Definition Keypad.h:101
void mousePressEvent(QMouseEvent *event) override
void setCurrentInputHints(Qt::InputMethodHints hints)
String m_current_text
Definition Keypad.h:105
Dictionary< String, Button * > m_symbols_b
Definition Keypad.h:99
void updateUppercase()
void updateFocusGroups()
void setLineEdit(QLineEdit *line_edit)
void onFocusObjectDeleted()
void focusInEvent(QFocusEvent *focus) override
void unsetCurrent()
bool m_is_file
Definition Keypad.h:106
bool m_is_full_keyboard
Definition Keypad.h:108
void setUpperCase(bool uppercase)
void setupButton(Button *b)
void backspace()
Ui::KeypadUI * ui
Definition Keypad.h:109
Qt::InputMethodHints m_input_hints
Definition Keypad.h:111
void updateCurrentText()
QWidget * m_last_widget
Definition Keypad.h:102
void addChar(char value)
Dictionary< String, Button * > m_symbols_a
Definition Keypad.h:98
void requestHideSignal()
void slideInKeyboard(uint04 value)
QWidget * lastWidget() const
Dictionary< char, Button * > m_buttons
Definition Keypad.h:97
static ApplicationOption< bool > use_keypad_in_touch
Definition Keypad.h:85
void setupButton(Button *b, char insert_char, bool add_to_lookup=true)
QString m_original_window_title
Definition Keypad.h:104
void requestPopupSignal()
void focusNextWidget()
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition QCustomLineEdit.h:56
The core String class for the software.
Definition String.h:47
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:94
Definition FontEditor.h:6