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 <Qt>
10 
11 // libmythbase headers
12 #include "mythlogging.h"
13 #include "mythdb.h"
14 
15 // MythUI headers
16 #include "mythpainter.h"
17 #include "mythmainwindow.h"
18 #include "mythfontproperties.h"
19 #include "mythuihelper.h"
20 #include "mythgesture.h"
21 #include "mythuitext.h"
22 #include "mythuistatetype.h"
23 #include "mythuiimage.h"
24 
25 #define LOC QString("MythUITextEdit: ")
26 
27 MythUITextEdit::MythUITextEdit(MythUIType *parent, const QString &name)
28  : MythUIType(parent, name)
29 {
30  m_message = "";
32 
33  m_isPassword = false;
34 
35  m_blinkInterval = 0;
36  m_cursorBlinkRate = 40;
37 
38  m_position = -1;
39 
40  m_maxLength = 255;
41 
42  m_backgroundState = nullptr;
43  m_cursorImage = nullptr;
44  m_text = nullptr;
45 
47 
48  connect(this, &MythUIType::TakingFocus, this, &MythUITextEdit::Select);
49  connect(this, &MythUIType::LosingFocus, this, &MythUITextEdit::Deselect);
50 
51  m_canHaveFocus = true;
52 
53  m_initialized = false;
54 
56 
57  m_composeKey = 0;
58 }
59 
61 {
63  LOG(VB_GENERAL, LOG_ERR, LOC + "selected state doesn't exist");
64 }
65 
67 {
69  LOG(VB_GENERAL, LOG_ERR, LOC + "active state doesn't exist");
70 }
71 
73 {
74  SetText("");
75 }
76 
78 {
79  if (!m_cursorImage)
80  return;
81 
82  if (m_hasFocus)
83  {
84  if (m_lastKeyPress.elapsed() < 500ms)
85  {
87  m_blinkInterval = 0;
88  }
90  {
91  m_blinkInterval = 0;
92 
93  if (m_cursorImage->IsVisible())
94  m_cursorImage->SetVisible(false);
95  else
97  }
98 
100  }
101  else
102  m_cursorImage->SetVisible(false);
103 
105 }
106 
108  const QString &filename, QDomElement &element, bool showWarnings)
109 {
110  bool parsed = true;
111 
112  if (element.tagName() == "area")
113  {
114  SetArea(parseRect(element));
115  }
116  else if (element.tagName() == "keyboardposition")
117  {
118  QString pos = getFirstText(element);
119 
120  if (pos == "aboveedit")
122  else if (pos == "belowedit")
124  else if (pos == "screentop")
126  else if (pos == "screenbottom")
128  else if (pos == "screencenter")
130  else
131  {
132  VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
133  QString("Unknown popup position '%1'").arg(pos));
135  }
136  }
137  else
138  {
139  return MythUIType::ParseElement(filename, element, showWarnings);
140  }
141 
142  return parsed;
143 }
144 
146 {
148 
149  // Give it something to chew on, so it can position the initial
150  // cursor in the right place. Toggle text, to force an area recalc.
151  if (m_text)
152  {
153  m_text->SetText(".");
154  m_text->SetText("");
155  }
156 
157  if (m_cursorImage && m_text)
159 }
160 
162 {
163  if (m_initialized)
164  return;
165 
166  m_initialized = true;
167 
168  m_text = dynamic_cast<MythUIText *>(GetChild("text"));
169  m_cursorImage = dynamic_cast<MythUIImage *>(GetChild("cursor"));
171  dynamic_cast<MythUIStateType *>(GetChild("background"));
172 
173  if (!m_text)
174  LOG(VB_GENERAL, LOG_ERR, LOC + "Missing text element.");
175 
176  if (!m_cursorImage)
177  LOG(VB_GENERAL, LOG_ERR, LOC + "Missing cursor element.");
178 
179  if (!m_backgroundState)
180  LOG(VB_GENERAL, LOG_WARNING, LOC + "Missing background element.");
181 
182  if (!m_text || !m_cursorImage)
183  {
184  m_text = nullptr;
185  m_cursorImage = nullptr;
186  m_backgroundState = nullptr;
187  return;
188  }
189 
191  LOG(VB_GENERAL, LOG_ERR, LOC + "active state doesn't exist");
192  m_text->SetCutDown(Qt::ElideNone);
193 
194  QFontMetrics fm(m_text->GetFontProperties()->face());
195  int height = fm.height();
196 
197  if (height > 0)
198  {
199  MythRect imageArea = m_cursorImage->GetFullArea();
200  int width = int(((float)height / (float)imageArea.height())
201  * (float)imageArea.width());
202 
203  if (width <= 0)
204  width = 1;
205 
206  m_cursorImage->ForceSize(QSize(width, height));
207  }
208 }
209 
210 void MythUITextEdit::SetMaxLength(const int length)
211 {
212  m_maxLength = length;
213 }
214 
215 void MythUITextEdit::SetText(const QString &text, bool moveCursor)
216 {
217  if (!m_text || (m_message == text))
218  return;
219 
220  m_message = text;
221 
222  if (m_isPassword)
223  {
224  QString obscured;
225 
226  obscured.fill('*', m_message.size());
227  m_text->SetText(obscured);
228  }
229  else
231 
232  if (moveCursor)
234 
235  emit valueChanged();
236 }
237 
238 void MythUITextEdit::InsertText(const QString &text)
239 {
240  if (!m_text)
241  return;
242 
243  for (auto c : qAsConst(text))
244  InsertCharacter(c);
245 
246  emit valueChanged();
247 }
248 
249 bool MythUITextEdit::InsertCharacter(const QString &character)
250 {
251  if (m_maxLength != 0 && m_message.length() == m_maxLength)
252  return false;
253 
254  QString newmessage = m_message;
255 
256  const QChar *unichar = character.unicode();
257 
258  // Filter all non printable characters
259  if (!unichar->isPrint())
260  return false;
261 
262  if ((m_filter & FilterAlpha) && unichar->isLetter())
263  return false;
264 
265  if ((m_filter & FilterNumeric) && unichar->isNumber())
266  return false;
267 
268  if ((m_filter & FilterSymbols) && unichar->isSymbol())
269  return false;
270 
271  if ((m_filter & FilterPunct) && unichar->isPunct())
272  return false;
273 
274  newmessage.insert(m_position + 1, character);
275  SetText(newmessage, false);
277 
278  return true;
279 }
280 
282 {
283  if (m_message.isEmpty() || position < 0 || position >= m_message.size())
284  return;
285 
286  QString newmessage = m_message;
287 
288  newmessage.remove(position, 1);
289  SetText(newmessage, false);
290 
291  if (position == m_position)
293 }
294 
296 {
297  if (!m_text || !m_cursorImage)
298  return false;
299 
300  switch (moveDir)
301  {
302  case MoveLeft:
303  if (m_position < 0)
304  return false;
305  m_position--;
306  break;
307  case MoveRight:
308  if (m_position == (m_message.size() - 1))
309  return false;
310  m_position++;
311  break;
312  case MoveUp:
313  {
314  int newPos = m_text->MoveCursor(-1);
315  if (newPos == -1)
316  return false;
317  m_position = newPos - 1;
318  break;
319  }
320  case MoveDown:
321  {
322  int newPos = m_text->MoveCursor(1);
323  if (newPos == -1)
324  return false;
325  m_position = newPos - 1;
326  break;
327  }
328  case MovePageUp:
329  {
330  int lines = m_text->m_area.height() / (m_text->m_lineHeight + m_text->m_leading);
331  int newPos = m_text->MoveCursor(-lines);
332  if (newPos == -1)
333  return false;
334  m_position = newPos - 1;
335  break;
336  }
337  case MovePageDown:
338  {
339  int lines = m_text->m_area.height() / (m_text->m_lineHeight + m_text->m_leading);
340  int newPos = m_text->MoveCursor(lines);
341  if (newPos == -1)
342  return false;
343  m_position = newPos - 1;
344  break;
345  }
346  case MoveEnd:
347  m_position = m_message.size() - 1;
348  break;
349  }
350 
352 
353  SetRedraw();
354  return true;
355 }
356 
358 {
360  Reset();
361 }
362 
364 {
365  QClipboard *clipboard = QApplication::clipboard();
366 
367  clipboard->setText(m_message);
368 }
369 
370 void MythUITextEdit::PasteTextFromClipboard(QClipboard::Mode mode)
371 {
372  QClipboard *clipboard = QApplication::clipboard();
373 
374  if (!clipboard->supportsSelection())
375  mode = QClipboard::Clipboard;
376 
377  InsertText(clipboard->text(mode));
378 }
379 
380 using keyCombo = QPair<int, int>;
381 static QMap<keyCombo, int> gDeadKeyMap;
382 
383 static void LoadDeadKeys(QMap<QPair<int, int>, int> &map)
384 {
385  // Dead key // Key // Result
386  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_A)] = Qt::Key_Agrave;
387  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_A)] = Qt::Key_Aacute;
388  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_A)] = Qt::Key_Acircumflex;
389  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_A)] = Qt::Key_Atilde;
390  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_A)] = Qt::Key_Adiaeresis;
391  map[keyCombo(Qt::Key_Dead_Abovering, Qt::Key_A)] = Qt::Key_Aring;
392 
393  map[keyCombo(Qt::Key_Dead_Cedilla, Qt::Key_C)] = Qt::Key_Ccedilla;
394 
395  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_E)] = Qt::Key_Egrave;
396  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_E)] = Qt::Key_Eacute;
397  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_E)] = Qt::Key_Ecircumflex;
398  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_E)] = Qt::Key_Ediaeresis;
399 
400  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_I)] = Qt::Key_Igrave;
401  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_I)] = Qt::Key_Iacute;
402  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_I)] = Qt::Key_Icircumflex;
403  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_I)] = Qt::Key_Idiaeresis;
404 
405  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_N)] = Qt::Key_Ntilde;
406 
407  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_O)] = Qt::Key_Ograve;
408  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_O)] = Qt::Key_Oacute;
409  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_O)] = Qt::Key_Ocircumflex;
410  map[keyCombo(Qt::Key_Dead_Tilde, Qt::Key_O)] = Qt::Key_Otilde;
411  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_O)] = Qt::Key_Odiaeresis;
412 
413  map[keyCombo(Qt::Key_Dead_Grave, Qt::Key_U)] = Qt::Key_Ugrave;
414  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_U)] = Qt::Key_Uacute;
415  map[keyCombo(Qt::Key_Dead_Circumflex, Qt::Key_U)] = Qt::Key_Ucircumflex;
416  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_U)] = Qt::Key_Udiaeresis;
417 
418  map[keyCombo(Qt::Key_Dead_Acute, Qt::Key_Y)] = Qt::Key_Yacute;
419  map[keyCombo(Qt::Key_Dead_Diaeresis, Qt::Key_Y)] = Qt::Key_ydiaeresis;
420 }
421 
422 bool MythUITextEdit::keyPressEvent(QKeyEvent *event)
423 {
425 
426  QStringList actions;
427  bool handled = false;
428 
429  handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions,
430  false);
431 
432  Qt::KeyboardModifiers modifiers = event->modifiers();
433  int keynum = event->key();
434 
435  if (keynum >= Qt::Key_Shift && keynum <= Qt::Key_CapsLock)
436  return false;
437 
438  QString character;
439  // Compose key handling
440  // Enter composition mode
441  if (((modifiers & Qt::GroupSwitchModifier) != 0U) &&
442  (keynum >= Qt::Key_Dead_Grave) && (keynum <= Qt::Key_Dead_Horn))
443  {
444  m_composeKey = keynum;
445  handled = true;
446  }
447  else if (m_composeKey > 0) // 'Compose' the key
448  {
449  if (gDeadKeyMap.isEmpty())
451 
452  LOG(VB_GUI, LOG_DEBUG, QString("Compose key: %1 Key: %2")
453  .arg(QString::number(m_composeKey, 16), QString::number(keynum, 16)));
454 
455  if (gDeadKeyMap.contains(keyCombo(m_composeKey, keynum)))
456  {
457  int keycode = gDeadKeyMap.value(keyCombo(m_composeKey, keynum));
458 
459  //QKeyEvent key(QEvent::KeyPress, keycode, modifiers);
460  character = QChar(keycode);
461 
462  if ((modifiers & Qt::ShiftModifier) != 0U)
463  character = character.toUpper();
464  else
465  character = character.toLower();
466  LOG(VB_GUI, LOG_DEBUG, QString("Found match for dead-key combo - %1").arg(character));
467  }
468  m_composeKey = 0;
469  }
470 
471  if (character.isEmpty())
472  character = event->text();
473 
474  if (!handled && InsertCharacter(character))
475  handled = true;
476 
477  for (int i = 0; i < actions.size() && !handled; i++)
478  {
479 
480  QString action = actions[i];
481  handled = true;
482 
483  if (action == "LEFT")
484  {
486  }
487  else if (action == "RIGHT")
488  {
490  }
491  else if (action == "UP")
492  {
493  handled = MoveCursor(MoveUp);
494  }
495  else if (action == "DOWN")
496  {
497  handled = MoveCursor(MoveDown);
498  }
499  else if (action == "PAGEUP")
500  {
501  handled = MoveCursor(MovePageUp);
502  }
503  else if (action == "PAGEDOWN")
504  {
505  handled = MoveCursor(MovePageDown);
506  }
507  else if (action == "DELETE")
508  {
510  }
511  else if (action == "BACKSPACE")
512  {
514  }
515  else if (action == "NEWLINE")
516  {
517  QString newmessage = m_message;
518  newmessage.insert(m_position + 1, '\n');
519  SetText(newmessage, false);
521  }
522  else if (action == "SELECT" && keynum != Qt::Key_Space
523  && GetMythDB()->GetNumSetting("UseVirtualKeyboard", 1) == 1)
524  {
525  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
526  auto *kb = new MythUIVirtualKeyboard(popupStack, this);
527 
528  if (kb->Create())
529  {
530  popupStack->AddScreen(kb);
531  }
532  else
533  delete kb;
534  }
535  else if (action == "CUT")
536  {
538  }
539  else if (action == "COPY")
540  {
542  }
543  else if (action == "PASTE")
544  {
546  }
547  else
548  handled = false;
549  }
550 
551  return handled;
552 }
553 
560 {
561  bool handled = false;
562 
563  if (event->GetGesture() == MythGestureEvent::Click &&
564  event->GetButton() == Qt::MiddleButton)
565  {
566  PasteTextFromClipboard(QClipboard::Selection);
567  }
568 
569  return handled;
570 }
571 
573 {
574  auto *textedit = dynamic_cast<MythUITextEdit *>(base);
575 
576  if (!textedit)
577  {
578  LOG(VB_GENERAL, LOG_ERR, LOC + "ERROR, bad parsing");
579  return;
580  }
581 
582  m_message.clear();
583  m_position = -1;
584 
585  m_blinkInterval = textedit->m_blinkInterval;
586  m_cursorBlinkRate = textedit->m_cursorBlinkRate;
587  m_maxLength = textedit->m_maxLength;
588  m_filter = textedit->m_filter;
589  m_keyboardPosition = textedit->m_keyboardPosition;
590 
591  MythUIType::CopyFrom(base);
592 
594 }
595 
597 {
598  auto *textedit = new MythUITextEdit(parent, objectName());
599  textedit->CopyFrom(this);
600 }
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:72
FilterAlpha
@ FilterAlpha
Definition: mythuitextedit.h:20
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:271
MythUITextEdit::m_position
int m_position
Definition: mythuitextedit.h:97
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:101
MythUITextEdit::SetMaxLength
void SetMaxLength(int length)
Definition: mythuitextedit.cpp:210
MythUITextEdit::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuitextedit.cpp:572
MythUITextEdit::m_text
MythUIText * m_text
Definition: mythuitextedit.h:105
MythUITextEdit::m_initialized
bool m_initialized
Definition: mythuitextedit.h:87
MythUITextEdit::MoveDown
@ MoveDown
Definition: mythuitextedit.h:53
mythuitext.h
FilterNone
@ FilterNone
Definition: mythuitextedit.h:19
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:383
MythUIText::SetCutDown
void SetCutDown(Qt::TextElideMode mode)
Definition: mythuitext.cpp:283
mythdb.h
VK_POSTOPDIALOG
@ VK_POSTOPDIALOG
Definition: mythvirtualkeyboard.h:13
MythUITextEdit::m_lastKeyPress
MythTimer m_lastKeyPress
Definition: mythuitextedit.h:91
MythUITextEdit::PasteTextFromClipboard
void PasteTextFromClipboard(QClipboard::Mode mode=QClipboard::Clipboard)
Definition: mythuitextedit.cpp:370
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:103
MythUIType::GetFullArea
virtual MythRect GetFullArea(void) const
Definition: mythuitype.cpp:878
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:107
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
VK_POSBELOWEDIT
@ VK_POSBELOWEDIT
Definition: mythvirtualkeyboard.h:12
MythUITextEdit::RemoveCharacter
void RemoveCharacter(int position)
Definition: mythuitextedit.cpp:281
MythUITextEdit::SetInitialStates
void SetInitialStates(void)
Definition: mythuitextedit.cpp:161
MythScreenStack
Definition: mythscreenstack.h:16
MythUITextEdit::m_maxLength
int m_maxLength
Definition: mythuitextedit.h:93
MythFontProperties::face
QFont face(void) const
Definition: mythfontproperties.cpp:40
MythUITextEdit::MoveEnd
@ MoveEnd
Definition: mythuitextedit.h:53
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:32
gDeadKeyMap
static QMap< keyCombo, int > gDeadKeyMap
Definition: mythuitextedit.cpp:381
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:595
MythUITextEdit::MovePageUp
@ MovePageUp
Definition: mythuitextedit.h:53
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:23
mythuistatetype.h
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:46
keyCombo
QPair< int, int > keyCombo
Definition: mythuitextedit.cpp:380
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:441
MythUITextEdit::m_isPassword
bool m_isPassword
Definition: mythuitextedit.h:99
MythUIText::GetFontProperties
const MythFontProperties * GetFontProperties()
Definition: mythuitext.h:81
MythUIText::MoveCursor
int MoveCursor(int lines)
Definition: mythuitext.cpp:1029
mythuiimage.h
MythUITextEdit::InsertText
void InsertText(const QString &text)
Definition: mythuitextedit.cpp:238
MythUIType::TakingFocus
void TakingFocus()
MythUIText::m_lineHeight
int m_lineHeight
Definition: mythuitext.h:135
MythUITextEdit::MoveLeft
@ MoveLeft
Definition: mythuitextedit.h:53
MythUITextEdit::MoveRight
@ MoveRight
Definition: mythuitextedit.h:53
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:215
FilterNumeric
@ FilterNumeric
Definition: mythuitextedit.h:21
MythUITextEdit::m_blinkInterval
int m_blinkInterval
Definition: mythuitextedit.h:89
MythUIType::m_hasFocus
bool m_hasFocus
Definition: mythuitype.h:259
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:1116
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:518
VERBOSE_XML
#define VERBOSE_XML(type, level, filename, element, msg)
Definition: xmlparsebase.h:14
FilterPunct
@ FilterPunct
Definition: mythuitextedit.h:24
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:1111
XMLParseBase::getFirstText
static QString getFirstText(QDomElement &element)
Definition: xmlparsebase.cpp:53
FilterSymbols
@ FilterSymbols
Definition: mythuitextedit.h:23
MythUITextEdit::m_composeKey
int m_composeKey
Definition: mythuitextedit.h:107
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:77
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1152
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:596
mythpainter.h
XMLParseBase::parseRect
static MythRect parseRect(const QString &text, bool normalize=true)
Definition: xmlparsebase.cpp:137
LOC
#define LOC
Definition: mythuitextedit.cpp:25
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:96
MythUITextEdit::Finalize
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
Definition: mythuitextedit.cpp:145
MythUITextEdit::InsertCharacter
bool InsertCharacter(const QString &character)
Definition: mythuitextedit.cpp:249
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:84
MythUITextEdit::CutTextToClipboard
void CutTextToClipboard(void)
Definition: mythuitextedit.cpp:357
mythuihelper.h
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
mythuitextedit.h
MythUITextEdit::m_cursorImage
MythUIImage * m_cursorImage
Definition: mythuitextedit.h:104
MythUITextEdit::Select
void Select()
Definition: mythuitextedit.cpp:60
MythUIType::m_canHaveFocus
bool m_canHaveFocus
Definition: mythuitype.h:260
MythUITextEdit::MoveDirection
MoveDirection
Definition: mythuitextedit.h:53
MythUIImage::ForceSize
void ForceSize(QSize size)
Force the dimensions of the widget and image to the given size.
Definition: mythuiimage.cpp:901
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
MythUIType::SetVisible
virtual void SetVisible(bool visible)
Definition: mythuitype.cpp:1086
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:559
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
MythUITextEdit::valueChanged
void valueChanged()
MythUITextEdit::MoveUp
@ MoveUp
Definition: mythuitextedit.h:53
MythGestureEvent
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
MythUITextEdit::m_cursorBlinkRate
int m_cursorBlinkRate
Definition: mythuitextedit.h:90
MythUIText::m_leading
int m_leading
Definition: mythuitext.h:133
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:1218
MythUITextEdit::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythuitextedit.cpp:422
MythUITextEdit::CopyTextToClipboard
void CopyTextToClipboard(void)
Definition: mythuitextedit.cpp:363
build_compdb.filename
filename
Definition: build_compdb.py:21
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:294
MythUITextEdit::m_message
QString m_message
Definition: mythuitextedit.h:95
MythUIType::IsVisible
bool IsVisible(bool recurse=false) const
Definition: mythuitype.cpp:888
VK_POSABOVEEDIT
@ VK_POSABOVEEDIT
Definition: mythvirtualkeyboard.h:11
MythUITextEdit::MoveCursor
bool MoveCursor(MoveDirection moveDir)
Definition: mythuitextedit.cpp:295
MythUITextEdit::MythUITextEdit
MythUITextEdit(MythUIType *parent, const QString &name)
Definition: mythuitextedit.cpp:27
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:53
MythUITextEdit::Deselect
void Deselect()
Definition: mythuitextedit.cpp:66