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["WindowType"] = OUString::number(static_cast<sal_uInt16>(mxWindow->GetType()), 16);
304 
305  Point aPos = mxWindow->GetPosPixel();
306  aMap["RelPosition"] = to_string(aPos);
307  aMap["Size"] = to_string(mxWindow->GetSizePixel());
308  aMap["ID"] = mxWindow->get_id();
309  vcl::Window* pParent = mxWindow->GetParent();
310  if (pParent)
311  aMap["Parent"] = mxWindow->GetParent()->get_id();
312 
313  bool bIgnoreAllExceptTop = isDialogWindow(mxWindow.get());
314  while(pParent)
315  {
316  Point aParentPos = pParent->GetPosPixel();
317  if (!bIgnoreAllExceptTop)
318  aPos += aParentPos;
319 
320  if (isDialogWindow(pParent))
321  {
322  bIgnoreAllExceptTop = true;
323  }
324 
325  pParent = pParent->GetParent();
326 
327  if (!pParent && bIgnoreAllExceptTop)
328  aPos += aParentPos;
329  }
330  aMap["AbsPosition"] = to_string(aPos);
331  aMap["Text"] = mxWindow->GetText();
332  aMap["DisplayText"] = mxWindow->GetDisplayText();
333 
334  return aMap;
335 }
336 
337 void WindowUIObject::execute(const OUString& rAction,
338  const StringMap& rParameters)
339 {
340  if (rAction == "SET")
341  {
342  for (auto const& parameter : rParameters)
343  {
344  std::cout << parameter.first;
345  }
346  }
347  else if (rAction == "TYPE")
348  {
349  auto it = rParameters.find("TEXT");
350  if (it != rParameters.end())
351  {
352  const OUString& rText = it->second;
353  auto aKeyEvents = generate_key_events_from_text(rText);
354  for (auto const& keyEvent : aKeyEvents)
355  {
356  mxWindow->KeyInput(keyEvent);
357  }
358  }
359  else if (rParameters.find("KEYCODE") != rParameters.end())
360  {
361  auto itr = rParameters.find("KEYCODE");
362  const OUString rText = itr->second;
363  auto aKeyEvents = generate_key_events_from_keycode(rText);
364  for (auto const& keyEvent : aKeyEvents)
365  {
366  mxWindow->KeyInput(keyEvent);
367  }
368  }
369  else
370  {
371  OStringBuffer buf;
372  for (auto const & rPair : rParameters)
373  buf.append(",").append(rPair.first.toUtf8()).append("=").append(rPair.second.toUtf8());
374  SAL_WARN("vcl.uitest", "missing parameter TEXT to action TYPE "
375  << buf.makeStringAndClear());
376  throw std::logic_error("missing parameter TEXT to action TYPE");
377  }
378  }
379  else if (rAction == "FOCUS")
380  {
381  mxWindow->GrabFocus();
382  }
383  else
384  {
385  OStringBuffer buf;
386  for (auto const & rPair : rParameters)
387  buf.append(",").append(rPair.first.toUtf8()).append("=").append(rPair.second.toUtf8());
388  SAL_WARN("vcl.uitest", "unknown action for " << get_name()
389  << ". Action: " << rAction << buf.makeStringAndClear());
390  throw std::logic_error("unknown action");
391  }
392 }
393 
394 OUString WindowUIObject::get_type() const
395 {
396  return get_name();
397 }
398 
399 namespace {
400 
401 vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool bRequireVisible = false)
402 {
403  if (!pParent || pParent->IsDisposed())
404  return nullptr;
405 
406  if (pParent->get_id() == rID)
407  return pParent;
408 
409  size_t nCount = pParent->GetChildCount();
410  for (size_t i = 0; i < nCount; ++i)
411  {
412  vcl::Window* pChild = pParent->GetChild(i);
413  if (pChild && pChild->get_id() == rID
414  && (!bRequireVisible || pChild->IsVisible()))
415  return pChild;
416 
417  if (!bRequireVisible || pChild->IsVisible())
418  {
419  vcl::Window* pResult = findChild(pChild, rID);
420  if (pResult)
421  return pResult;
422  }
423  }
424 
425  return nullptr;
426 }
427 
428 void addChildren(vcl::Window const * pParent, std::set<OUString>& rChildren)
429 {
430  if (!pParent)
431  return;
432 
433  size_t nCount = pParent->GetChildCount();
434  for (size_t i = 0; i < nCount; ++i)
435  {
436  vcl::Window* pChild = pParent->GetChild(i);
437  if (pChild)
438  {
439  OUString aId = pChild->get_id();
440  if (!aId.isEmpty())
441  {
442  auto ret = rChildren.insert(aId);
443  SAL_WARN_IF(!ret.second, "vcl.uitest", "duplicate ids '" << aId << "' for ui elements. violates locally unique requirement");
444  }
445 
446  addChildren(pChild, rChildren);
447  }
448  }
449 }
450 
451 }
452 
453 std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID)
454 {
455  // in a first step try the real children before moving to the top level parent
456  // This makes it easier to handle cases with the same ID as there is a way
457  // to resolve conflicts
458  vcl::Window* pWindow = findChild(mxWindow.get(), rID);
459  if (!pWindow)
460  {
461  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
462  pWindow = findChild(pDialogParent, rID);
463  }
464 
465  if (!pWindow)
466  throw css::uno::RuntimeException("Could not find child with id: " + rID);
467 
468  FactoryFunction aFunction = pWindow->GetUITestFactory();
469  return aFunction(pWindow);
470 }
471 
472 std::unique_ptr<UIObject> WindowUIObject::get_visible_child(const OUString& rID)
473 {
474  // in a first step try the real children before moving to the top level parent
475  // This makes it easier to handle cases with the same ID as there is a way
476  // to resolve conflicts
477  vcl::Window* pWindow = findChild(mxWindow.get(), rID, true);
478  if (!pWindow)
479  {
480  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
481  pWindow = findChild(pDialogParent, rID, true);
482  }
483 
484  if (!pWindow)
485  throw css::uno::RuntimeException("Could not find child with id: " + rID);
486 
487  FactoryFunction aFunction = pWindow->GetUITestFactory();
488  return aFunction(pWindow);
489 }
490 
491 std::set<OUString> WindowUIObject::get_children() const
492 {
493  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
494  std::set<OUString> aChildren;
495  aChildren.insert(pDialogParent->get_id());
496  addChildren(pDialogParent, aChildren);
497  return aChildren;
498 }
499 
500 OUString WindowUIObject::get_name() const
501 {
502  return "WindowUIObject";
503 }
504 
505 namespace {
506 
507 OUString escape(const OUString& rStr)
508 {
509  return rStr.replaceAll("\"", "\\\"");
510 }
511 
512 }
513 
515 {
516  OUStringBuffer aStateString = "{\"name\":\"" + mxWindow->get_id() + "\"";
517  aStateString.append(", \"ImplementationName\":\"").appendAscii(typeid(*mxWindow).name()).append("\"");
518  StringMap aState = const_cast<WindowUIObject*>(this)->get_state();
519  for (auto const& elem : aState)
520  {
521  OUString property = ",\"" + elem.first + "\":\"" + escape(elem.second) + "\"";
522  aStateString.append(property);
523  }
524 
525  size_t nCount = mxWindow->GetChildCount();
526 
527  if (nCount)
528  aStateString.append(",\"children\":[");
529 
530  for (size_t i = 0; i < nCount; ++i)
531  {
532  if (i != 0)
533  {
534  aStateString.append(",");
535  }
536  vcl::Window* pChild = mxWindow->GetChild(i);
537  std::unique_ptr<UIObject> pChildWrapper =
538  pChild->GetUITestFactory()(pChild);
539  OUString children = pChildWrapper->dumpState();
540  aStateString.append(children);
541  }
542 
543  if (nCount)
544  aStateString.append("]");
545 
546  aStateString.append("}");
547 
548  OUString aString = aStateString.makeStringAndClear();
549  return aString.replaceAll("\n", "\\n");
550 }
551 
553 {
554  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
555  std::unique_ptr<UIObject> pParentWrapper =
556  pDialogParent->GetUITestFactory()(pDialogParent);
557  return pParentWrapper->dumpState();
558 }
559 
561 {
562 
563  OUString aActionName;
564  switch (nEvent)
565  {
568  return OUString();
569 
572  aActionName = "CLICK";
573  break;
574 
576  aActionName = "TYPE";
577  break;
578  default:
579  aActionName = OUString::number(static_cast<int>(nEvent));
580  }
581  return "";
582  //return "Action on element: " + mxWindow->get_id() + " with action : " + aActionName;
583 }
584 
585 std::unique_ptr<UIObject> WindowUIObject::create(vcl::Window* pWindow)
586 {
587  return std::unique_ptr<UIObject>(new WindowUIObject(pWindow));
588 }
589 
591  WindowUIObject(xButton),
592  mxButton(xButton)
593 {
594 }
595 
597 {
598 }
599 
601 {
603  // Move that to a Control base class
604  aMap["Label"] = mxButton->GetDisplayText();
605 
606  return aMap;
607 }
608 
609 void ButtonUIObject::execute(const OUString& rAction,
610  const StringMap& rParameters)
611 {
612  if (rAction == "CLICK")
613  {
614  //Click doesn't call toggle when it's a pushbutton tweaked to be a toggle-button
615  if (PushButton *pPushButton = (mxButton->GetStyle() & WB_TOGGLE) ? dynamic_cast<PushButton*>(mxButton.get()) : nullptr)
616  {
617  pPushButton->Check(!pPushButton->IsChecked());
618  pPushButton->Toggle();
619  return;
620  }
621  mxButton->Click();
622  }
623  else
624  WindowUIObject::execute(rAction, rParameters);
625 }
626 
627 OUString ButtonUIObject::get_name() const
628 {
629  return "ButtonUIObject";
630 }
631 
633 {
634  if (nEvent == VclEventId::ButtonClick)
635  {
636  if(mxButton->get_id()=="writer_all")
637  {
639  return "Start writer" ;
640  }
641  else if(mxButton->get_id()=="calc_all")
642  {
644  return "Start calc" ;
645  }
646  else if(mxButton->get_id()=="impress_all")
647  {
649  return "Start impress" ;
650  }
651  else if(mxButton->get_id()=="draw_all")
652  {
654  return "Start draw" ;
655  }
656  else if(mxButton->get_id()=="math_all")
657  {
659  return "Start math" ;
660  }
661  else if(mxButton->get_id()=="database_all")
662  {
664  return "Start database" ;
665  }
666  else{
667  if (get_top_parent(mxButton)->get_id().isEmpty()){
668  //This part because if we don't have parent
669  return "Click on '" + mxButton->get_id() ;
670  }
671  return "Click on '" + mxButton->get_id() + "' from "+
672  get_top_parent(mxButton)->get_id();
673  }
674  }
675  else
676  return WindowUIObject::get_action(nEvent);
677 }
678 
679 std::unique_ptr<UIObject> ButtonUIObject::create(vcl::Window* pWindow)
680 {
681  Button* pButton = dynamic_cast<Button*>(pWindow);
682  assert(pButton);
683  return std::unique_ptr<UIObject>(new ButtonUIObject(pButton));
684 }
685 
687  WindowUIObject(xDialog),
688  mxDialog(xDialog)
689 {
690 }
691 
693 {
694 }
695 
697 {
699  aMap["Modal"] = OUString::boolean(mxDialog->IsModalInputMode());
700 
701  return aMap;
702 }
703 
704 OUString DialogUIObject::get_name() const
705 {
706  return "DialogUIObject";
707 }
708 
709 std::unique_ptr<UIObject> DialogUIObject::create(vcl::Window* pWindow)
710 {
711  Dialog* pDialog = dynamic_cast<Dialog*>(pWindow);
712  assert(pDialog);
713  return std::unique_ptr<UIObject>(new DialogUIObject(pDialog));
714 }
715 
717  WindowUIObject(xEdit),
718  mxEdit(xEdit)
719 {
720 }
721 
723 {
724 }
725 
726 void EditUIObject::execute(const OUString& rAction,
727  const StringMap& rParameters)
728 {
729  bool bHandled = true;
730  if (rAction == "TYPE")
731  {
732  auto it = rParameters.find("TEXT");
733  if (it != rParameters.end())
734  {
735  const OUString& rText = it->second;
736  auto aKeyEvents = generate_key_events_from_text(rText);
737  for (auto const& keyEvent : aKeyEvents)
738  {
739  mxEdit->KeyInput(keyEvent);
740  }
741  }
742  else
743  {
744  bHandled = false;
745  }
746  }
747  else if (rAction == "SET")
748  {
749  auto it = rParameters.find("TEXT");
750  if (it != rParameters.end())
751  {
752  mxEdit->SetText(it->second);
753  mxEdit->Modify();
754  }
755  else
756  bHandled = false;
757  }
758  else if (rAction == "SELECT")
759  {
760  if (rParameters.find("FROM") != rParameters.end() &&
761  rParameters.find("TO") != rParameters.end())
762  {
763  tools::Long nMin = rParameters.find("FROM")->second.toInt32();
764  tools::Long nMax = rParameters.find("TO")->second.toInt32();
765  Selection aSelection(nMin, nMax);
766  mxEdit->SetSelection(aSelection);
767  }
768  }
769  else if (rAction == "CLEAR")
770  {
771  mxEdit->SetText("");
772  mxEdit->Modify();
773  bHandled = true;
774  }
775  else
776  {
777  bHandled = false;
778  }
779 
780  if (!bHandled)
781  WindowUIObject::execute(rAction, rParameters);
782 }
783 
785 {
787  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
788  aMap["QuickHelpText"] = mxEdit->GetQuickHelpText();
789  aMap["SelectedText"] = mxEdit->GetSelected();
790  aMap["Text"] = mxEdit->GetText();
791 
792  return aMap;
793 }
794 
795 OUString EditUIObject::get_action(VclEventId nEvent) const
796 {
797  if (nEvent == VclEventId::EditSelectionChanged)
798  {
799  const Selection& rSelection = mxEdit->GetSelection();
800  tools::Long nMin = rSelection.Min();
801  tools::Long nMax = rSelection.Max();
802  if(get_top_parent(mxEdit)->get_id().isEmpty()){
803  //This part because if we don't have parent
804  return "Select in '" +
805  mxEdit->get_id() +
806  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
807  OUString::number(nMax) + "\"}"
808  ;
809  }
810  return "Select in '" +
811  mxEdit->get_id() +
812  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
813  OUString::number(nMax) + "\"} from "
814  + get_top_parent(mxEdit)->get_id()
815  ;
816  }
817  else
818  return WindowUIObject::get_action(nEvent);
819 }
820 
821 OUString EditUIObject::get_name() const
822 {
823  return "EditUIObject";
824 }
825 
826 std::unique_ptr<UIObject> EditUIObject::create(vcl::Window* pWindow)
827 {
828  Edit* pEdit = dynamic_cast<Edit*>(pWindow);
829  assert(pEdit);
830  return std::unique_ptr<UIObject>(new EditUIObject(pEdit));
831 }
832 
834  WindowUIObject(xEdit),
835  mxEdit(xEdit)
836 {
837 }
838 
840 {
841 }
842 
843 void MultiLineEditUIObject::execute(const OUString& rAction,
844  const StringMap& rParameters)
845 {
846  bool bHandled = true;
847  if (rAction == "TYPE")
848  {
849  WindowUIObject aChildObj(mxEdit->GetTextWindow());
850  aChildObj.execute(rAction, rParameters);
851  }
852  else if (rAction == "SELECT")
853  {
854  if (rParameters.find("FROM") != rParameters.end() &&
855  rParameters.find("TO") != rParameters.end())
856  {
857  tools::Long nMin = rParameters.find("FROM")->second.toInt32();
858  tools::Long nMax = rParameters.find("TO")->second.toInt32();
859  Selection aSelection(nMin, nMax);
860  mxEdit->SetSelection(aSelection);
861  }
862  }
863  else
864  {
865  bHandled = false;
866  }
867 
868  if (!bHandled)
869  WindowUIObject::execute(rAction, rParameters);
870 }
871 
873 {
875  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
876  aMap["SelectedText"] = mxEdit->GetSelected();
877  aMap["Text"] = mxEdit->GetText();
878 
879  return aMap;
880 }
881 
883 {
884  return "MultiLineEditUIObject";
885 }
886 
887 std::unique_ptr<UIObject> MultiLineEditUIObject::create(vcl::Window* pWindow)
888 {
889  VclMultiLineEdit* pEdit = dynamic_cast<VclMultiLineEdit*>(pWindow);
890  assert(pEdit);
891  return std::unique_ptr<UIObject>(new MultiLineEditUIObject(pEdit));
892 }
893 
895  WindowUIObject(xCheckbox),
896  mxCheckBox(xCheckbox)
897 {
898 }
899 
901 {
902 }
903 
904 void CheckBoxUIObject::execute(const OUString& rAction,
905  const StringMap& rParameters)
906 {
907  if (rAction == "CLICK")
908  {
909  // don't use toggle directly, it does not set the value
911  }
912  else
913  WindowUIObject::execute(rAction, rParameters);
914 }
915 
917 {
919  aMap["Selected"] = OUString::boolean(mxCheckBox->IsChecked());
920  aMap["TriStateEnabled"] = OUString::boolean(mxCheckBox->IsTriStateEnabled());
921  return aMap;
922 }
923 
925 {
926  return "CheckBoxUIObject";
927 }
928 
930 {
931  if (nEvent == VclEventId::CheckboxToggle)
932  {
933  if(get_top_parent(mxCheckBox)->get_id().isEmpty()){
934  //This part because if we don't have parent
935  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox";
936  }
937  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox from " +
938  get_top_parent(mxCheckBox)->get_id();
939  }
940  else
941  return WindowUIObject::get_action(nEvent);
942 }
943 
944 std::unique_ptr<UIObject> CheckBoxUIObject::create(vcl::Window* pWindow)
945 {
946  CheckBox* pCheckBox = dynamic_cast<CheckBox*>(pWindow);
947  assert(pCheckBox);
948  return std::unique_ptr<UIObject>(new CheckBoxUIObject(pCheckBox));
949 }
950 
952  WindowUIObject(xRadioButton),
953  mxRadioButton(xRadioButton)
954 {
955 }
956 
958 {
959 }
960 
961 void RadioButtonUIObject::execute(const OUString& rAction,
962  const StringMap& rParameters)
963 {
964  if (rAction == "CLICK")
965  {
967  }
968  else
969  WindowUIObject::execute(rAction, rParameters);
970 }
971 
973 {
975  aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
976 
977  return aMap;
978 }
979 
981 {
982  return "RadioButtonUIObject";
983 }
984 
986 {
987  if (nEvent == VclEventId::RadiobuttonToggle)
988  {
989  if(get_top_parent(mxRadioButton)->get_id().isEmpty()){
990  //This part because if we don't have parent
991  return "Select '" + mxRadioButton->get_id() + "' RadioButton";
992  }
993  return "Select '" + mxRadioButton->get_id() + "' RadioButton from " +
994  get_top_parent(mxRadioButton)->get_id();
995  }
996  else
997  return WindowUIObject::get_action(nEvent);
998 }
999 
1000 std::unique_ptr<UIObject> RadioButtonUIObject::create(vcl::Window* pWindow)
1001 {
1002  RadioButton* pRadioButton = dynamic_cast<RadioButton*>(pWindow);
1003  assert(pRadioButton);
1004  return std::unique_ptr<UIObject>(new RadioButtonUIObject(pRadioButton));
1005 }
1006 
1008  WindowUIObject(xTabPage),
1009  mxTabPage(xTabPage)
1010 {
1011 }
1012 
1014 {
1015 }
1016 
1017 void TabPageUIObject::execute(const OUString& rAction,
1018  const StringMap& rParameters)
1019 {
1020  WindowUIObject::execute(rAction, rParameters);
1021 }
1022 
1024 {
1026 
1027  return aMap;
1028 }
1029 
1031 {
1032  return "TabPageUIObject";
1033 }
1034 
1036  WindowUIObject(xListBox),
1037  mxListBox(xListBox)
1038 {
1039 }
1040 
1042 {
1043 }
1044 
1045 void ListBoxUIObject::execute(const OUString& rAction,
1046  const StringMap& rParameters)
1047 {
1048  if (!mxListBox->IsEnabled())
1049  return;
1050 
1051  bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
1052  if (!isTiledRendering && !mxListBox->IsReallyVisible())
1053  return;
1054 
1055  if (rAction == "SELECT")
1056  {
1057  bool bSelect = true;
1058  if (rParameters.find("POS") != rParameters.end())
1059  {
1060  auto itr = rParameters.find("POS");
1061  OUString aVal = itr->second;
1062  sal_Int32 nPos = aVal.toInt32();
1063  mxListBox->SelectEntryPos(nPos, bSelect);
1064  }
1065  else if (rParameters.find("TEXT") != rParameters.end())
1066  {
1067  auto itr = rParameters.find("TEXT");
1068  OUString aText = itr->second;
1069  mxListBox->SelectEntry(aText, bSelect);
1070  }
1071  mxListBox->Select();
1072  }
1073  else
1074  WindowUIObject::execute(rAction, rParameters);
1075 }
1076 
1078 {
1080  aMap["ReadOnly"] = OUString::boolean(mxListBox->IsReadOnly());
1081  aMap["MultiSelect"] = OUString::boolean(mxListBox->IsMultiSelectionEnabled());
1082  aMap["EntryCount"] = OUString::number(mxListBox->GetEntryCount());
1083  aMap["SelectEntryCount"] = OUString::number(mxListBox->GetSelectedEntryCount());
1084  aMap["SelectEntryPos"] = OUString::number(mxListBox->GetSelectedEntryPos());
1085  aMap["SelectEntryText"] = mxListBox->GetSelectedEntry();
1086 
1087  return aMap;
1088 }
1089 
1091 {
1092  return "ListBoxUIObject";
1093 }
1094 
1096 {
1097  if (nEvent == VclEventId::ListboxSelect)
1098  {
1099  sal_Int32 nPos = mxListBox->GetSelectedEntryPos();
1100  if(get_top_parent(mxListBox)->get_id().isEmpty()){
1101  //This part because if we don't have parent
1102  return "Select element with position " + OUString::number(nPos) +
1103  " in '" + mxListBox->get_id();
1104  }
1105  return "Select element with position " + OUString::number(nPos) +
1106  " in '" + mxListBox->get_id() +"' from" + get_top_parent(mxListBox)->get_id() ;
1107  }
1108  else if (nEvent == VclEventId::ListboxFocus)
1109  {
1110  if(get_top_parent(mxListBox)->get_id().isEmpty())
1111  {
1112  //This part because if we don't have parent
1113  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id();
1114  }
1115  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id() +
1116  " Parent:" + get_top_parent(mxListBox)->get_id();
1117  }
1118  else
1119  return WindowUIObject::get_action(nEvent);
1120 }
1121 
1122 std::unique_ptr<UIObject> ListBoxUIObject::create(vcl::Window* pWindow)
1123 {
1124  ListBox* pListBox = dynamic_cast<ListBox*>(pWindow);
1125  assert(pListBox);
1126  return std::unique_ptr<UIObject>(new ListBoxUIObject(pListBox));
1127 }
1128 
1130  WindowUIObject(xComboBox),
1131  mxComboBox(xComboBox)
1132 {
1133 }
1134 
1136 {
1137 }
1138 
1139 void ComboBoxUIObject::execute(const OUString& rAction,
1140  const StringMap& rParameters)
1141 {
1142  if (rAction == "SELECT")
1143  {
1144  if (rParameters.find("POS") != rParameters.end())
1145  {
1146  auto itr = rParameters.find("POS");
1147  OUString aVal = itr->second;
1148  sal_Int32 nPos = aVal.toInt32();
1149  mxComboBox->SelectEntryPos(nPos);
1150  }
1151  else if(rParameters.find("TEXT") != rParameters.end()){
1152  auto itr = rParameters.find("TEXT");
1153  OUString aVal = itr->second;
1154  sal_Int32 nPos = mxComboBox->GetEntryPos(aVal);
1155  mxComboBox->SelectEntryPos(nPos);
1156  }
1157  mxComboBox->Select();
1158  }
1159  else if ( rAction == "TYPE" || rAction == "SET" || rAction == "CLEAR" ){
1160  if (mxComboBox->GetSubEdit())
1161  {
1162  Edit* pEdit = mxComboBox->GetSubEdit();
1163  std::unique_ptr<UIObject> pObj = EditUIObject::create(pEdit);
1164  pObj->execute(rAction, rParameters);
1165  }
1166  else
1167  WindowUIObject::execute(rAction, rParameters);
1168  }
1169  else
1170  WindowUIObject::execute(rAction, rParameters);
1171 }
1172 
1174 {
1176  return aMap;
1177 }
1178 
1180 {
1181  return "ComboBoxUIObject";
1182 }
1183 
1185 {
1186  if (nEvent == VclEventId::ComboboxSelect)
1187  {
1188  sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
1189  if (get_top_parent(mxComboBox)->get_id().isEmpty()){
1190  //This part because if we don't have parent
1191  return "Select in '" + mxComboBox->get_id() +
1192  "' ComboBox item number " + OUString::number(nPos);
1193  }
1194  return "Select in '" + mxComboBox->get_id() +
1195  "' ComboBox item number " + OUString::number(nPos) +
1196  " from " + get_top_parent(mxComboBox)->get_id();
1197  }
1198  else
1199  return WindowUIObject::get_action(nEvent);
1200 }
1201 
1202 std::unique_ptr<UIObject> ComboBoxUIObject::create(vcl::Window* pWindow)
1203 {
1204  ComboBox* pComboBox = dynamic_cast<ComboBox*>(pWindow);
1205  assert(pComboBox);
1206  return std::unique_ptr<UIObject>(new ComboBoxUIObject(pComboBox));
1207 }
1208 
1210  WindowUIObject(xSpinButton),
1211  mxSpinButton(xSpinButton)
1212 {
1213 }
1214 
1216 {
1217 }
1218 
1219 void SpinUIObject::execute(const OUString& rAction,
1220  const StringMap& rParameters)
1221 {
1222  if (rAction == "UP")
1223  {
1224  mxSpinButton->Up();
1225  }
1226  else if (rAction == "DOWN")
1227  {
1228  mxSpinButton->Down();
1229  }
1230  else
1231  WindowUIObject::execute(rAction, rParameters);
1232 }
1233 
1235 {
1237  aMap["Min"] = OUString::number(mxSpinButton->GetRangeMin());
1238  aMap["Max"] = OUString::number(mxSpinButton->GetRangeMax());
1239  aMap["Step"] = OUString::number(mxSpinButton->GetValueStep());
1240  aMap["Value"] = OUString::number(mxSpinButton->GetValue());
1241 
1242  return aMap;
1243 }
1244 
1245 OUString SpinUIObject::get_action(VclEventId nEvent) const
1246 {
1247  if (nEvent == VclEventId::SpinbuttonUp)
1248  {
1249  return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() +
1250  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1251  }
1252  else if (nEvent == VclEventId::SpinbuttonDown)
1253  {
1254  return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() +
1255  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1256  }
1257  else
1258  return WindowUIObject::get_action(nEvent);
1259 }
1260 
1261 OUString SpinUIObject::get_name() const
1262 {
1263  return "SpinUIObject";
1264 }
1265 
1267  EditUIObject(xSpinField),
1268  mxSpinField(xSpinField)
1269 {
1270 }
1271 
1273 {
1274 }
1275 
1276 void SpinFieldUIObject::execute(const OUString& rAction,
1277  const StringMap& rParameters)
1278 {
1279  if (rAction == "UP")
1280  {
1281  mxSpinField->Up();
1282  }
1283  else if (rAction == "DOWN")
1284  {
1285  mxSpinField->Down();
1286  }
1287  else if (rAction == "TYPE")
1288  {
1289  if (mxSpinField->GetSubEdit())
1290  {
1291  Edit* pSubEdit = mxSpinField->GetSubEdit();
1292  EditUIObject aSubObject(pSubEdit);
1293  aSubObject.execute(rAction, rParameters);
1294  }
1295  }
1296  else
1297  EditUIObject::execute(rAction, rParameters);
1298 }
1299 
1301 {
1303 
1304  return aMap;
1305 }
1306 
1308 {
1309  if (nEvent == VclEventId::SpinfieldUp)
1310  {
1311  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1312  {
1313  //This part because if we don't have parent
1314  return "Increase '" + mxSpinField->get_id();
1315  }
1316  return "Increase '" + mxSpinField->get_id() +
1317  "' from " + get_top_parent(mxSpinField)->get_id();
1318  }
1319  else if (nEvent == VclEventId::SpinfieldDown)
1320  {
1321  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1322  {
1323  //This part because if we don't have parent
1324  return "Decrease '" + mxSpinField->get_id();
1325  }
1326  return "Decrease '" + mxSpinField->get_id() +
1327  "' from " + get_top_parent(mxSpinField)->get_id();
1328  }
1329  else
1330  return WindowUIObject::get_action(nEvent);
1331 }
1332 
1334 {
1335  return "SpinFieldUIObject";
1336 }
1337 
1338 std::unique_ptr<UIObject> SpinFieldUIObject::create(vcl::Window* pWindow)
1339 {
1340  SpinField* pSpinField = dynamic_cast<SpinField*>(pWindow);
1341  assert(pSpinField);
1342  return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField));
1343 }
1344 
1345 
1347  SpinFieldUIObject(xMetricField),
1348  mxMetricField(xMetricField)
1349 {
1350 }
1351 
1353 {
1354 }
1355 
1356 void MetricFieldUIObject::execute(const OUString& rAction,
1357  const StringMap& rParameters)
1358 {
1359  if (rAction == "VALUE")
1360  {
1361  auto itPos = rParameters.find("VALUE");
1362  if (itPos != rParameters.end())
1363  {
1364  mxMetricField->SetValueFromString(itPos->second);
1365  }
1366  }
1367  else
1368  SpinFieldUIObject::execute(rAction, rParameters);
1369 }
1370 
1372 {
1374  aMap["Value"] = mxMetricField->GetValueString();
1375 
1376  return aMap;
1377 }
1378 
1380 {
1381  return "MetricFieldUIObject";
1382 }
1383 
1384 std::unique_ptr<UIObject> MetricFieldUIObject::create(vcl::Window* pWindow)
1385 {
1386  MetricField* pMetricField = dynamic_cast<MetricField*>(pWindow);
1387  assert(pMetricField);
1388  return std::unique_ptr<UIObject>(new MetricFieldUIObject(pMetricField));
1389 }
1390 
1392  SpinFieldUIObject(xFormattedField),
1393  mxFormattedField(xFormattedField)
1394 {
1395 }
1396 
1398 {
1399 }
1400 
1401 void FormattedFieldUIObject::execute(const OUString& rAction,
1402  const StringMap& rParameters)
1403 {
1404  if (rAction == "VALUE")
1405  {
1406  auto itPos = rParameters.find("VALUE");
1407  if (itPos != rParameters.end())
1408  {
1409  mxFormattedField->SetValueFromString(itPos->second);
1410  }
1411  }
1412  else
1413  SpinFieldUIObject::execute(rAction, rParameters);
1414 }
1415 
1417 {
1419  aMap["Value"] = OUString::number(mxFormattedField->GetFormatter().GetValue());
1420 
1421  return aMap;
1422 }
1423 
1425 {
1426  return "FormattedFieldUIObject";
1427 }
1428 
1429 std::unique_ptr<UIObject> FormattedFieldUIObject::create(vcl::Window* pWindow)
1430 {
1431  FormattedField* pFormattedField = dynamic_cast<FormattedField*>(pWindow);
1432  assert(pFormattedField);
1433  return std::unique_ptr<UIObject>(new FormattedFieldUIObject(pFormattedField));
1434 }
1435 
1437  WindowUIObject(xTabControl),
1438  mxTabControl(xTabControl)
1439 {
1440 }
1441 
1443 {
1444 }
1445 
1446 void TabControlUIObject::execute(const OUString& rAction,
1447  const StringMap& rParameters)
1448 {
1449  if (rAction == "SELECT")
1450  {
1451  if (rParameters.find("POS") != rParameters.end())
1452  {
1453  auto itr = rParameters.find("POS");
1454  sal_uInt32 nPos = itr->second.toUInt32();
1455  std::vector<sal_uInt16> aIds = mxTabControl->GetPageIDs();
1456  mxTabControl->SelectTabPage(aIds[nPos]);
1457  }
1458  }
1459  else
1460  WindowUIObject::execute(rAction, rParameters);
1461 }
1462 
1464 {
1466  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1467 
1468  sal_uInt16 nPageId = mxTabControl->GetCurPageId();
1469  aMap["CurrPageId"] = OUString::number(nPageId);
1470  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1471 
1472  return aMap;
1473 }
1474 
1476 {
1477  if (nEvent == VclEventId::TabpageActivate)
1478  {
1479  sal_Int32 nPageId = mxTabControl->GetCurPageId();
1480 
1481  if(get_top_parent(mxTabControl)->get_id().isEmpty()){
1482  //This part because if we don't have parent
1483  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1484  " in '" + mxTabControl->get_id();
1485  }
1486  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1487  " in '" + mxTabControl->get_id()+
1488  "' from " + get_top_parent(mxTabControl)->get_id() ;
1489  }
1490  else
1491  return WindowUIObject::get_action(nEvent);
1492 }
1493 
1495 {
1496  return "TabControlUIObject";
1497 }
1498 
1499 std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow)
1500 {
1501  TabControl* pTabControl = dynamic_cast<TabControl*>(pWindow);
1502  assert(pTabControl);
1503  return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl));
1504 }
1505 
1507  WindowUIObject(xRoadmapWizard),
1508  mxRoadmapWizard(xRoadmapWizard)
1509 {
1510 }
1511 
1513 {
1514 }
1515 
1516 void RoadmapWizardUIObject::execute(const OUString& rAction,
1517  const StringMap& rParameters)
1518 {
1519  if (rAction == "SELECT")
1520  {
1521  if (rParameters.find("POS") != rParameters.end())
1522  {
1523  auto itr = rParameters.find("POS");
1524  sal_uInt32 nPos = itr->second.toUInt32();
1526  }
1527  }
1528  else
1529  WindowUIObject::execute(rAction, rParameters);
1530 }
1531 
1533 {
1535 
1536  aMap["CurrentStep"] = OUString::number(mxRoadmapWizard->GetCurrentRoadmapItemID());
1537 
1538  return aMap;
1539 }
1540 
1542 {
1543  return "RoadmapWizardUIObject";
1544 }
1545 
1546 std::unique_ptr<UIObject> RoadmapWizardUIObject::create(vcl::Window* pWindow)
1547 {
1548  vcl::RoadmapWizard* pRoadmapWizard = dynamic_cast<vcl::RoadmapWizard*>(pWindow);
1549  assert(pRoadmapWizard);
1550  return std::unique_ptr<UIObject>(new RoadmapWizardUIObject(pRoadmapWizard));
1551 }
1552 
1554  WindowUIObject(xTabControl),
1555  mxTabControl(xTabControl)
1556 {
1557 }
1558 
1560 {
1561 }
1562 
1563 void VerticalTabControlUIObject::execute(const OUString& rAction,
1564  const StringMap& rParameters)
1565 {
1566  if (rAction == "SELECT")
1567  {
1568  if (rParameters.find("POS") != rParameters.end())
1569  {
1570  auto itr = rParameters.find("POS");
1571  sal_uInt32 nPos = itr->second.toUInt32();
1572  OString xid = mxTabControl->GetPageId(nPos);
1573  mxTabControl->SetCurPageId(xid);
1574  }
1575  }
1576  else
1577  WindowUIObject::execute(rAction, rParameters);
1578 }
1579 
1581 {
1583  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1584 
1585  OString nPageId = mxTabControl->GetCurPageId();
1586  aMap["CurrPageTitel"] = mxTabControl->GetPageText(nPageId);
1587  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1588 
1589  return aMap;
1590 }
1591 
1593 {
1594  return "VerticalTabControlUIObject";
1595 }
1596 
1597 std::unique_ptr<UIObject> VerticalTabControlUIObject::create(vcl::Window* pWindow)
1598 {
1599  VerticalTabControl* pTabControl = dynamic_cast<VerticalTabControl*>(pWindow);
1600  assert(pTabControl);
1601  return std::unique_ptr<UIObject>(new VerticalTabControlUIObject(pTabControl));
1602 }
1603 
1604 
1606  WindowUIObject(xToolBox),
1607  mxToolBox(xToolBox)
1608 {
1609 }
1610 
1612 {
1613 }
1614 
1615 void ToolBoxUIObject::execute(const OUString& rAction,
1616  const StringMap& rParameters)
1617 {
1618  if (rAction == "CLICK")
1619  {
1620  if (rParameters.find("POS") != rParameters.end())
1621  {
1622  auto itr = rParameters.find("POS");
1623  sal_uInt16 nPos = itr->second.toUInt32();
1625  mxToolBox->Click();
1626  mxToolBox->Select();
1627  }
1628  }
1629  else
1630  WindowUIObject::execute(rAction, rParameters);
1631 }
1632 
1634 {
1635  if (nEvent == VclEventId::ToolboxClick)
1636  {
1637  return "Click on item number " + OUString::number(sal_uInt16(mxToolBox->GetCurItemId())) +
1638  " in " + mxToolBox->get_id();
1639  }
1640  else
1641  return WindowUIObject::get_action(nEvent);
1642 }
1643 
1645 {
1647  aMap["CurrSelectedItemID"] = OUString::number(sal_uInt16(mxToolBox->GetCurItemId()));
1648  aMap["CurrSelectedItemText"] = mxToolBox->GetItemText(mxToolBox->GetCurItemId());
1649  aMap["CurrSelectedItemCommand"] = mxToolBox->GetItemCommand(mxToolBox->GetCurItemId());
1650  aMap["ItemCount"] = OUString::number(mxToolBox->GetItemCount());
1651  return aMap;
1652 }
1653 
1655 {
1656  return "ToolBoxUIObject";
1657 }
1658 
1659 std::unique_ptr<UIObject> ToolBoxUIObject::create(vcl::Window* pWindow)
1660 {
1661  ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
1662  assert(pToolBox);
1663  return std::unique_ptr<UIObject>(new ToolBoxUIObject(pToolBox));
1664 }
1665 
1667  WindowUIObject(xMenuButton),
1668  mxMenuButton(xMenuButton)
1669 {
1670 }
1671 
1673 {
1674 }
1675 
1677 {
1679  aMap["Label"] = mxMenuButton->GetDisplayText();
1680  aMap["CurrentItem"] = OUString::createFromAscii(mxMenuButton->GetCurItemIdent());
1681  return aMap;
1682 }
1683 
1684 void MenuButtonUIObject::execute(const OUString& rAction,
1685  const StringMap& rParameters)
1686 {
1687  if (rAction == "CLICK")
1688  {
1690  mxMenuButton->Toggle();
1691  }
1692  else if (rAction == "OPENLIST")
1693  {
1695  }
1696  else if (rAction == "OPENFROMLIST")
1697  {
1698  auto itr = rParameters.find("POS");
1699  sal_uInt32 nPos = itr->second.toUInt32();
1700 
1701  sal_uInt32 nId = mxMenuButton->GetPopupMenu()->GetItemId(nPos);
1704  mxMenuButton->Select();
1705  }
1706  else if (rAction == "CLOSELIST")
1707  {
1709  }
1710  else
1711  WindowUIObject::execute(rAction, rParameters);
1712 }
1713 
1715 {
1716  return "MenuButtonUIObject";
1717 }
1718 
1719 std::unique_ptr<UIObject> MenuButtonUIObject::create(vcl::Window* pWindow)
1720 {
1721  MenuButton* pMenuButton = dynamic_cast<MenuButton*>(pWindow);
1722  assert(pMenuButton);
1723  return std::unique_ptr<UIObject>(new MenuButtonUIObject(pMenuButton));
1724 }
1725 
1727  : WindowUIObject(rDrawingArea)
1728  , mxDrawingArea(dynamic_cast<VclDrawingArea*>(rDrawingArea.get()))
1729 {
1732 }
1733 
1735 {
1736 }
1737 
1739  TreeListUIObject(xIconView)
1740 {
1741 }
1742 
1744 {
1746 
1748 
1749  OUString* pId = static_cast<OUString*>(pEntry->GetUserData());
1750  if (pId)
1751  aMap["SelectedItemId"] = *pId;
1752 
1753  SvTreeList* pModel = mxTreeList->GetModel();
1754  if (pModel)
1755  aMap["SelectedItemPos"] = OUString::number(pModel->GetAbsPos(pEntry));
1756 
1757  return aMap;
1758 }
1759 
1761 {
1762  return "IconViewUIObject";
1763 }
1764 
1765 std::unique_ptr<UIObject> IconViewUIObject::create(vcl::Window* pWindow)
1766 {
1767  SvTreeListBox* pTreeList = dynamic_cast<SvTreeListBox*>(pWindow);
1768  assert(pTreeList);
1769  return std::unique_ptr<UIObject>(new IconViewUIObject(pTreeList));
1770 }
1771 
1772 /* 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:2783
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:3930
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)
VclPtr< SpinButton > mxSpinButton
Definition: uiobject.hxx:355
Edit * GetSubEdit() const
Definition: edit.hxx:217
void SetValueFromString(const OUString &rStr)
Definition: fmtfield.cxx:1331
void Check(bool bCheck=true)
Definition: button.hxx:222
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: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)
ToolBoxItemId GetCurItemId() const
Definition: toolbox.hxx:363
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:2394
void * GetUserData() const
Definition: layout.hxx:745
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:2253
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:2798
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.
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.
void ExecuteMenu()
Definition: menubtn.cxx:55
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:618
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:3925
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
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SvTreeListEntry * FirstSelected() const
Definition: treelist.hxx:253
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:454
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:125
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:3047
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:3053
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:3088
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
sal_uLong GetAbsPos(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:824
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:227
void SetCurItemId()
Definition: menubtn.cxx:262
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
PopupMenu * GetPopupMenu() const
Definition: menubtn.hxx:82
OString const & GetCurItemIdent() const
Definition: menubtn.hxx:86
bool IsTriStateEnabled() const
Definition: button.hxx:355
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:645
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:349
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:3855
virtual OUString get_name() const override
VclPtr< SvTreeListBox > mxTreeList
Definition: uiobject.hxx:465
void GrabFocus()
Definition: window.cxx:2968
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:1520
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:1798
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:2761
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:638
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:631
constexpr sal_uInt16 KEY_F12
Definition: keycodes.hxx:94
ComboBoxUIObject(const VclPtr< ComboBox > &xListBox)
std::map< OUString, OUString > StringMap
void Select()
Definition: menubtn.cxx:232
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
bool IsDisposed() const
Definition: window.cxx:143
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
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:3850
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:707
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