MythTV  master
mythuitextedit.cpp
Go to the documentation of this file.
1 // Own header
2 #include "mythuitextedit.h"
3 
4 // QT headers
5 #include <QApplication>
6 #include <QChar>
7 #include <QKeyEvent>
8 #include <QDomDocument>
9 #include <QInputMethodEvent>
10 #include <Qt>
11 
12 // libmythbase headers
13 #include "libmythbase/mythdb.h"
15 
16 // MythUI headers
17 #include "mythpainter.h"
18 #include "mythmainwindow.h"
19 #include "mythfontproperties.h"
20 #include "mythuihelper.h"
21 #include "mythgesture.h"
22 #include "mythuitext.h"
23 #include "mythuistatetype.h"
24 #include "mythuiimage.h"
25 
26 #define LOC QString("MythUITextEdit: ")
27 
28 MythUITextEdit::MythUITextEdit(MythUIType *parent, const QString &name)
29  : MythUIType(parent, name)
30 {
31  m_message = "";
32 
33  connect(this, &MythUIType::TakingFocus, this, &MythUITextEdit::Select);
34  connect(this, &MythUIType::LosingFocus, this, &MythUITextEdit::Deselect);
35 
36  m_canHaveFocus = true;
37 
39  m_messageBak.clear();
40 }
41 
43 {
45  LOG(VB_GENERAL, LOG_ERR, LOC + "selected state doesn't exist");
46 }
47 
49 {
51  LOG(VB_GENERAL, LOG_ERR, LOC + "active state doesn't exist");
52 }
53 
55 {
56  SetText("");
57 }
58 
60 {
61  if (!m_cursorImage)
62  return;
63 
64  if (m_hasFocus)
65  {
66  if (m_lastKeyPress.elapsed() < 500ms)
67  {
69  m_blinkInterval = 0;
70  }
72  {
73  m_blinkInterval = 0;
74 
75  if (m_cursorImage->IsVisible())
76  m_cursorImage->SetVisible(false);
77  else
79  }
80 
82  }
83  else
84  m_cursorImage->SetVisible(false);
85 
87 }
88 
90  const QString &filename, QDomElement &element, bool showWarnings)
91 {
92  bool parsed = true;
93 
94  if (element.tagName() == "area")
95  {
96  SetArea(parseRect(element));
97  }
98  else if (element.tagName() == "keyboardposition")
99  {
100  QString pos = getFirstText(element);
101 
102  if (pos == "aboveedit")
104  else if (pos == "belowedit")
106  else if (pos == "screentop")
108  else if (pos == "screenbottom")
110  else if (pos == "screencenter")
112  else
113  {
114  VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
115  QString("Unknown popup position '%1'").arg(pos));
117  }
118  }
119  else
120  {
121  return MythUIType::ParseElement(filename, element, showWarnings);
122  }
123 
124  return parsed;
125 }
126 
128 {
130 
131  // Give it something to chew on, so it can position the initial
132  // cursor in the right place. Toggle text, to force an area recalc.
133  if (m_text)
134  {
135  m_text->SetText(".");
136  m_text->SetText("");
137  }
138 
139  if (m_cursorImage && m_text)
141 }
142 
144 {
145  if (m_initialized)
146  return;
147 
148  m_initialized = true;
149 
150  m_text = dynamic_cast<MythUIText *>(GetChild("text"));
151  m_cursorImage = dynamic_cast<MythUIImage *>(GetChild("cursor"));
153  dynamic_cast<MythUIStateType *>(GetChild("background"));
154 
155  if (!m_text)
156  LOG(VB_GENERAL, LOG_ERR, LOC + "Missing text element.");
157 
158  if (!m_cursorImage)
159  LOG(VB_GENERAL, LOG_ERR, LOC + "Missing cursor element.");
160 
161  if (!m_backgroundState)
162  LOG(VB_GENERAL, LOG_WARNING, LOC + "Missing background element.");
163 
164  if (!m_text || !m_cursorImage)
165  {
166  m_text = nullptr;
167  m_cursorImage = nullptr;
168  m_backgroundState = nullptr;
169  return;
170  }
171 
173  LOG(VB_GENERAL, LOG_ERR, LOC + "active state doesn't exist");
174  m_text->SetCutDown(Qt::ElideNone);
175 
176  QFontMetrics fm(m_text->GetFontProperties()->face());
177  int height = fm.height();
178 
179  if (height > 0)
180  {
181  MythRect imageArea = m_cursorImage->GetFullArea();
182  int width = int(((float)height / (float)imageArea.height())
183  * (float)imageArea.width());
184 
185  if (width <= 0)
186  width = 1;
187 
188  m_cursorImage->ForceSize(QSize(width, height));
189  }
190 }
191 
192 void MythUITextEdit::SetMaxLength(const int length)
193 {
194  m_maxLength = length;
195 }
196 
197 void MythUITextEdit::SetText(const QString &text, bool moveCursor)
198 {
199  if (!m_text || (m_message == text))
200  return;
201 
202  m_message = text;
203 
204  if (m_isPassword)
205  {
206  QString obscured;
207 
208  obscured.fill('*', m_message.size());
209  m_text->SetText(obscured);
210  }
211  else
213 
214  if (moveCursor)
216 
217  emit valueChanged();
218 }
219 
220 void MythUITextEdit::InsertText(const QString &text)
221 {
222  if (!m_text)
223  return;
224 
225  for (const auto& c : std::as_const(text))
226  InsertCharacter(c);
227 
228  emit valueChanged();
229 }
230 
231 bool MythUITextEdit::InsertCharacter(const QString &character)
232 {
233  if (m_maxLength != 0 && m_message.length() == m_maxLength)
234  return false;
235 
236  QString newmessage = m_message;
237 
238  const QChar *unichar = character.unicode();
239 
240  // Filter all non printable characters
241  if (!unichar->isPrint())
242  return false;
243 
244  if ((m_filter & FilterAlpha) && unichar->isLetter())
245  return false;
246 
247  if ((m_filter & FilterNumeric) && unichar->isNumber())
248  return false;
249 
250  if ((m_filter & FilterSymbols) && unichar->isSymbol())
251  return false;
252 
253  if ((m_filter & FilterPunct) && unichar->isPunct())
254  return false;
255 
256  newmessage.insert(m_position + 1, character);
257  SetText(newmessage, false);
259 
260  return true;
261 }
262 
263 // This is used for updating IME.
264 bool MythUITextEdit::UpdateTmpString(const QString &str)
265 {
266  if (!m_text)
267  return false;
268 
269  if (str.isEmpty())
270  return false;
271  QString newmessage = m_message;
272  newmessage.append(str);
273  SetText(newmessage, false);
274  return true;
275 }
276 
278 {
279  if (m_message.isEmpty() || position < 0 || position >= m_message.size())
280  return;
281 
282  QString newmessage = m_message;
283 
284  newmessage.remove(position, 1);
285  SetText(newmessage, false);
286 
287  if (position == m_position)
289 }
290 
292 {
293  if (!m_text || !m_cursorImage)
294  return false;
295 
296  switch (moveDir)
297  {
298  case MoveLeft:
299  if (m_position < 0)
300  return false;
301  m_position--;
302  break;
303  case MoveRight:
304  if (m_position == (m_message.size() - 1))
305  return false;
306  m_position++;
307  break;
308  case MoveUp:
309  {
310  int newPos = m_text->MoveCursor(-1);
311  if (newPos == -1)
312  return false;
313  m_position = newPos - 1;
314  break;
315  }
316  case MoveDown:
317  {
318  int newPos = m_text->MoveCursor(1);
319  if (newPos == -1)
320  return false;
321  m_position = newPos - 1;
322  break;
323  }
324  case MovePageUp:
325  {
326  int lines = m_text->m_area.height() / (m_text->m_lineHeight + m_text->m_leading);
327  int newPos = m_text->MoveCursor(-lines);
328  if (newPos == -1)
329  return false;
330  m_position = newPos - 1;
331  break;
332  }
333  case MovePageDown:
334  {
335  int lines = m_text->m_area.height() / (m_text->m_lineHeight + m_text->m_leading);
336  int newPos = m_text->MoveCursor(lines);
337  if (newPos == -1)
338  return false;
339  m_position = newPos - 1;
340  break;
341  }
342  case MoveEnd:
343  m_position = m_message.size() - 1;
344  break;
345  }
346 
348 
349  SetRedraw();
350  return true;
351 }
352 
354 {
356  Reset();
357 }
358 
360 {
361  QClipboard *clipboard = QApplication::clipboard();
362 
363  clipboard->setText(m_message);
364 }
365 
367 {
368  QClipboard *clipboard = QApplication::clipboard();
369 
370  if (!clipboard->supportsSelection())
371  mode = QClipboard::Clipboard;
372 
373  InsertText(clipboard->text(mode));
374 }
375 
376 using keyCombo = QPair<int, int>;
377 static QMap<keyCombo, int> gDeadKeyMap;
378 
379 static void LoadDeadKeys(QMap<QPair<int, int>, int> &map)
380 {
381  // Dead key // Key // Result
382  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_A)] = Qt::Key_Agrave;
383  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_A)] = Qt::Key_Aacute;
384  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_A)] = Qt::Key_Acircumflex;
385  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_A)] = Qt::Key_Atilde;
386  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_A)] = Qt::Key_Adiaeresis;
387  map[keyCombo(Qt::Key_Dead_Abovering, Qt::Key_A)] = Qt::Key_Aring;
388 
389  map[keyCombo(Qt::Key_Dead_Cedilla, Qt::Key_C)] = Qt::Key_Ccedilla;
390 
391  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_E)] = Qt::Key_Egrave;
392  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_E)] = Qt::Key_Eacute;
393  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_E)] = Qt::Key_Ecircumflex;
394  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_E)] = Qt::Key_Ediaeresis;
395 
396  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_I)] = Qt::Key_Igrave;
397  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_I)] = Qt::Key_Iacute;
398  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_I)] = Qt::Key_Icircumflex;
399  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_I)] = Qt::Key_Idiaeresis;
400 
401  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_N)] = Qt::Key_Ntilde;
402 
403  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_O)] = Qt::Key_Ograve;
404  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_O)] = Qt::Key_Oacute;
405  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_O)] = Qt::Key_Ocircumflex;
406  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_O)] = Qt::Key_Otilde;
407  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_O)] = Qt::Key_Odiaeresis;
408 
409  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_U)] = Qt::Key_Ugrave;
410  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_U)] = Qt::Key_Uacute;
411  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_U)] = Qt::Key_Ucircumflex;
412  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_U)] = Qt::Key_Udiaeresis;
413 
414  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_Y)] = Qt::Key_Yacute;
415  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_Y)] = Qt::Key_ydiaeresis;
416 }
417 
418 bool MythUITextEdit::inputMethodEvent(QInputMethodEvent *event)
419 {
420  // 1st test.
421  if (m_isPassword)
422  return false;
423 
424  bool _bak = m_isIMEinput;
425  if (!m_isIMEinput && (event->commitString().isEmpty() || event->preeditString().isEmpty()))
426  {
427  m_isIMEinput = true;
429  }
430 #if 0
431  printf("IME: %s->%s PREEDIT=\"%s\" COMMIT=\"%s\"\n"
432  , (_bak) ? "ON" : "OFF"
433  , (m_isIMEinput) ? "ON" : "OFF"
434  , event->preeditString().toUtf8().constData()
435  , event->commitString().toUtf8().constData());
436 #endif
437  if (!event->commitString().isEmpty() && m_isIMEinput)
438  {
440  m_messageBak.clear();
441  InsertText(event->commitString());
442  m_isIMEinput = false;
443  return true; // commited
444  }
445  if (m_isIMEinput && !event->preeditString().isEmpty())
446  {
448  UpdateTmpString(event->preeditString());
449  return true; // preedited
450  }
451  if (m_isIMEinput && _bak)
452  { // Abort?
453  m_isIMEinput = false;
454  QString newmessage= m_messageBak;
455  m_messageBak.clear();
456  SetText(newmessage, true);
457  return true;
458  }
459  return true; // Not commited
460 }
461 
462 bool MythUITextEdit::keyPressEvent(QKeyEvent *event)
463 {
464  if (m_isIMEinput) // Prefer IME then keyPress.
465  return true;
467 
468  QStringList actions;
469  bool handled = false;
470 
471  handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions,
472  false);
473 
474  Qt::KeyboardModifiers modifiers = event->modifiers();
475  int keynum = event->key();
476 
477  if (keynum >= Qt::Key_Shift && keynum <= Qt::Key_CapsLock)
478  return false;
479 
480  QString character;
481  // Compose key handling
482  // Enter composition mode
483  if (((modifiers & Qt::GroupSwitchModifier) != 0U) &&
484  (keynum >= Qt::Key_Dead_Grave) && (keynum <= Qt::Key_Dead_Horn))
485  {
486  m_composeKey = keynum;
487  handled = true;
488  }
489  else if (m_composeKey > 0) // 'Compose' the key
490  {
491  if (gDeadKeyMap.isEmpty())
493 
494  LOG(VB_GUI, LOG_DEBUG, QString("Compose key: %1 Key: %2")
495  .arg(QString::number(m_composeKey, 16), QString::number(keynum, 16)));
496 
497  if (gDeadKeyMap.contains(keyCombo(m_composeKey, keynum)))
498  {
499  int keycode = gDeadKeyMap.value(keyCombo(m_composeKey, keynum));
500 
501  //QKeyEvent key(QEvent::KeyPress, keycode, modifiers);
502  character = QChar(keycode);
503 
504  if ((modifiers & Qt::ShiftModifier) != 0U)
505  character = character.toUpper();
506  else
507  character = character.toLower();
508  LOG(VB_GUI, LOG_DEBUG, QString("Found match for dead-key combo - %1").arg(character));
509  }
510  m_composeKey = 0;
511  }
512 
513  if (character.isEmpty())
514  character = event->text();
515 
516  if (!handled && InsertCharacter(character))
517  handled = true;
518 
519  for (int i = 0; i < actions.size() && !handled; i++)
520  {
521 
522  QString action = actions[i];
523  handled = true;
524 
525  if (action == "LEFT")
526  {
528  }
529  else if (action == "RIGHT")
530  {
532  }
533  else if (action == "UP")
534  {
535  handled = MoveCursor(MoveUp);
536  }
537  else if (action == "DOWN")
538  {
539  handled = MoveCursor(MoveDown);
540  }
541  else if (action == "PAGEUP")
542  {
543  handled = MoveCursor(MovePageUp);
544  }
545  else if (action == "PAGEDOWN")
546  {
547  handled = MoveCursor(MovePageDown);
548  }
549  else if (action == "DELETE")
550  {
552  }
553  else if (action == "BACKSPACE")
554  {
556  }
557  else if (action == "NEWLINE")
558  {
559  QString newmessage = m_message;
560  newmessage.insert(m_position + 1, '\n');
561  SetText(newmessage, false);
563  }
564  else if (action == "SELECT" && keynum != Qt::Key_Space
565  && GetMythDB()->GetNumSetting("UseVirtualKeyboard", 1) == 1)
566  {
567  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
568  auto *kb = new MythUIVirtualKeyboard(popupStack, this);
569 
570  if (kb->Create())
571  {
572  popupStack->AddScreen(kb);
573  }
574  else
575  delete kb;
576  }
577  else if (action == "CUT")
578  {
580  }
581  else if (action == "COPY")
582  {
584  }
585  else if (action == "PASTE")
586  {
588  }
589  else
590  handled = false;
591  }
592 
593  return handled;
594 }
595 
602 {
603  bool handled = false;
604 
605  if (event->GetGesture() == MythGestureEvent::Click &&
606  event->GetButton() == Qt::MiddleButton)
607  {
608  PasteTextFromClipboard(QClipboard::Selection);
609  }
610 
611  return handled;
612 }
613 
615 {
616  auto *textedit = dynamic_cast<MythUITextEdit *>(base);
617 
618  if (!textedit)
619  {
620  LOG(VB_GENERAL, LOG_ERR, LOC + "ERROR, bad parsing");
621  return;
622  }
623 
624  m_message.clear();
625  m_position = -1;
626 
627  m_blinkInterval = textedit->m_blinkInterval;
628  m_cursorBlinkRate = textedit->m_cursorBlinkRate;
629  m_maxLength = textedit->m_maxLength;
630  m_filter = textedit->m_filter;
631  m_keyboardPosition = textedit->m_keyboardPosition;
632 
633  MythUIType::CopyFrom(base);
634 
636 }
637 
639 {
640  auto *textedit = new MythUITextEdit(parent, objectName());
641  textedit->CopyFrom(this);
642 }
MythUITextEdit::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitextedit.cpp:54
FilterAlpha
@ FilterAlpha
Definition: mythuitextedit.h:22
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:274
MythUITextEdit::m_position
int m_position
Definition: mythuitextedit.h:101
MythTimer::elapsed
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:91
MythUITextEdit::m_keyboardPosition
PopupPosition m_keyboardPosition
Definition: mythuitextedit.h:105
MythUITextEdit::SetMaxLength
void SetMaxLength(int length)
Definition: mythuitextedit.cpp:192
MythUITextEdit::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuitextedit.cpp:614
MythUITextEdit::m_text
MythUIText * m_text
Definition: mythuitextedit.h:109
MythUITextEdit::m_initialized
bool m_initialized
Definition: mythuitextedit.h:91
MythUITextEdit::MoveDown
@ MoveDown
Definition: mythuitextedit.h:56
mythuitext.h
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
LoadDeadKeys
static void LoadDeadKeys(QMap< QPair< int, int >, int > &map)
Definition: mythuitextedit.cpp:379
MythUIText::SetCutDown
void SetCutDown(Qt::TextElideMode mode)
Definition: mythuitext.cpp:282
mythdb.h
VK_POSTOPDIALOG
@ VK_POSTOPDIALOG
Definition: mythvirtualkeyboard.h:13
MythUITextEdit::m_lastKeyPress
MythTimer m_lastKeyPress
Definition: mythuitextedit.h:95
MythUITextEdit::PasteTextFromClipboard
void PasteTextFromClipboard(QClipboard::Mode mode=QClipboard::Clipboard)
Definition: mythuitextedit.cpp:366
MythGestureEvent::GetGesture
Gesture GetGesture() const
Definition: mythgesture.h:85
MythGestureEvent::GetButton
Qt::MouseButton GetButton() const
Definition: mythgesture.h:88
MythUITextEdit::m_backgroundState
MythUIStateType * m_backgroundState
Definition: mythuitextedit.h:107
MythUIType::GetFullArea
virtual MythRect GetFullArea(void) const
Definition: mythuitype.cpp:892
MythUITextEdit::ParseElement
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitextedit.cpp:89
MythUITextEdit::m_isIMEinput
bool m_isIMEinput
Definition: mythuitextedit.h:113
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:133
Mode
Mode
Definition: synaesthesia.h:23
VK_POSBELOWEDIT
@ VK_POSBELOWEDIT
Definition: mythvirtualkeyboard.h:12
MythUITextEdit::RemoveCharacter
void RemoveCharacter(int position)
Definition: mythuitextedit.cpp:277
MythUITextEdit::SetInitialStates
void SetInitialStates(void)
Definition: mythuitextedit.cpp:143
MythScreenStack
Definition: mythscreenstack.h:16
MythUITextEdit::m_maxLength
int m_maxLength
Definition: mythuitextedit.h:97
MythFontProperties::face
QFont face(void) const
Definition: mythfontproperties.cpp:40
MythUITextEdit::MoveEnd
@ MoveEnd
Definition: mythuitextedit.h:56
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:34
gDeadKeyMap
static QMap< keyCombo, int > gDeadKeyMap
Definition: mythuitextedit.cpp:377
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:609
MythUITextEdit::MovePageUp
@ MovePageUp
Definition: mythuitextedit.h:56
MythTimer::start
void start(void)
starts measuring elapsed time.
Definition: mythtimer.cpp:47
VK_POSBOTTOMDIALOG
@ VK_POSBOTTOMDIALOG
Definition: mythvirtualkeyboard.h:14
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
mythuistatetype.h
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:50
keyCombo
QPair< int, int > keyCombo
Definition: mythuitextedit.cpp:376
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
MythUIType::Pulse
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:455
MythUITextEdit::m_isPassword
bool m_isPassword
Definition: mythuitextedit.h:103
MythUIText::GetFontProperties
const MythFontProperties * GetFontProperties()
Definition: mythuitext.h:79
MythUIText::MoveCursor
int MoveCursor(int lines)
Definition: mythuitext.cpp:1017
mythuiimage.h
MythUITextEdit::InsertText
void InsertText(const QString &text)
Definition: mythuitextedit.cpp:220
MythUIType::TakingFocus
void TakingFocus()
MythUIText::m_lineHeight
int m_lineHeight
Definition: mythuitext.h:133
MythUITextEdit::MoveLeft
@ MoveLeft
Definition: mythuitextedit.h:56
MythUITextEdit::MoveRight
@ MoveRight
Definition: mythuitextedit.h:56
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:197
FilterNumeric
@ FilterNumeric
Definition: mythuitextedit.h:23
MythUITextEdit::m_blinkInterval
int m_blinkInterval
Definition: mythuitextedit.h:93
MythUIType::m_hasFocus
bool m_hasFocus
Definition: mythuitype.h:262
mythfontproperties.h
mythlogging.h
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1112
VK_POSCENTERDIALOG
@ VK_POSCENTERDIALOG
Definition: mythvirtualkeyboard.h:15
MythUIType::SetPosition
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
Definition: mythuitype.cpp:532
VERBOSE_XML
#define VERBOSE_XML(type, level, filename, element, msg)
Definition: xmlparsebase.h:15
FilterPunct
@ FilterPunct
Definition: mythuitextedit.h:26
MythTimer::restart
std::chrono::milliseconds restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
MythUIText::CursorPosition
QPoint CursorPosition(int text_offset)
Definition: mythuitext.cpp:1099
XMLParseBase::getFirstText
static QString getFirstText(QDomElement &element)
Definition: xmlparsebase.cpp:52
FilterSymbols
@ FilterSymbols
Definition: mythuitextedit.h:25
MythUITextEdit::m_composeKey
int m_composeKey
Definition: mythuitextedit.h:111
MythGestureEvent::Click
@ Click
Definition: mythgesture.h:77
MythUITextEdit::Pulse
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitextedit.cpp:59
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1174
MythUITextEdit::CreateCopy
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuitextedit.cpp:638
mythpainter.h
MythUITextEdit::m_messageBak
QString m_messageBak
Definition: mythuitextedit.h:114
XMLParseBase::parseRect
static MythRect parseRect(const QString &text, bool normalize=true)
Definition: xmlparsebase.cpp:132
LOC
#define LOC
Definition: mythuitextedit.cpp:26
MythUIVirtualKeyboard
A popup onscreen keyboard for easy alphanumeric and text entry using a remote control or mouse.
Definition: mythvirtualkeyboard.h:48
mythgesture.h
A C++ ripoff of the stroke library for MythTV.
MythUITextEdit::m_filter
InputFilter m_filter
Definition: mythuitextedit.h:100
MythUITextEdit::Finalize
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
Definition: mythuitextedit.cpp:127
MythUITextEdit::InsertCharacter
bool InsertCharacter(const QString &character)
Definition: mythuitextedit.cpp:231
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUITextEdit::CutTextToClipboard
void CutTextToClipboard(void)
Definition: mythuitextedit.cpp:353
mythuihelper.h
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
mythuitextedit.h
MythUITextEdit::m_cursorImage
MythUIImage * m_cursorImage
Definition: mythuitextedit.h:108
MythUITextEdit::Select
void Select()
Definition: mythuitextedit.cpp:42
MythUIType::m_canHaveFocus
bool m_canHaveFocus
Definition: mythuitype.h:263
MythUITextEdit::MoveDirection
MoveDirection
Definition: mythuitextedit.h:56
MythUIImage::ForceSize
void ForceSize(QSize size)
Force the dimensions of the widget and image to the given size.
Definition: mythuiimage.cpp:899
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:132
MythUIType::SetVisible
virtual void SetVisible(bool visible)
Definition: mythuitype.cpp:1108
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
build_compdb.action
action
Definition: build_compdb.py:9
MythUITextEdit::gestureEvent
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
Definition: mythuitextedit.cpp:601
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:323
MythUITextEdit::valueChanged
void valueChanged()
MythUITextEdit::MoveUp
@ MoveUp
Definition: mythuitextedit.h:56
MythGestureEvent
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
MythUITextEdit::m_cursorBlinkRate
int m_cursorBlinkRate
Definition: mythuitextedit.h:94
MythUITextEdit::inputMethodEvent
bool inputMethodEvent(QInputMethodEvent *event) override
Input Method event handler.
Definition: mythuitextedit.cpp:418
MythUIText::m_leading
int m_leading
Definition: mythuitext.h:131
MythUITextEdit::UpdateTmpString
bool UpdateTmpString(const QString &str)
Definition: mythuitextedit.cpp:264
MythUIType::LosingFocus
void LosingFocus()
MythUIType::ParseElement
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitype.cpp:1240
MythUITextEdit::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythuitextedit.cpp:462
MythUITextEdit::CopyTextToClipboard
void CopyTextToClipboard(void)
Definition: mythuitextedit.cpp:359
build_compdb.filename
filename
Definition: build_compdb.py:21
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:308
MythUITextEdit::m_message
QString m_message
Definition: mythuitextedit.h:99
MythUIType::IsVisible
bool IsVisible(bool recurse=false) const
Definition: mythuitype.cpp:902
VK_POSABOVEEDIT
@ VK_POSABOVEEDIT
Definition: mythvirtualkeyboard.h:11
MythUITextEdit::MoveCursor
bool MoveCursor(MoveDirection moveDir)
Definition: mythuitextedit.cpp:291
MythUITextEdit::MythUITextEdit
MythUITextEdit(MythUIType *parent, const QString &name)
Definition: mythuitextedit.cpp:28
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MythUITextEdit::MovePageDown
@ MovePageDown
Definition: mythuitextedit.h:56
MythUITextEdit::Deselect
void Deselect()
Definition: mythuitextedit.cpp:48