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