48 #include <bps/event.h> 49 #include <bps/locale.h> 50 #include <bps/virtualkeyboard.h> 57 if (locale_request_events(0) != BPS_SUCCESS)
58 qWarning(
"QBB: Failed to register for locale events");
60 if (virtualkeyboard_request_events(0) != BPS_SUCCESS)
61 qWarning(
"QBB: Failed to register for virtual keyboard events");
64 if (virtualkeyboard_get_height(&height) != BPS_SUCCESS)
65 qWarning(
"QBB: Failed to get virtual keyboard height");
72 const int eventDomain = bps_event_get_domain(event);
73 if (eventDomain == locale_get_domain())
76 if (eventDomain == virtualkeyboard_get_domain())
84 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 92 virtualkeyboard_show();
98 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 102 virtualkeyboard_hide();
108 virtualkeyboard_layout_t
layout = VIRTUALKEYBOARD_LAYOUT_DEFAULT;
112 layout = VIRTUALKEYBOARD_LAYOUT_URL;
116 layout = VIRTUALKEYBOARD_LAYOUT_EMAIL;
120 layout = VIRTUALKEYBOARD_LAYOUT_WEB;
124 layout = VIRTUALKEYBOARD_LAYOUT_NUM_PUNC;
128 layout = VIRTUALKEYBOARD_LAYOUT_SYMBOL;
132 layout = VIRTUALKEYBOARD_LAYOUT_PHONE;
136 layout = VIRTUALKEYBOARD_LAYOUT_PIN;
141 layout = VIRTUALKEYBOARD_LAYOUT_DEFAULT;
145 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 149 virtualkeyboard_change_options(layout, VIRTUALKEYBOARD_ENTER_DEFAULT);
154 if (bps_event_get_code(event) == LOCALE_INFO) {
158 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 160 <<
"new language/country=" << language <<
"/" <<
country;
167 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 168 qDebug() <<
"QBB: Unhandled locale event. code=" << bps_event_get_code(event);
176 switch (bps_event_get_code(event)) {
177 case VIRTUALKEYBOARD_EVENT_VISIBLE:
178 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 185 case VIRTUALKEYBOARD_EVENT_HIDDEN:
186 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 193 case VIRTUALKEYBOARD_EVENT_INFO: {
194 const int newHeight = virtualkeyboard_event_get_height(event);
196 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 205 #if defined(QBBVIRTUALKEYBOARD_DEBUG) 206 qDebug() <<
"QBB: Unhandled virtual keyboard event. code=" << bps_event_get_code(event);
void setLanguage(const QString &language)
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
void setCountry(const QString &country)
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Q_CORE_EXPORT void qDebug(const char *,...)
QBBVirtualKeyboardBps(QObject *parent=0)
QLocale::Language language
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString countryId() const
Q_CORE_EXPORT void qWarning(const char *,...)
void setHeight(int height)
bool handleVirtualKeyboardEvent(bps_event_t *event)
bool handleEvent(bps_event_t *event)
void applyKeyboardMode(KeyboardMode mode)
KeyboardMode keyboardMode() const
void setVisible(bool visible)
bool handleLocaleEvent(bps_event_t *event)
QString languageId() const