LibreOffice Module vcl (master)  1
uitest/uiobject.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #include <vcl/uitest/uiobject.hxx>
13 
14 #include <vcl/svapp.hxx>
15 #include <vcl/toolkit/combobox.hxx>
16 #include <vcl/event.hxx>
17 #include <vcl/floatwin.hxx>
18 #include <vcl/tabpage.hxx>
19 #include <vcl/tabctrl.hxx>
20 #include <vcl/toolkit/lstbox.hxx>
21 #include <vcl/toolkit/spin.hxx>
22 #include <vcl/toolkit/fmtfield.hxx>
23 #include <vcl/toolkit/spinfld.hxx>
24 #include <vcl/toolkit/ivctrl.hxx>
25 #include <vcl/toolkit/button.hxx>
26 #include <vcl/toolkit/dialog.hxx>
27 #include <vcl/toolkit/edit.hxx>
28 #include <vcl/toolkit/field.hxx>
29 #include <vcl/menubtn.hxx>
30 #include <vcl/toolkit/vclmedit.hxx>
31 #include <vcl/uitest/logger.hxx>
32 #include <uiobject-internal.hxx>
33 #include <verticaltabctrl.hxx>
34 #include <vcl/toolbox.hxx>
35 
36 #include <comphelper/string.hxx>
37 #include <comphelper/lok.hxx>
38 
39 #include <rtl/ustrbuf.hxx>
40 #include <sal/log.hxx>
41 
42 #include <iostream>
43 #include <memory>
44 #include <vector>
45 
47 {
48 }
49 
51 {
53  aMap["NotImplemented"] = "NotImplemented";
54  return aMap;
55 }
56 
57 void UIObject::execute(const OUString& /*rAction*/,
58  const StringMap& /*rParameters*/)
59 {
60  // should never be called
61  throw std::exception();
62 }
63 
64 OUString UIObject::get_type() const
65 {
66  return "Generic UIObject";
67 }
68 
69 std::unique_ptr<UIObject> UIObject::get_child(const OUString&)
70 {
71  return std::unique_ptr<UIObject>();
72 }
73 
74 std::set<OUString> UIObject::get_children() const
75 {
76  return std::set<OUString>();
77 }
78 
79 OUString UIObject::dumpState() const
80 {
81  return OUString();
82 }
83 
84 OUString UIObject::dumpHierarchy() const
85 {
86  return OUString();
87 }
88 
89 OUString UIObject::get_action(VclEventId /*nEvent*/) const
90 {
91  return OUString();
92 }
93 
94 namespace {
95 
96 bool isDialogWindow(vcl::Window const * pWindow)
97 {
98  WindowType nType = pWindow->GetType();
99  if (nType == WindowType::DIALOG || nType == WindowType::MODELESSDIALOG)
100  return true;
101 
102  // MESSBOX, INFOBOX, WARNINGBOX, ERRORBOX, QUERYBOX
103  if (nType >= WindowType::MESSBOX && nType <= WindowType::QUERYBOX)
104  return true;
105 
106  if (nType == WindowType::TABDIALOG)
107  return true;
108 
109  return false;
110 }
111 
112 bool isTopWindow(vcl::Window const * pWindow)
113 {
114  WindowType eType = pWindow->GetType();
115  if (eType == WindowType::FLOATINGWINDOW)
116  {
117  return pWindow->GetStyle() & WB_SYSTEMFLOATWIN;
118  }
119  return false;
120 }
121 
122 vcl::Window* get_top_parent(vcl::Window* pWindow)
123 {
124  if (isDialogWindow(pWindow) || isTopWindow(pWindow))
125  return pWindow;
126 
127  vcl::Window* pParent = pWindow->GetParent();
128  if (!pParent)
129  return pWindow;
130 
131  return get_top_parent(pParent);
132 }
133 
134 std::vector<KeyEvent> generate_key_events_from_text(const OUString& rStr)
135 {
136  std::vector<KeyEvent> aEvents;
137  vcl::KeyCode aCode;
138  for (sal_Int32 i = 0, n = rStr.getLength();
139  i != n; ++i)
140  {
141  aEvents.emplace_back(rStr[i], aCode);
142  }
143  return aEvents;
144 }
145 
146 sal_uInt16 get_key(sal_Unicode cChar, bool& bShift)
147 {
148  bShift = false;
149  if (cChar >= 'a' && cChar <= 'z')
150  return KEY_A + (cChar - 'a');
151  else if (cChar >= 'A' && cChar <= 'Z')
152  {
153  bShift = true;
154  return KEY_A + (cChar - 'A');
155  }
156  else if (cChar >= '0' && cChar <= '9')
157  return KEY_0 + (cChar - 'A');
158 
159  return cChar;
160 }
161 
162 bool isFunctionKey(const OUString& rStr, sal_uInt16& rKeyCode)
163 {
164  std::map<OUString, sal_uInt16> aFunctionKeyMap = {
165  {"F1", KEY_F1},
166  {"F2", KEY_F2},
167  {"F3", KEY_F3},
168  {"F4", KEY_F4},
169  {"F5", KEY_F5},
170  {"F6", KEY_F6},
171  {"F7", KEY_F7},
172  {"F8", KEY_F8},
173  {"F9", KEY_F9},
174  {"F10", KEY_F10},
175  {"F11", KEY_F11},
176  {"F12", KEY_F12}
177  };
178 
179  rKeyCode = 0;
180  auto itr = aFunctionKeyMap.find(rStr);
181  if (itr == aFunctionKeyMap.end())
182  return false;
183 
184  rKeyCode = itr->second;
185  return true;
186 }
187 
188 std::vector<KeyEvent> generate_key_events_from_keycode(const OUString& rStr)
189 {
190  std::vector<KeyEvent> aEvents;
191 
192  std::map<OUString, sal_uInt16> aKeyMap = {
193  {"ESC", KEY_ESCAPE},
194  {"TAB", KEY_TAB},
195  {"DOWN", KEY_DOWN},
196  {"UP", KEY_UP},
197  {"LEFT", KEY_LEFT},
198  {"RIGHT", KEY_RIGHT},
199  {"DELETE", KEY_DELETE},
200  {"INSERT", KEY_INSERT},
201  {"SPACE", KEY_SPACE},
202  {"BACKSPACE", KEY_BACKSPACE},
203  {"RETURN", KEY_RETURN},
204  {"HOME", KEY_HOME},
205  {"END", KEY_END},
206  {"PAGEUP", KEY_PAGEUP},
207  {"PAGEDOWN", KEY_PAGEDOWN}
208  };
209 
210  // split string along '+'
211  // then translate to keycodes
212  bool bShift = false;
213  bool bMod1 = false;
214  bool bMod2 = false;
215  OUString aRemainingText;
216 
217  std::vector<OUString> aTokens = comphelper::string::split(rStr, '+');
218  for (auto const& token : aTokens)
219  {
220  OUString aToken = token.trim();
221  if (aToken == "CTRL")
222  {
223  bMod1 = true;
224  }
225  else if (aToken == "SHIFT")
226  {
227  bShift = true;
228  }
229  else if (aToken == "ALT")
230  {
231  bMod2 = true;
232  }
233  else
234  aRemainingText = aToken;
235  }
236 
237  sal_uInt16 nFunctionKey = 0;
238  if (isFunctionKey(aRemainingText, nFunctionKey))
239  {
240  vcl::KeyCode aCode(nFunctionKey, bShift, bMod1, bMod2, false);
241  aEvents.emplace_back(0, aCode);
242  }
243  else if (aKeyMap.find(aRemainingText) != aKeyMap.end())
244  {
245  sal_uInt16 nKey = aKeyMap[aRemainingText];
246  vcl::KeyCode aCode(nKey, bShift, bMod1, bMod2, false);
247  aEvents.emplace_back( 'a', aCode);
248  }
249  else
250  {
251  for (sal_Int32 i = 0; i < aRemainingText.getLength(); ++i)
252  {
253  bool bShiftThroughKey = false;
254  sal_uInt16 nKey = get_key(aRemainingText[i], bShiftThroughKey);
255  vcl::KeyCode aCode(nKey, bShift || bShiftThroughKey, bMod1, bMod2, false);
256  aEvents.emplace_back(aRemainingText[i], aCode);
257  }
258  }
259 
260  return aEvents;
261 }
262 
263 OUString to_string(const Point& rPos)
264 {
265  OUString sStr = OUString::number(rPos.X())
266  + "x"
267  + OUString::number(rPos.Y());
268 
269  return sStr;
270 }
271 
272 OUString to_string(const Size& rSize)
273 {
274  OUString sStr = OUString::number(rSize.Width())
275  + "x"
276  + OUString::number(rSize.Height());
277 
278  return sStr;
279 }
280 
281 }
282 
284  mxWindow(xWindow)
285 {
286 }
287 
289 {
290  // Double-buffering is not interesting for uitesting, but can result in direct paint for a
291  // double-buffered widget, which is incorrect.
294 
295  StringMap aMap;
296  aMap["Visible"] = OUString::boolean(mxWindow->IsVisible());
297  aMap["ReallyVisible"] = OUString::boolean(mxWindow->IsReallyVisible());
298  aMap["Enabled"] = OUString::boolean(mxWindow->IsEnabled());
299  aMap["WindowType"] = OUString::number(static_cast<sal_uInt16>(mxWindow->GetType()), 16);
300 
301  Point aPos = mxWindow->GetPosPixel();
302  aMap["RelPosition"] = to_string(aPos);
303  aMap["Size"] = to_string(mxWindow->GetSizePixel());
304  aMap["ID"] = mxWindow->get_id();
305  vcl::Window* pParent = mxWindow->GetParent();
306  if (pParent)
307  aMap["Parent"] = mxWindow->GetParent()->get_id();
308 
309  bool bIgnoreAllExceptTop = isDialogWindow(mxWindow.get());
310  while(pParent)
311  {
312  Point aParentPos = pParent->GetPosPixel();
313  if (!bIgnoreAllExceptTop)
314  aPos += aParentPos;
315 
316  if (isDialogWindow(pParent))
317  {
318  bIgnoreAllExceptTop = true;
319  }
320 
321  pParent = pParent->GetParent();
322 
323  if (!pParent && bIgnoreAllExceptTop)
324  aPos += aParentPos;
325  }
326  aMap["AbsPosition"] = to_string(aPos);
327  aMap["Text"] = mxWindow->GetText();
328  aMap["DisplayText"] = mxWindow->GetDisplayText();
329 
330  return aMap;
331 }
332 
333 void WindowUIObject::execute(const OUString& rAction,
334  const StringMap& rParameters)
335 {
336  bool bHandled = true;
337  if (rAction == "SET")
338  {
339  for (auto const& parameter : rParameters)
340  {
341  std::cout << parameter.first;
342  }
343  }
344  else if (rAction == "TYPE")
345  {
346  auto it = rParameters.find("TEXT");
347  if (it != rParameters.end())
348  {
349  const OUString& rText = it->second;
350  auto aKeyEvents = generate_key_events_from_text(rText);
351  for (auto const& keyEvent : aKeyEvents)
352  {
353  mxWindow->KeyInput(keyEvent);
354  }
355  }
356  else if (rParameters.find("KEYCODE") != rParameters.end())
357  {
358  auto itr = rParameters.find("KEYCODE");
359  const OUString rText = itr->second;
360  auto aKeyEvents = generate_key_events_from_keycode(rText);
361  for (auto const& keyEvent : aKeyEvents)
362  {
363  mxWindow->KeyInput(keyEvent);
364  }
365  }
366  else
367  {
368  SAL_WARN("vcl.uitest", "missing parameter TEXT to action TYPE");
369  return;
370  }
371  }
372  else if (rAction == "FOCUS")
373  {
374  mxWindow->GrabFocus();
375  }
376  else
377  {
378  bHandled = false;
379  }
380 
381  if (!bHandled)
382  {
383  SAL_WARN("vcl.uitest", "unknown action or parameter for " << get_name() << ". Action: " << rAction);
384  }
385 }
386 
387 OUString WindowUIObject::get_type() const
388 {
389  return get_name();
390 }
391 
392 namespace {
393 
394 vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool bRequireVisible = false)
395 {
396  if (!pParent)
397  return nullptr;
398 
399  if (pParent->get_id() == rID)
400  return pParent;
401 
402  size_t nCount = pParent->GetChildCount();
403  for (size_t i = 0; i < nCount; ++i)
404  {
405  vcl::Window* pChild = pParent->GetChild(i);
406  if (pChild && pChild->get_id() == rID
407  && (!bRequireVisible || pChild->IsVisible()))
408  return pChild;
409 
410  if (!bRequireVisible || pChild->IsVisible())
411  {
412  vcl::Window* pResult = findChild(pChild, rID);
413  if (pResult)
414  return pResult;
415  }
416  }
417 
418  return nullptr;
419 }
420 
421 void addChildren(vcl::Window const * pParent, std::set<OUString>& rChildren)
422 {
423  if (!pParent)
424  return;
425 
426  size_t nCount = pParent->GetChildCount();
427  for (size_t i = 0; i < nCount; ++i)
428  {
429  vcl::Window* pChild = pParent->GetChild(i);
430  if (pChild)
431  {
432  OUString aId = pChild->get_id();
433  if (!aId.isEmpty())
434  {
435  auto ret = rChildren.insert(aId);
436  SAL_WARN_IF(!ret.second, "vcl.uitest", "duplicate ids for ui elements. violates locally unique requirement");
437  }
438 
439  addChildren(pChild, rChildren);
440  }
441  }
442 }
443 
444 }
445 
446 std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID)
447 {
448  // in a first step try the real children before moving to the top level parent
449  // This makes it easier to handle cases with the same ID as there is a way
450  // to resolve conflicts
451  vcl::Window* pWindow = findChild(mxWindow.get(), rID);
452  if (!pWindow)
453  {
454  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
455  pWindow = findChild(pDialogParent, rID);
456  }
457 
458  if (!pWindow)
459  throw css::uno::RuntimeException("Could not find child with id: " + rID);
460 
461  FactoryFunction aFunction = pWindow->GetUITestFactory();
462  return aFunction(pWindow);
463 }
464 
465 std::unique_ptr<UIObject> WindowUIObject::get_visible_child(const OUString& rID)
466 {
467  // in a first step try the real children before moving to the top level parent
468  // This makes it easier to handle cases with the same ID as there is a way
469  // to resolve conflicts
470  vcl::Window* pWindow = findChild(mxWindow.get(), rID, true);
471  if (!pWindow)
472  {
473  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
474  pWindow = findChild(pDialogParent, rID, true);
475  }
476 
477  if (!pWindow)
478  throw css::uno::RuntimeException("Could not find child with id: " + rID);
479 
480  FactoryFunction aFunction = pWindow->GetUITestFactory();
481  return aFunction(pWindow);
482 }
483 
484 std::set<OUString> WindowUIObject::get_children() const
485 {
486  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
487  std::set<OUString> aChildren;
488  aChildren.insert(pDialogParent->get_id());
489  addChildren(pDialogParent, aChildren);
490  return aChildren;
491 }
492 
493 OUString WindowUIObject::get_name() const
494 {
495  return "WindowUIObject";
496 }
497 
498 namespace {
499 
500 OUString escape(const OUString& rStr)
501 {
502  return rStr.replaceAll("\"", "\\\"");
503 }
504 
505 }
506 
508 {
509  OUStringBuffer aStateString = "{\"name\":\"" + mxWindow->get_id() + "\"";
510  aStateString.append(", \"ImplementationName\":\"").appendAscii(typeid(*mxWindow).name()).append("\"");
511  StringMap aState = const_cast<WindowUIObject*>(this)->get_state();
512  for (auto const& elem : aState)
513  {
514  OUString property = ",\"" + elem.first + "\":\"" + escape(elem.second) + "\"";
515  aStateString.append(property);
516  }
517 
518  size_t nCount = mxWindow->GetChildCount();
519 
520  if (nCount)
521  aStateString.append(",\"children\":[");
522 
523  for (size_t i = 0; i < nCount; ++i)
524  {
525  if (i != 0)
526  {
527  aStateString.append(",");
528  }
529  vcl::Window* pChild = mxWindow->GetChild(i);
530  std::unique_ptr<UIObject> pChildWrapper =
531  pChild->GetUITestFactory()(pChild);
532  OUString children = pChildWrapper->dumpState();
533  aStateString.append(children);
534  }
535 
536  if (nCount)
537  aStateString.append("]");
538 
539  aStateString.append("}");
540 
541  OUString aString = aStateString.makeStringAndClear();
542  return aString.replaceAll("\n", "\\n");
543 }
544 
546 {
547  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
548  std::unique_ptr<UIObject> pParentWrapper =
549  pDialogParent->GetUITestFactory()(pDialogParent);
550  return pParentWrapper->dumpState();
551 }
552 
554 {
555 
556  OUString aActionName;
557  switch (nEvent)
558  {
561  return OUString();
562 
565  aActionName = "CLICK";
566  break;
567 
569  aActionName = "TYPE";
570  break;
571  default:
572  aActionName = OUString::number(static_cast<int>(nEvent));
573  }
574  return "";
575  //return "Action on element: " + mxWindow->get_id() + " with action : " + aActionName;
576 }
577 
578 std::unique_ptr<UIObject> WindowUIObject::create(vcl::Window* pWindow)
579 {
580  return std::unique_ptr<UIObject>(new WindowUIObject(pWindow));
581 }
582 
584  WindowUIObject(xButton),
585  mxButton(xButton)
586 {
587 }
588 
590 {
591 }
592 
594 {
596  // Move that to a Control base class
597  aMap["Label"] = mxButton->GetDisplayText();
598 
599  return aMap;
600 }
601 
602 void ButtonUIObject::execute(const OUString& rAction,
603  const StringMap& rParameters)
604 {
605  if (rAction == "CLICK")
606  {
607  //Click doesn't call toggle when it's a pushbutton tweaked to be a toggle-button
608  if (PushButton *pPushButton = (mxButton->GetStyle() & WB_TOGGLE) ? dynamic_cast<PushButton*>(mxButton.get()) : nullptr)
609  {
610  pPushButton->Check(!pPushButton->IsChecked());
611  pPushButton->Toggle();
612  return;
613  }
614  mxButton->Click();
615  }
616  else
617  WindowUIObject::execute(rAction, rParameters);
618 }
619 
620 OUString ButtonUIObject::get_name() const
621 {
622  return "ButtonUIObject";
623 }
624 
626 {
627  if (nEvent == VclEventId::ButtonClick)
628  {
629  if(mxButton->get_id()=="writer_all")
630  {
632  return "Start writer" ;
633  }
634  else if(mxButton->get_id()=="calc_all")
635  {
637  return "Start calc" ;
638  }
639  else if(mxButton->get_id()=="impress_all")
640  {
642  return "Start impress" ;
643  }
644  else if(mxButton->get_id()=="draw_all")
645  {
647  return "Start draw" ;
648  }
649  else if(mxButton->get_id()=="math_all")
650  {
652  return "Start math" ;
653  }
654  else if(mxButton->get_id()=="database_all")
655  {
657  return "Start database" ;
658  }
659  else{
660  if (get_top_parent(mxButton)->get_id().isEmpty()){
661  //This part because if we don't have parent
662  return "Click on '" + mxButton->get_id() ;
663  }
664  return "Click on '" + mxButton->get_id() + "' from "+
665  get_top_parent(mxButton)->get_id();
666  }
667  }
668  else
669  return WindowUIObject::get_action(nEvent);
670 }
671 
672 std::unique_ptr<UIObject> ButtonUIObject::create(vcl::Window* pWindow)
673 {
674  Button* pButton = dynamic_cast<Button*>(pWindow);
675  assert(pButton);
676  return std::unique_ptr<UIObject>(new ButtonUIObject(pButton));
677 }
678 
680  WindowUIObject(xDialog),
681  mxDialog(xDialog)
682 {
683 }
684 
686 {
687 }
688 
690 {
692  aMap["Modal"] = OUString::boolean(mxDialog->IsModalInputMode());
693 
694  return aMap;
695 }
696 
697 OUString DialogUIObject::get_name() const
698 {
699  return "DialogUIObject";
700 }
701 
702 std::unique_ptr<UIObject> DialogUIObject::create(vcl::Window* pWindow)
703 {
704  Dialog* pDialog = dynamic_cast<Dialog*>(pWindow);
705  assert(pDialog);
706  return std::unique_ptr<UIObject>(new DialogUIObject(pDialog));
707 }
708 
710  WindowUIObject(xEdit),
711  mxEdit(xEdit)
712 {
713 }
714 
716 {
717 }
718 
719 void EditUIObject::execute(const OUString& rAction,
720  const StringMap& rParameters)
721 {
722  bool bHandled = true;
723  if (rAction == "SET")
724  {
725  if (rParameters.find("TEXT") != rParameters.end())
726  {
727  auto it = rParameters.find("TEXT");
728  if (it == rParameters.end())
729  {
730  SAL_WARN("vcl.uitest", "missing parameter TEXT to action SET");
731  return;
732  }
733 
734  const OUString& rText = it->second;
735  auto aKeyEvents = generate_key_events_from_text(rText);
736  for (auto const& keyEvent : aKeyEvents)
737  {
738  mxEdit->KeyInput(keyEvent);
739  }
740  }
741  else
742  {
743  bHandled = false;
744  }
745  }
746  else if (rAction == "SELECT")
747  {
748  if (rParameters.find("FROM") != rParameters.end() &&
749  rParameters.find("TO") != rParameters.end())
750  {
751  long nMin = rParameters.find("FROM")->second.toInt32();
752  long nMax = rParameters.find("TO")->second.toInt32();
753  Selection aSelection(nMin, nMax);
754  mxEdit->SetSelection(aSelection);
755  }
756  }
757  else if (rAction == "CLEAR")
758  {
759  mxEdit->SetText("");
760  mxEdit->Modify();
761  bHandled = true;
762  }
763  else
764  {
765  bHandled = false;
766  }
767 
768  if (!bHandled)
769  WindowUIObject::execute(rAction, rParameters);
770 }
771 
773 {
775  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
776  aMap["SelectedText"] = mxEdit->GetSelected();
777  aMap["Text"] = mxEdit->GetText();
778 
779  return aMap;
780 }
781 
782 OUString EditUIObject::get_action(VclEventId nEvent) const
783 {
784  if (nEvent == VclEventId::EditSelectionChanged)
785  {
786  const Selection& rSelection = mxEdit->GetSelection();
787  long nMin = rSelection.Min();
788  long nMax = rSelection.Max();
789  if(get_top_parent(mxEdit)->get_id().isEmpty()){
790  //This part because if we don't have parent
791  return "Select in '" +
792  mxEdit->get_id() +
793  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
794  OUString::number(nMax) + "\"}"
795  ;
796  }
797  return "Select in '" +
798  mxEdit->get_id() +
799  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
800  OUString::number(nMax) + "\"} from "
801  + get_top_parent(mxEdit)->get_id()
802  ;
803  }
804  else
805  return WindowUIObject::get_action(nEvent);
806 }
807 
808 OUString EditUIObject::get_name() const
809 {
810  return "EditUIObject";
811 }
812 
813 std::unique_ptr<UIObject> EditUIObject::create(vcl::Window* pWindow)
814 {
815  Edit* pEdit = dynamic_cast<Edit*>(pWindow);
816  assert(pEdit);
817  return std::unique_ptr<UIObject>(new EditUIObject(pEdit));
818 }
819 
821  WindowUIObject(xEdit),
822  mxEdit(xEdit)
823 {
824 }
825 
827 {
828 }
829 
830 void MultiLineEditUIObject::execute(const OUString& rAction,
831  const StringMap& rParameters)
832 {
833  bool bHandled = true;
834  if (rAction == "TYPE")
835  {
836  WindowUIObject aChildObj(mxEdit->GetTextWindow());
837  aChildObj.execute(rAction, rParameters);
838  }
839  else if (rAction == "SELECT")
840  {
841  if (rParameters.find("FROM") != rParameters.end() &&
842  rParameters.find("TO") != rParameters.end())
843  {
844  long nMin = rParameters.find("FROM")->second.toInt32();
845  long nMax = rParameters.find("TO")->second.toInt32();
846  Selection aSelection(nMin, nMax);
847  mxEdit->SetSelection(aSelection);
848  }
849  }
850  else
851  {
852  bHandled = false;
853  }
854 
855  if (!bHandled)
856  WindowUIObject::execute(rAction, rParameters);
857 }
858 
860 {
862  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
863  aMap["SelectedText"] = mxEdit->GetSelected();
864  aMap["Text"] = mxEdit->GetText();
865 
866  return aMap;
867 }
868 
870 {
871  return "MultiLineEditUIObject";
872 }
873 
874 std::unique_ptr<UIObject> MultiLineEditUIObject::create(vcl::Window* pWindow)
875 {
876  VclMultiLineEdit* pEdit = dynamic_cast<VclMultiLineEdit*>(pWindow);
877  assert(pEdit);
878  return std::unique_ptr<UIObject>(new MultiLineEditUIObject(pEdit));
879 }
880 
882  WindowUIObject(xCheckbox),
883  mxCheckBox(xCheckbox)
884 {
885 }
886 
888 {
889 }
890 
891 void CheckBoxUIObject::execute(const OUString& rAction,
892  const StringMap& /*rParameters*/)
893 {
894  if (rAction == "CLICK")
895  {
896  // don't use toggle directly, it does not set the value
898  }
899 }
900 
902 {
904  aMap["Selected"] = OUString::boolean(mxCheckBox->IsChecked());
905  aMap["TriStateEnabled"] = OUString::boolean(mxCheckBox->IsTriStateEnabled());
906  return aMap;
907 }
908 
910 {
911  return "CheckBoxUIObject";
912 }
913 
915 {
916  if (nEvent == VclEventId::CheckboxToggle)
917  {
918  if(get_top_parent(mxCheckBox)->get_id().isEmpty()){
919  //This part because if we don't have parent
920  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox";
921  }
922  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox from " +
923  get_top_parent(mxCheckBox)->get_id();
924  }
925  else
926  return WindowUIObject::get_action(nEvent);
927 }
928 
929 std::unique_ptr<UIObject> CheckBoxUIObject::create(vcl::Window* pWindow)
930 {
931  CheckBox* pCheckBox = dynamic_cast<CheckBox*>(pWindow);
932  assert(pCheckBox);
933  return std::unique_ptr<UIObject>(new CheckBoxUIObject(pCheckBox));
934 }
935 
937  WindowUIObject(xRadioButton),
938  mxRadioButton(xRadioButton)
939 {
940 }
941 
943 {
944 }
945 
946 void RadioButtonUIObject::execute(const OUString& rAction,
947  const StringMap& /*rParameters*/)
948 {
949  if (rAction == "CLICK")
950  {
952  }
953 }
954 
956 {
958  aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
959 
960  return aMap;
961 }
962 
964 {
965  return "RadioButtonUIObject";
966 }
967 
969 {
970  if (nEvent == VclEventId::RadiobuttonToggle)
971  {
972  if(get_top_parent(mxRadioButton)->get_id().isEmpty()){
973  //This part because if we don't have parent
974  return "Select '" + mxRadioButton->get_id() + "' RadioButton";
975  }
976  return "Select '" + mxRadioButton->get_id() + "' RadioButton from " +
977  get_top_parent(mxRadioButton)->get_id();
978  }
979  else
980  return WindowUIObject::get_action(nEvent);
981 }
982 
983 std::unique_ptr<UIObject> RadioButtonUIObject::create(vcl::Window* pWindow)
984 {
985  RadioButton* pRadioButton = dynamic_cast<RadioButton*>(pWindow);
986  assert(pRadioButton);
987  return std::unique_ptr<UIObject>(new RadioButtonUIObject(pRadioButton));
988 }
989 
991  WindowUIObject(xTabPage),
992  mxTabPage(xTabPage)
993 {
994 }
995 
997 {
998 }
999 
1000 void TabPageUIObject::execute(const OUString& rAction,
1001  const StringMap& /*rParameters*/)
1002 {
1003  if (rAction == "SELECT")
1004  {
1005  /* code */
1006  }
1007 }
1008 
1010 {
1012 
1013  return aMap;
1014 }
1015 
1017 {
1018  return "TabPageUIObject";
1019 }
1020 
1022  WindowUIObject(xListBox),
1023  mxListBox(xListBox)
1024 {
1025 }
1026 
1028 {
1029 }
1030 
1031 void ListBoxUIObject::execute(const OUString& rAction,
1032  const StringMap& rParameters)
1033 {
1034  if (!mxListBox->IsEnabled())
1035  return;
1036 
1037  bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
1038  if (!isTiledRendering && !mxListBox->IsReallyVisible())
1039  return;
1040 
1041  if (rAction == "SELECT")
1042  {
1043  bool bSelect = true;
1044  if (rParameters.find("POS") != rParameters.end())
1045  {
1046  auto itr = rParameters.find("POS");
1047  OUString aVal = itr->second;
1048  sal_Int32 nPos = aVal.toInt32();
1049  mxListBox->SelectEntryPos(nPos, bSelect);
1050  }
1051  else if (rParameters.find("TEXT") != rParameters.end())
1052  {
1053  auto itr = rParameters.find("TEXT");
1054  OUString aText = itr->second;
1055  mxListBox->SelectEntry(aText, bSelect);
1056  }
1057  mxListBox->Select();
1058  }
1059  else
1060  WindowUIObject::execute(rAction, rParameters);
1061 }
1062 
1064 {
1066  aMap["ReadOnly"] = OUString::boolean(mxListBox->IsReadOnly());
1067  aMap["MultiSelect"] = OUString::boolean(mxListBox->IsMultiSelectionEnabled());
1068  aMap["EntryCount"] = OUString::number(mxListBox->GetEntryCount());
1069  aMap["SelectEntryCount"] = OUString::number(mxListBox->GetSelectedEntryCount());
1070  aMap["SelectEntryPos"] = OUString::number(mxListBox->GetSelectedEntryPos());
1071  aMap["SelectEntryText"] = mxListBox->GetSelectedEntry();
1072 
1073  return aMap;
1074 }
1075 
1077 {
1078  return "ListBoxUIObject";
1079 }
1080 
1082 {
1083  if (nEvent == VclEventId::ListboxSelect)
1084  {
1085  sal_Int32 nPos = mxListBox->GetSelectedEntryPos();
1086  if(get_top_parent(mxListBox)->get_id().isEmpty()){
1087  //This part because if we don't have parent
1088  return "Select element with position " + OUString::number(nPos) +
1089  " in '" + mxListBox->get_id();
1090  }
1091  return "Select element with position " + OUString::number(nPos) +
1092  " in '" + mxListBox->get_id() +"' from" + get_top_parent(mxListBox)->get_id() ;
1093  }
1094  else if (nEvent == VclEventId::ListboxFocus)
1095  {
1096  if(get_top_parent(mxListBox)->get_id().isEmpty())
1097  {
1098  //This part because if we don't have parent
1099  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id();
1100  }
1101  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id() +
1102  " Parent:" + get_top_parent(mxListBox)->get_id();
1103  }
1104  else
1105  return WindowUIObject::get_action(nEvent);
1106 }
1107 
1108 std::unique_ptr<UIObject> ListBoxUIObject::create(vcl::Window* pWindow)
1109 {
1110  ListBox* pListBox = dynamic_cast<ListBox*>(pWindow);
1111  assert(pListBox);
1112  return std::unique_ptr<UIObject>(new ListBoxUIObject(pListBox));
1113 }
1114 
1116  WindowUIObject(xComboBox),
1117  mxComboBox(xComboBox)
1118 {
1119 }
1120 
1122 {
1123 }
1124 
1125 void ComboBoxUIObject::execute(const OUString& rAction,
1126  const StringMap& rParameters)
1127 {
1128  if (rAction == "SELECT")
1129  {
1130  if (rParameters.find("POS") != rParameters.end())
1131  {
1132  auto itr = rParameters.find("POS");
1133  OUString aVal = itr->second;
1134  sal_Int32 nPos = aVal.toInt32();
1135  mxComboBox->SelectEntryPos(nPos);
1136  }
1137  else if(rParameters.find("TEXT") != rParameters.end()){
1138  auto itr = rParameters.find("TEXT");
1139  OUString aVal = itr->second;
1140  sal_Int32 nPos = mxComboBox->GetEntryPos(aVal);
1141  mxComboBox->SelectEntryPos(nPos);
1142  }
1143  mxComboBox->Select();
1144  }
1145  else if ( rAction == "TYPE" || rAction == "SET" || rAction == "CLEAR" ){
1146  if (mxComboBox->GetSubEdit())
1147  {
1148  Edit* pEdit = mxComboBox->GetSubEdit();
1149  std::unique_ptr<UIObject> pObj = EditUIObject::create(pEdit);
1150  pObj->execute(rAction, rParameters);
1151  }
1152  else
1153  WindowUIObject::execute(rAction, rParameters);
1154  }
1155  else
1156  WindowUIObject::execute(rAction, rParameters);
1157 }
1158 
1160 {
1162  return aMap;
1163 }
1164 
1166 {
1167  return "ComboBoxUIObject";
1168 }
1169 
1171 {
1172  if (nEvent == VclEventId::ComboboxSelect)
1173  {
1174  sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
1175  if (get_top_parent(mxComboBox)->get_id().isEmpty()){
1176  //This part because if we don't have parent
1177  return "Select in '" + mxComboBox->get_id() +
1178  "' ComboBox item number " + OUString::number(nPos);
1179  }
1180  return "Select in '" + mxComboBox->get_id() +
1181  "' ComboBox item number " + OUString::number(nPos) +
1182  " from " + get_top_parent(mxComboBox)->get_id();
1183  }
1184  else
1185  return WindowUIObject::get_action(nEvent);
1186 }
1187 
1188 std::unique_ptr<UIObject> ComboBoxUIObject::create(vcl::Window* pWindow)
1189 {
1190  ComboBox* pComboBox = dynamic_cast<ComboBox*>(pWindow);
1191  assert(pComboBox);
1192  return std::unique_ptr<UIObject>(new ComboBoxUIObject(pComboBox));
1193 }
1194 
1196  WindowUIObject(xSpinButton),
1197  mxSpinButton(xSpinButton)
1198 {
1199 }
1200 
1202 {
1203 }
1204 
1205 void SpinUIObject::execute(const OUString& rAction,
1206  const StringMap& /*rParameters*/)
1207 {
1208  if (rAction == "UP")
1209  {
1210  mxSpinButton->Up();
1211  }
1212  else if (rAction == "DOWN")
1213  {
1214  mxSpinButton->Down();
1215  }
1216 }
1217 
1219 {
1221  aMap["Min"] = OUString::number(mxSpinButton->GetRangeMin());
1222  aMap["Max"] = OUString::number(mxSpinButton->GetRangeMax());
1223  aMap["Step"] = OUString::number(mxSpinButton->GetValueStep());
1224  aMap["Value"] = OUString::number(mxSpinButton->GetValue());
1225 
1226  return aMap;
1227 }
1228 
1229 OUString SpinUIObject::get_action(VclEventId nEvent) const
1230 {
1231  if (nEvent == VclEventId::SpinbuttonUp)
1232  {
1233  return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() +
1234  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1235  }
1236  else if (nEvent == VclEventId::SpinbuttonDown)
1237  {
1238  return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() +
1239  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1240  }
1241  else
1242  return WindowUIObject::get_action(nEvent);
1243 }
1244 
1245 OUString SpinUIObject::get_name() const
1246 {
1247  return "SpinUIObject";
1248 }
1249 
1251  EditUIObject(xSpinField),
1252  mxSpinField(xSpinField)
1253 {
1254 }
1255 
1257 {
1258 }
1259 
1260 void SpinFieldUIObject::execute(const OUString& rAction,
1261  const StringMap& rParameters)
1262 {
1263  if (rAction == "UP")
1264  {
1265  mxSpinField->Up();
1266  }
1267  else if (rAction == "DOWN")
1268  {
1269  mxSpinField->Down();
1270  }
1271  else if (rAction == "TYPE")
1272  {
1273  if (mxSpinField->GetSubEdit())
1274  {
1275  Edit* pSubEdit = mxSpinField->GetSubEdit();
1276  EditUIObject aSubObject(pSubEdit);
1277  aSubObject.execute(rAction, rParameters);
1278  }
1279  }
1280  else
1281  EditUIObject::execute(rAction, rParameters);
1282 }
1283 
1285 {
1287 
1288  return aMap;
1289 }
1290 
1292 {
1293  if (nEvent == VclEventId::SpinfieldUp)
1294  {
1295  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1296  {
1297  //This part because if we don't have parent
1298  return "Increase '" + mxSpinField->get_id();
1299  }
1300  return "Increase '" + mxSpinField->get_id() +
1301  "' from " + get_top_parent(mxSpinField)->get_id();
1302  }
1303  else if (nEvent == VclEventId::SpinfieldDown)
1304  {
1305  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1306  {
1307  //This part because if we don't have parent
1308  return "Decrease '" + mxSpinField->get_id();
1309  }
1310  return "Decrease '" + mxSpinField->get_id() +
1311  "' from " + get_top_parent(mxSpinField)->get_id();
1312  }
1313  else
1314  return WindowUIObject::get_action(nEvent);
1315 }
1316 
1318 {
1319  return "SpinFieldUIObject";
1320 }
1321 
1322 std::unique_ptr<UIObject> SpinFieldUIObject::create(vcl::Window* pWindow)
1323 {
1324  SpinField* pSpinField = dynamic_cast<SpinField*>(pWindow);
1325  assert(pSpinField);
1326  return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField));
1327 }
1328 
1329 
1331  SpinFieldUIObject(xMetricField),
1332  mxMetricField(xMetricField)
1333 {
1334 }
1335 
1337 {
1338 }
1339 
1340 void MetricFieldUIObject::execute(const OUString& rAction,
1341  const StringMap& rParameters)
1342 {
1343  if (rAction == "VALUE")
1344  {
1345  auto itPos = rParameters.find("VALUE");
1346  if (itPos != rParameters.end())
1347  {
1348  mxMetricField->SetValueFromString(itPos->second);
1349  }
1350  }
1351  else
1352  SpinFieldUIObject::execute(rAction, rParameters);
1353 }
1354 
1356 {
1358  aMap["Value"] = mxMetricField->GetValueString();
1359 
1360  return aMap;
1361 }
1362 
1364 {
1365  return "MetricFieldUIObject";
1366 }
1367 
1368 std::unique_ptr<UIObject> MetricFieldUIObject::create(vcl::Window* pWindow)
1369 {
1370  MetricField* pMetricField = dynamic_cast<MetricField*>(pWindow);
1371  assert(pMetricField);
1372  return std::unique_ptr<UIObject>(new MetricFieldUIObject(pMetricField));
1373 }
1374 
1376  SpinFieldUIObject(xFormattedField),
1377  mxFormattedField(xFormattedField)
1378 {
1379 }
1380 
1382 {
1383 }
1384 
1385 void FormattedFieldUIObject::execute(const OUString& rAction,
1386  const StringMap& rParameters)
1387 {
1388  if (rAction == "VALUE")
1389  {
1390  auto itPos = rParameters.find("VALUE");
1391  if (itPos != rParameters.end())
1392  {
1393  mxFormattedField->SetValueFromString(itPos->second);
1394  }
1395  }
1396  else
1397  SpinFieldUIObject::execute(rAction, rParameters);
1398 }
1399 
1401 {
1403  aMap["Value"] = OUString::number(mxFormattedField->GetFormatter().GetValue());
1404 
1405  return aMap;
1406 }
1407 
1409 {
1410  return "FormattedFieldUIObject";
1411 }
1412 
1413 std::unique_ptr<UIObject> FormattedFieldUIObject::create(vcl::Window* pWindow)
1414 {
1415  FormattedField* pFormattedField = dynamic_cast<FormattedField*>(pWindow);
1416  assert(pFormattedField);
1417  return std::unique_ptr<UIObject>(new FormattedFieldUIObject(pFormattedField));
1418 }
1419 
1421  WindowUIObject(xTabControl),
1422  mxTabControl(xTabControl)
1423 {
1424 }
1425 
1427 {
1428 }
1429 
1430 void TabControlUIObject::execute(const OUString& rAction,
1431  const StringMap& rParameters)
1432 {
1433  if (rAction == "SELECT")
1434  {
1435  if (rParameters.find("POS") != rParameters.end())
1436  {
1437  auto itr = rParameters.find("POS");
1438  sal_uInt32 nPos = itr->second.toUInt32();
1439  std::vector<sal_uInt16> aIds = mxTabControl->GetPageIDs();
1440  mxTabControl->SelectTabPage(aIds[nPos]);
1441  }
1442  }
1443  else
1444  WindowUIObject::execute(rAction, rParameters);
1445 }
1446 
1448 {
1450  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1451 
1452  sal_uInt16 nPageId = mxTabControl->GetCurPageId();
1453  aMap["CurrPageId"] = OUString::number(nPageId);
1454  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1455 
1456  return aMap;
1457 }
1458 
1460 {
1461  if (nEvent == VclEventId::TabpageActivate)
1462  {
1463  sal_Int32 nPageId = mxTabControl->GetCurPageId();
1464 
1465  if(get_top_parent(mxTabControl)->get_id().isEmpty()){
1466  //This part because if we don't have parent
1467  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1468  " in '" + mxTabControl->get_id();
1469  }
1470  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1471  " in '" + mxTabControl->get_id()+
1472  "' from " + get_top_parent(mxTabControl)->get_id() ;
1473  }
1474  else
1475  return WindowUIObject::get_action(nEvent);
1476 }
1477 
1479 {
1480  return "TabControlUIObject";
1481 }
1482 
1483 std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow)
1484 {
1485  TabControl* pTabControl = dynamic_cast<TabControl*>(pWindow);
1486  assert(pTabControl);
1487  return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl));
1488 }
1489 
1491  WindowUIObject(xRoadmapWizard),
1492  mxRoadmapWizard(xRoadmapWizard)
1493 {
1494 }
1495 
1497 {
1498 }
1499 
1500 void RoadmapWizardUIObject::execute(const OUString& rAction,
1501  const StringMap& rParameters)
1502 {
1503  if (rAction == "SELECT")
1504  {
1505  if (rParameters.find("POS") != rParameters.end())
1506  {
1507  auto itr = rParameters.find("POS");
1508  sal_uInt32 nPos = itr->second.toUInt32();
1510  }
1511  }
1512  else
1513  WindowUIObject::execute(rAction, rParameters);
1514 }
1515 
1517 {
1519 
1520  aMap["CurrentStep"] = OUString::number(mxRoadmapWizard->GetCurrentRoadmapItemID());
1521 
1522  return aMap;
1523 }
1524 
1526 {
1527  return "RoadmapWizardUIObject";
1528 }
1529 
1530 std::unique_ptr<UIObject> RoadmapWizardUIObject::create(vcl::Window* pWindow)
1531 {
1532  vcl::RoadmapWizard* pRoadmapWizard = dynamic_cast<vcl::RoadmapWizard*>(pWindow);
1533  assert(pRoadmapWizard);
1534  return std::unique_ptr<UIObject>(new RoadmapWizardUIObject(pRoadmapWizard));
1535 }
1536 
1538  WindowUIObject(xTabControl),
1539  mxTabControl(xTabControl)
1540 {
1541 }
1542 
1544 {
1545 }
1546 
1547 void VerticalTabControlUIObject::execute(const OUString& rAction,
1548  const StringMap& rParameters)
1549 {
1550  if (rAction == "SELECT")
1551  {
1552  if (rParameters.find("POS") != rParameters.end())
1553  {
1554  auto itr = rParameters.find("POS");
1555  sal_uInt32 nPos = itr->second.toUInt32();
1556  OString xid = mxTabControl->GetPageId(nPos);
1557  mxTabControl->SetCurPageId(xid);
1558  }
1559  }
1560  else
1561  WindowUIObject::execute(rAction, rParameters);
1562 }
1563 
1565 {
1567  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1568 
1569  OString nPageId = mxTabControl->GetCurPageId();
1570  aMap["CurrPageTitel"] = mxTabControl->GetPageText(nPageId);
1571  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1572 
1573  return aMap;
1574 }
1575 
1577 {
1578  return "VerticalTabControlUIObject";
1579 }
1580 
1581 std::unique_ptr<UIObject> VerticalTabControlUIObject::create(vcl::Window* pWindow)
1582 {
1583  VerticalTabControl* pTabControl = dynamic_cast<VerticalTabControl*>(pWindow);
1584  assert(pTabControl);
1585  return std::unique_ptr<UIObject>(new VerticalTabControlUIObject(pTabControl));
1586 }
1587 
1588 
1590  WindowUIObject(xToolBox),
1591  mxToolBox(xToolBox)
1592 {
1593 }
1594 
1596 {
1597 }
1598 
1599 void ToolBoxUIObject::execute(const OUString& rAction,
1600  const StringMap& rParameters)
1601 {
1602  if (rAction == "CLICK")
1603  {
1604  if (rParameters.find("POS") != rParameters.end())
1605  {
1606  auto itr = rParameters.find("POS");
1607  sal_uInt16 nPos = itr->second.toUInt32();
1608  mxToolBox->SetCurItemId(nPos);
1609  mxToolBox->Click();
1610  mxToolBox->Select();
1611  }
1612  }
1613  else
1614  WindowUIObject::execute(rAction, rParameters);
1615 }
1616 
1618 {
1619  if (nEvent == VclEventId::ToolboxClick)
1620  {
1621  return "Click on item number " + OUString::number(mxToolBox->GetCurItemId()) +
1622  " in " + mxToolBox->get_id();
1623  }
1624  else
1625  return WindowUIObject::get_action(nEvent);
1626 }
1627 
1629 {
1631  aMap["CurrSelectedItemID"] = OUString::number(mxToolBox->GetCurItemId());
1632  aMap["CurrSelectedItemText"] = mxToolBox->GetItemText(mxToolBox->GetCurItemId());
1633  aMap["CurrSelectedItemCommand"] = mxToolBox->GetItemCommand(mxToolBox->GetCurItemId());
1634  aMap["ItemCount"] = OUString::number(mxToolBox->GetItemCount());
1635  return aMap;
1636 }
1637 
1639 {
1640  return "ToolBoxUIObject";
1641 }
1642 
1643 std::unique_ptr<UIObject> ToolBoxUIObject::create(vcl::Window* pWindow)
1644 {
1645  ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
1646  assert(pToolBox);
1647  return std::unique_ptr<UIObject>(new ToolBoxUIObject(pToolBox));
1648 }
1649 
1651  WindowUIObject(xMenuButton),
1652  mxMenuButton(xMenuButton)
1653 {
1654 }
1655 
1657 {
1658 }
1659 
1661 {
1663  aMap["Label"] = mxMenuButton->GetDisplayText();
1664  return aMap;
1665 }
1666 
1667 void MenuButtonUIObject::execute(const OUString& rAction,
1668  const StringMap& rParameters)
1669 {
1670  if (rAction == "CLICK")
1671  {
1673  mxMenuButton->Toggle();
1674  }
1675  else if (rAction == "OPENLIST")
1676  {
1678  }
1679  else if (rAction == "OPENFROMLIST")
1680  {
1681  auto itr = rParameters.find("POS");
1682  sal_uInt32 nPos = itr->second.toUInt32();
1683 
1684  sal_uInt32 nId = mxMenuButton->GetPopupMenu()->GetItemId(nPos);
1687  mxMenuButton->Select();
1688  }
1689  else if (rAction == "CLOSELIST")
1690  {
1692  }
1693  else
1694  WindowUIObject::execute(rAction, rParameters);
1695 }
1696 
1698 {
1699  return "MenuButtonUIObject";
1700 }
1701 
1702 std::unique_ptr<UIObject> MenuButtonUIObject::create(vcl::Window* pWindow)
1703 {
1704  MenuButton* pMenuButton = dynamic_cast<MenuButton*>(pWindow);
1705  assert(pMenuButton);
1706  return std::unique_ptr<UIObject>(new MenuButtonUIObject(pMenuButton));
1707 }
1708 
1710  : WindowUIObject(rDrawingArea)
1711  , mxDrawingArea(dynamic_cast<VclDrawingArea*>(rDrawingArea.get()))
1712 {
1715 }
1716 
1718 {
1719 }
1720 
1721 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual OUString GetDisplayText() const override
Definition: ctrl.cxx:218
virtual Point GetPosPixel() const
Definition: window.cxx:2792
sal_Int32 GetEntryPos(const OUString &rStr) const
Definition: combobox.cxx:944
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
long Width() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual ~MultiLineEditUIObject() override
VclPtr< VclMultiLineEdit > mxEdit
Definition: uiobject.hxx:214
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
wizard for a roadmap
Definition: wizdlg.hxx:65
OUString GetSelectedEntry(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:990
RadioButtonUIObject(const VclPtr< RadioButton > &xCheckbox)
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
WinBits const WB_TOGGLE
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual FactoryFunction GetUITestFactory() const
Definition: window.cxx:3863
virtual ~ToolBoxUIObject() override
MetricFieldUIObject(const VclPtr< MetricField > &xEdit)
virtual OUString get_name() const override
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:1002
virtual OUString GetSelected() const
Definition: edit.cxx:2505
ButtonUIObject(const VclPtr< Button > &xButton)
virtual std::unique_ptr< UIObject > get_child(const OUString &rID)
Returns the child of the current UIObject with the corresponding id.
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual OUString get_name() const override
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
VclPtr< ToolBox > mxToolBox
Definition: uiobject.hxx:492
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
VclPtr< SpinButton > mxSpinButton
Definition: uiobject.hxx:352
Edit * GetSubEdit() const
Definition: edit.hxx:217
void SetValueFromString(const OUString &rStr)
Definition: fmtfield.cxx:1331
void Check(bool bCheck=true)
Definition: button.hxx:208
weld::CustomWidgetController * mpController
Definition: uiobject.hxx:539
OString GetCurPageId() const
long Height() const
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
sal_uInt16 GetPagePos(const OString &rPageId) const
Definition: ivctrl.cxx:591
const OUString & GetItemText(sal_uInt16 nItemId) const
Definition: toolbox2.cxx:1067
void SelectTabPage(sal_uInt16 nPageId)
Definition: tabctrl.cxx:1849
constexpr sal_uInt16 KEY_F3
Definition: keycodes.hxx:85
Formatter & GetFormatter()
Definition: fmtfield.cxx:1314
virtual OUString get_action(VclEventId nEvent) const
Gets the corresponding Action string for the event.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual OUString get_name() const override
virtual OUString get_name() const override
constexpr sal_uInt16 KEY_A
Definition: keycodes.hxx:56
constexpr sal_uInt16 KEY_0
Definition: keycodes.hxx:45
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
void Select()
Definition: listbox.cxx:898
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
constexpr sal_uInt16 KEY_F5
Definition: keycodes.hxx:87
constexpr sal_uInt16 KEY_F7
Definition: keycodes.hxx:89
virtual std::set< OUString > get_children() const override
Returns a set containing all descendants of the object.
sal_Int64 n
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2395
void * GetUserData() const
Definition: layout.hxx:756
VclPtr< FormattedField > mxFormattedField
constexpr sal_uInt16 KEY_F4
Definition: keycodes.hxx:86
VclPtr< VclDrawingArea > mxDrawingArea
Definition: uiobject.hxx:537
sal_Int16 nId
SAL_DLLPRIVATE void ImplCallClick(bool bGrabFocus=false, GetFocusFlags nFocusFlags=GetFocusFlags::NONE)
Definition: button.cxx:2205
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
void SetSelectedEntry(sal_uInt16 nId)
Definition: menu.cxx:2788
OUString aId
FormattedFieldUIObject(const VclPtr< FormattedField > &xEdit)
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
virtual void Up()
Definition: spinfld.cxx:358
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
constexpr sal_uInt16 KEY_SPACE
Definition: keycodes.hxx:123
void Select()
Definition: combobox.cxx:502
virtual ~DialogUIObject() override
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
void ExecuteMenu()
Definition: menubtn.cxx:54
sal_uInt16 GetCurItemId() const
Definition: toolbox.hxx:356
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual OUString get_name() const
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
std::vector< OUString > split(const OUString &rStr, sal_Unicode cSeparator)
constexpr sal_uInt16 KEY_F1
Definition: keycodes.hxx:83
constexpr sal_uInt16 KEY_F9
Definition: keycodes.hxx:91
constexpr sal_uInt16 KEY_END
Definition: keycodes.hxx:115
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
void SelectEntry(const OUString &rStr, bool bSelect=true)
Definition: listbox.cxx:1022
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
HashMap_OWString_Interface aMap
static UITestLogger & getInstance()
Definition: logger.cxx:608
virtual OUString dumpHierarchy() const override
Currently an internal method to dump the parent-child relationship starting from the current top focu...
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual ~RadioButtonUIObject() override
sal_uInt16 sal_Unicode
VclPtr< vcl::RoadmapWizard > mxRoadmapWizard
const OUString & get_id() const
Get the ID of the window.
Definition: window.cxx:3858
sal_uInt16 nPageId
void setAppName(OUString name)
Definition: logger.hxx:57
sal_Int32 GetEntryCount() const
Definition: listbox.cxx:983
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
void SetCurPageId(const OString &rId)
Definition: ivctrl.cxx:515
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:1481
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
double GetValue()
Definition: fmtfield.cxx:859
virtual ~FormattedFieldUIObject() override
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual ~TabControlUIObject() override
virtual OUString dumpState() const override
Currently an internal method to dump the state of the current UIObject as represented by get_state()...
virtual sal_Int32 GetMaxTextLen() const
Definition: edit.hxx:181
int nCount
bool IsChecked() const
Definition: button.hxx:300
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
constexpr sal_uInt16 KEY_F2
Definition: keycodes.hxx:84
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual OUString get_name() const override
virtual void Click()
Definition: button.cxx:122
VclEventId
Definition: vclevent.hxx:37
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual OUString get_name() const override
bool IsModalInputMode() const
Definition: dialog.hxx:143
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual const Selection & GetSelection() const
Definition: edit.cxx:2478
WindowUIObject(const VclPtr< vcl::Window > &xWindow)
virtual OUString get_name() const override
virtual OUString GetText() const
Definition: window.cxx:3039
WinBits const WB_SYSTEMFLOATWIN
virtual OUString get_name() const override
virtual OUString get_name() const override
virtual std::set< OUString > get_children() const
Returns a set containing all descendants of the object.
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual OUString get_name() const override
Definition: edit.hxx:55
virtual OUString get_name() const override
SpinFieldUIObject(const VclPtr< SpinField > &xEdit)
virtual void Down()
Definition: spinfld.cxx:363
bool IsReadOnly() const
Definition: listbox.cxx:1324
virtual OUString GetDisplayText() const
Definition: window.cxx:3045
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual void SetSelection(const Selection &rSelection)
Definition: edit.cxx:2404
sal_uInt16 GetPageCount() const
Definition: tabctrl.cxx:1766
SAL_DLLPRIVATE void ImplCheck()
Definition: button.cxx:3067
VclPtr< Edit > mxEdit
Definition: uiobject.hxx:191
MultiLineEditUIObject(const VclPtr< VclMultiLineEdit > &xEdit)
const SvXMLTokenMapEntry aChildren[]
DialogUIObject(const VclPtr< Dialog > &xDialog)
DocumentType eType
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
DrawingAreaUIObject(const VclPtr< vcl::Window > &rDrawingArea)
virtual OUString dumpHierarchy() const
Currently an internal method to dump the parent-child relationship starting from the current top focu...
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual ~ButtonUIObject() override
long Min() const
OUString GetPageText(const OString &rPageId) const
Definition: ivctrl.cxx:607
void SelectRoadmapItemByID(int nId)
virtual std::unique_ptr< UIObject > get_visible_child(const OUString &rID)
int i
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
bool IsChecked() const
Definition: button.hxx:213
void SetCurItemId()
Definition: menubtn.cxx:261
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
PopupMenu * GetPopupMenu() const
Definition: menubtn.hxx:79
bool IsTriStateEnabled() const
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: listbox.cxx:1027
virtual OUString get_type() const
Returns the type of the UIObject.
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:634
ListBoxUIObject(const VclPtr< ListBox > &xListBox)
TabPageUIObject(const VclPtr< TabPage > &xTabPage)
VclPtr< Button > mxButton
Definition: uiobject.hxx:151
RoadmapWizardUIObject(const VclPtr< vcl::RoadmapWizard > &xRoadmapWizard)
virtual OUString GetText() const override
Definition: edit.cxx:2574
ToolBoxUIObject(const VclPtr< ToolBox > &mxToolBox)
virtual void Modify()
Definition: edit.cxx:2324
sal_Int32 GetSelectedEntryCount() const
Definition: listbox.cxx:995
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: combobox.cxx:1358
bool IsChecked() const
CheckBoxUIObject(const VclPtr< CheckBox > &xCheckbox)
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
virtual OUString get_name() const override
virtual void Click()
Definition: toolbox2.cxx:324
virtual sal_Int32 GetMaxTextLen() const override
Definition: vclmedit.cxx:1063
virtual void execute(const OUString &rAction, const StringMap &rParameters)
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual OUString GetSelected() const override
Definition: vclmedit.cxx:1078
virtual ~ComboBoxUIObject() override
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual std::unique_ptr< UIObject > get_child(const OUString &rID) override
Returns the child of the current UIObject with the corresponding id.
VclPtr< MetricField > mxMetricField
void RequestDoubleBuffering(bool bRequest)
Enable/disable double-buffering of the frame window and all its children.
Definition: window.cxx:3794
virtual OUString get_name() const override
void GrabFocus()
Definition: window.cxx:2960
constexpr sal_uInt16 KEY_F10
Definition: keycodes.hxx:92
static void append(std::bitset< N > &rSet, size_t const nOffset, sal_uInt32 const nValue)
Definition: sft.cxx:2233
virtual void KeyInput(const KeyEvent &rKEvt) override
Definition: edit.cxx:1710
vcl::Window * GetParent() const
Definition: window2.cxx:1097
void Toggle()
Definition: button.cxx:1482
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual ~SpinUIObject() override
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1778
virtual OUString dumpState() const
Currently an internal method to dump the state of the current UIObject as represented by get_state()...
virtual ~SpinFieldUIObject() override
constexpr sal_uInt16 KEY_RETURN
Definition: keycodes.hxx:119
constexpr sal_uInt16 KEY_RIGHT
Definition: keycodes.hxx:113
void SetCurItemId(sal_uInt16 CurID)
Definition: toolbox.hxx:83
std::vector< sal_uInt16 > GetPageIDs() const
Definition: tabctrl.cxx:2182
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1799
VerticalTabControlUIObject(const VclPtr< VerticalTabControl > &mxTabControl)
sal_uInt16 GetChildCount() const
Definition: stacking.cxx:1005
VclPtr< ComboBox > mxComboBox
Definition: uiobject.hxx:328
OUString GetItemCommand(sal_uInt16 nItemId) const
Definition: toolbox2.cxx:1330
virtual OUString get_name() const override
VclPtr< VerticalTabControl > mxTabControl
Definition: uiobject.hxx:423
void EndExecute()
Definition: menu.cxx:2751
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual OUString get_name() const override
WindowType
VclPtr< Dialog > mxDialog
Definition: uiobject.hxx:173
#define SAL_WARN_IF(condition, area, stream)
VclPtr< CheckBox > mxCheckBox
Definition: uiobject.hxx:237
constexpr sal_uInt16 KEY_ESCAPE
Definition: keycodes.hxx:120
virtual OUString get_name() const override
void SetValueFromString(const OUString &rStr)
Definition: field.cxx:636
VclPtr< TabControl > mxTabControl
Definition: uiobject.hxx:399
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
bool IsVisible() const
Definition: window2.cxx:1102
VclPtr< RadioButton > mxRadioButton
Definition: uiobject.hxx:260
MenuButtonUIObject(const VclPtr< MenuButton > &xMenuButton)
constexpr sal_uInt16 KEY_F11
Definition: keycodes.hxx:93
OUString GetValueString() const
Definition: field.cxx:629
constexpr sal_uInt16 KEY_F12
Definition: keycodes.hxx:94
ComboBoxUIObject(const VclPtr< ComboBox > &xListBox)
std::map< OUString, OUString > StringMap
virtual void Select()
Definition: menubtn.cxx:231
virtual ~VerticalTabControlUIObject() override
VclPtr< ListBox > mxListBox
Definition: uiobject.hxx:303
virtual ~CheckBoxUIObject() override
virtual OUString get_type() const override
Returns the type of the UIObject.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
QPRO_FUNC_TYPE nType
SpinUIObject(const VclPtr< SpinButton > &xSpinButton)
VclPtr< MenuButton > mxMenuButton
Definition: uiobject.hxx:515
VclPtr< vcl::Window > mxWindow
Definition: uiobject.hxx:115
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
constexpr sal_uInt16 KEY_BACKSPACE
Definition: keycodes.hxx:122
TabControlUIObject(const VclPtr< TabControl > &mxTabControl)
bool IsMultiSelectionEnabled() const
Definition: listbox.cxx:1139
int GetCurrentRoadmapItemID() const
VclPtr< SpinField > mxSpinField
Definition: uiobject.hxx:375
virtual ~MenuButtonUIObject() override
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:38
WindowType GetType() const
Definition: window2.cxx:974
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
OUString GetText() const override
Definition: vclmedit.cxx:1108
bool IsEnabled() const
Definition: window2.cxx:1122
#define SAL_WARN(area, stream)
WinBits GetStyle() const
Definition: window2.cxx:953
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual void Select()
Definition: toolbox2.cxx:361
virtual ~UIObject()
constexpr sal_uInt16 KEY_DELETE
Definition: keycodes.hxx:125
constexpr sal_uInt16 KEY_LEFT
Definition: keycodes.hxx:112
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
long Max() const
virtual ~DrawingAreaUIObject() override
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: combobox.cxx:1376
OString GetPageId(sal_uInt16 nIndex) const
Definition: ivctrl.cxx:543
virtual void SetText(const OUString &rStr) override
Definition: edit.cxx:2555
constexpr sal_uInt16 KEY_INSERT
Definition: keycodes.hxx:124
bool IsReallyVisible() const
Definition: window2.cxx:1107
virtual ~RoadmapWizardUIObject() override
virtual ~TabPageUIObject() override
virtual ~MetricFieldUIObject() override
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
EditUIObject(const VclPtr< Edit > &xEdit)
virtual OUString get_name() const override
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly...
Definition: window.cxx:3789
virtual StringMap get_state()
Returns the state of the wrapped UI object as a string key value map.
virtual ~EditUIObject() override
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual OUString get_name() const override
ImplToolItems::size_type GetItemCount() const
Definition: toolbox2.cxx:704
sal_uInt16 GetPageCount() const
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual void SetSelection(const Selection &rSelection) override
Definition: vclmedit.cxx:1136
sal_uInt16 nPos
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1841
constexpr sal_uInt16 KEY_TAB
Definition: keycodes.hxx:121
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
vcl::Window * GetChild(sal_uInt16 nChild) const
Definition: stacking.cxx:1021
constexpr sal_uInt16 KEY_F8
Definition: keycodes.hxx:90
virtual ~ListBoxUIObject() override