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(std::u16string_view 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(xExpander)
899  , mxExpander(xExpander)
900 {
901 }
902 
904 {
905 }
906 
907 void ExpanderUIObject::execute(const OUString& rAction, const StringMap& rParameters)
908 {
909  if (rAction == "EXPAND")
910  {
911  mxExpander->set_expanded(true);
912  }
913  else if (rAction == "COLLAPSE")
914  {
915  mxExpander->set_expanded(false);
916  }
917  else
918  WindowUIObject::execute(rAction, rParameters);
919 }
920 
922 {
924  aMap["Expanded"] = OUString::boolean(mxExpander->get_expanded());
925  return aMap;
926 }
927 
929 {
930  return "ExpanderUIObject";
931 }
932 
933 std::unique_ptr<UIObject> ExpanderUIObject::create(vcl::Window* pWindow)
934 {
935  VclExpander* pVclExpander = dynamic_cast<VclExpander*>(pWindow);
936  assert(pVclExpander);
937  return std::unique_ptr<UIObject>(new ExpanderUIObject(pVclExpander));
938 }
939 
941  WindowUIObject(xCheckbox),
942  mxCheckBox(xCheckbox)
943 {
944 }
945 
947 {
948 }
949 
950 void CheckBoxUIObject::execute(const OUString& rAction,
951  const StringMap& rParameters)
952 {
953  if (rAction == "CLICK")
954  {
955  // don't use toggle directly, it does not set the value
957  }
958  else
959  WindowUIObject::execute(rAction, rParameters);
960 }
961 
963 {
965  aMap["Selected"] = OUString::boolean(mxCheckBox->IsChecked());
966  aMap["TriStateEnabled"] = OUString::boolean(mxCheckBox->IsTriStateEnabled());
967  return aMap;
968 }
969 
971 {
972  return "CheckBoxUIObject";
973 }
974 
976 {
977  if (nEvent == VclEventId::CheckboxToggle)
978  {
979  if(get_top_parent(mxCheckBox)->get_id().isEmpty()){
980  //This part because if we don't have parent
981  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox";
982  }
983  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox from " +
984  get_top_parent(mxCheckBox)->get_id();
985  }
986  else
987  return WindowUIObject::get_action(nEvent);
988 }
989 
990 std::unique_ptr<UIObject> CheckBoxUIObject::create(vcl::Window* pWindow)
991 {
992  CheckBox* pCheckBox = dynamic_cast<CheckBox*>(pWindow);
993  assert(pCheckBox);
994  return std::unique_ptr<UIObject>(new CheckBoxUIObject(pCheckBox));
995 }
996 
998  WindowUIObject(xRadioButton),
999  mxRadioButton(xRadioButton)
1000 {
1001 }
1002 
1004 {
1005 }
1006 
1007 void RadioButtonUIObject::execute(const OUString& rAction,
1008  const StringMap& rParameters)
1009 {
1010  if (rAction == "CLICK")
1011  {
1013  }
1014  else
1015  WindowUIObject::execute(rAction, rParameters);
1016 }
1017 
1019 {
1021  aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
1022 
1023  return aMap;
1024 }
1025 
1027 {
1028  return "RadioButtonUIObject";
1029 }
1030 
1032 {
1033  if (nEvent == VclEventId::RadiobuttonToggle)
1034  {
1035  if(get_top_parent(mxRadioButton)->get_id().isEmpty()){
1036  //This part because if we don't have parent
1037  return "Select '" + mxRadioButton->get_id() + "' RadioButton";
1038  }
1039  return "Select '" + mxRadioButton->get_id() + "' RadioButton from " +
1040  get_top_parent(mxRadioButton)->get_id();
1041  }
1042  else
1043  return WindowUIObject::get_action(nEvent);
1044 }
1045 
1046 std::unique_ptr<UIObject> RadioButtonUIObject::create(vcl::Window* pWindow)
1047 {
1048  RadioButton* pRadioButton = dynamic_cast<RadioButton*>(pWindow);
1049  assert(pRadioButton);
1050  return std::unique_ptr<UIObject>(new RadioButtonUIObject(pRadioButton));
1051 }
1052 
1054  WindowUIObject(xTabPage),
1055  mxTabPage(xTabPage)
1056 {
1057 }
1058 
1060 {
1061 }
1062 
1063 void TabPageUIObject::execute(const OUString& rAction,
1064  const StringMap& rParameters)
1065 {
1066  WindowUIObject::execute(rAction, rParameters);
1067 }
1068 
1070 {
1072 
1073  return aMap;
1074 }
1075 
1077 {
1078  return "TabPageUIObject";
1079 }
1080 
1082  WindowUIObject(xListBox),
1083  mxListBox(xListBox)
1084 {
1085 }
1086 
1088 {
1089 }
1090 
1091 void ListBoxUIObject::execute(const OUString& rAction,
1092  const StringMap& rParameters)
1093 {
1094  if (!mxListBox->IsEnabled())
1095  return;
1096 
1097  bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
1098  if (!isTiledRendering && !mxListBox->IsReallyVisible())
1099  return;
1100 
1101  if (rAction == "SELECT")
1102  {
1103  bool bSelect = true;
1104  if (rParameters.find("POS") != rParameters.end())
1105  {
1106  auto itr = rParameters.find("POS");
1107  OUString aVal = itr->second;
1108  sal_Int32 nPos = aVal.toInt32();
1109  mxListBox->SelectEntryPos(nPos, bSelect);
1110  }
1111  else if (rParameters.find("TEXT") != rParameters.end())
1112  {
1113  auto itr = rParameters.find("TEXT");
1114  OUString aText = itr->second;
1115  mxListBox->SelectEntry(aText, bSelect);
1116  }
1117  mxListBox->Select();
1118  }
1119  else
1120  WindowUIObject::execute(rAction, rParameters);
1121 }
1122 
1124 {
1126  aMap["ReadOnly"] = OUString::boolean(mxListBox->IsReadOnly());
1127  aMap["MultiSelect"] = OUString::boolean(mxListBox->IsMultiSelectionEnabled());
1128  aMap["EntryCount"] = OUString::number(mxListBox->GetEntryCount());
1129  aMap["SelectEntryCount"] = OUString::number(mxListBox->GetSelectedEntryCount());
1130  aMap["SelectEntryPos"] = OUString::number(mxListBox->GetSelectedEntryPos());
1131  aMap["SelectEntryText"] = mxListBox->GetSelectedEntry();
1132 
1133  return aMap;
1134 }
1135 
1137 {
1138  return "ListBoxUIObject";
1139 }
1140 
1142 {
1143  if (nEvent == VclEventId::ListboxSelect)
1144  {
1145  sal_Int32 nPos = mxListBox->GetSelectedEntryPos();
1146  if(get_top_parent(mxListBox)->get_id().isEmpty()){
1147  //This part because if we don't have parent
1148  return "Select element with position " + OUString::number(nPos) +
1149  " in '" + mxListBox->get_id();
1150  }
1151  return "Select element with position " + OUString::number(nPos) +
1152  " in '" + mxListBox->get_id() +"' from" + get_top_parent(mxListBox)->get_id() ;
1153  }
1154  else if (nEvent == VclEventId::ListboxFocus)
1155  {
1156  if(get_top_parent(mxListBox)->get_id().isEmpty())
1157  {
1158  //This part because if we don't have parent
1159  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id();
1160  }
1161  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id() +
1162  " Parent:" + get_top_parent(mxListBox)->get_id();
1163  }
1164  else
1165  return WindowUIObject::get_action(nEvent);
1166 }
1167 
1168 std::unique_ptr<UIObject> ListBoxUIObject::create(vcl::Window* pWindow)
1169 {
1170  ListBox* pListBox = dynamic_cast<ListBox*>(pWindow);
1171  assert(pListBox);
1172  return std::unique_ptr<UIObject>(new ListBoxUIObject(pListBox));
1173 }
1174 
1176  WindowUIObject(xComboBox),
1177  mxComboBox(xComboBox)
1178 {
1179 }
1180 
1182 {
1183 }
1184 
1185 void ComboBoxUIObject::execute(const OUString& rAction,
1186  const StringMap& rParameters)
1187 {
1188  if (rAction == "SELECT")
1189  {
1190  if (rParameters.find("POS") != rParameters.end())
1191  {
1192  auto itr = rParameters.find("POS");
1193  OUString aVal = itr->second;
1194  sal_Int32 nPos = aVal.toInt32();
1195  mxComboBox->SelectEntryPos(nPos);
1196  }
1197  else if(rParameters.find("TEXT") != rParameters.end()){
1198  auto itr = rParameters.find("TEXT");
1199  OUString aVal = itr->second;
1200  sal_Int32 nPos = mxComboBox->GetEntryPos(aVal);
1201  mxComboBox->SelectEntryPos(nPos);
1202  }
1203  mxComboBox->Select();
1204  }
1205  else if ( rAction == "TYPE" || rAction == "SET" || rAction == "CLEAR" ){
1206  if (mxComboBox->GetSubEdit())
1207  {
1208  Edit* pEdit = mxComboBox->GetSubEdit();
1209  std::unique_ptr<UIObject> pObj = EditUIObject::create(pEdit);
1210  pObj->execute(rAction, rParameters);
1211  }
1212  else
1213  WindowUIObject::execute(rAction, rParameters);
1214  }
1215  else
1216  WindowUIObject::execute(rAction, rParameters);
1217 }
1218 
1220 {
1222  aMap["SelectedText"] = mxComboBox->GetSelected();
1223  return aMap;
1224 }
1225 
1227 {
1228  return "ComboBoxUIObject";
1229 }
1230 
1232 {
1233  if (nEvent == VclEventId::ComboboxSelect)
1234  {
1235  sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
1236  if (get_top_parent(mxComboBox)->get_id().isEmpty()){
1237  //This part because if we don't have parent
1238  return "Select in '" + mxComboBox->get_id() +
1239  "' ComboBox item number " + OUString::number(nPos);
1240  }
1241  return "Select in '" + mxComboBox->get_id() +
1242  "' ComboBox item number " + OUString::number(nPos) +
1243  " from " + get_top_parent(mxComboBox)->get_id();
1244  }
1245  else
1246  return WindowUIObject::get_action(nEvent);
1247 }
1248 
1249 std::unique_ptr<UIObject> ComboBoxUIObject::create(vcl::Window* pWindow)
1250 {
1251  ComboBox* pComboBox = dynamic_cast<ComboBox*>(pWindow);
1252  assert(pComboBox);
1253  return std::unique_ptr<UIObject>(new ComboBoxUIObject(pComboBox));
1254 }
1255 
1257  WindowUIObject(xSpinButton),
1258  mxSpinButton(xSpinButton)
1259 {
1260 }
1261 
1263 {
1264 }
1265 
1266 void SpinUIObject::execute(const OUString& rAction,
1267  const StringMap& rParameters)
1268 {
1269  if (rAction == "UP")
1270  {
1271  mxSpinButton->Up();
1272  }
1273  else if (rAction == "DOWN")
1274  {
1275  mxSpinButton->Down();
1276  }
1277  else
1278  WindowUIObject::execute(rAction, rParameters);
1279 }
1280 
1282 {
1284  aMap["Min"] = OUString::number(mxSpinButton->GetRangeMin());
1285  aMap["Max"] = OUString::number(mxSpinButton->GetRangeMax());
1286  aMap["Step"] = OUString::number(mxSpinButton->GetValueStep());
1287  aMap["Value"] = OUString::number(mxSpinButton->GetValue());
1288 
1289  return aMap;
1290 }
1291 
1292 OUString SpinUIObject::get_action(VclEventId nEvent) const
1293 {
1294  if (nEvent == VclEventId::SpinbuttonUp)
1295  {
1296  return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() +
1297  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1298  }
1299  else if (nEvent == VclEventId::SpinbuttonDown)
1300  {
1301  return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() +
1302  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1303  }
1304  else
1305  return WindowUIObject::get_action(nEvent);
1306 }
1307 
1308 OUString SpinUIObject::get_name() const
1309 {
1310  return "SpinUIObject";
1311 }
1312 
1314  EditUIObject(xSpinField),
1315  mxSpinField(xSpinField)
1316 {
1317 }
1318 
1320 {
1321 }
1322 
1323 void SpinFieldUIObject::execute(const OUString& rAction,
1324  const StringMap& rParameters)
1325 {
1326  if (rAction == "UP")
1327  {
1328  mxSpinField->Up();
1329  }
1330  else if (rAction == "DOWN")
1331  {
1332  mxSpinField->Down();
1333  }
1334  else if (rAction == "TYPE")
1335  {
1336  if (mxSpinField->GetSubEdit())
1337  {
1338  Edit* pSubEdit = mxSpinField->GetSubEdit();
1339  EditUIObject aSubObject(pSubEdit);
1340  aSubObject.execute(rAction, rParameters);
1341  }
1342  }
1343  else
1344  EditUIObject::execute(rAction, rParameters);
1345 }
1346 
1348 {
1350 
1351  return aMap;
1352 }
1353 
1355 {
1356  if (nEvent == VclEventId::SpinfieldUp)
1357  {
1358  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1359  {
1360  //This part because if we don't have parent
1361  return "Increase '" + mxSpinField->get_id();
1362  }
1363  return "Increase '" + mxSpinField->get_id() +
1364  "' from " + get_top_parent(mxSpinField)->get_id();
1365  }
1366  else if (nEvent == VclEventId::SpinfieldDown)
1367  {
1368  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1369  {
1370  //This part because if we don't have parent
1371  return "Decrease '" + mxSpinField->get_id();
1372  }
1373  return "Decrease '" + mxSpinField->get_id() +
1374  "' from " + get_top_parent(mxSpinField)->get_id();
1375  }
1376  else
1377  return WindowUIObject::get_action(nEvent);
1378 }
1379 
1381 {
1382  return "SpinFieldUIObject";
1383 }
1384 
1385 std::unique_ptr<UIObject> SpinFieldUIObject::create(vcl::Window* pWindow)
1386 {
1387  SpinField* pSpinField = dynamic_cast<SpinField*>(pWindow);
1388  assert(pSpinField);
1389  return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField));
1390 }
1391 
1392 
1394  SpinFieldUIObject(xMetricField),
1395  mxMetricField(xMetricField)
1396 {
1397 }
1398 
1400 {
1401 }
1402 
1403 void MetricFieldUIObject::execute(const OUString& rAction,
1404  const StringMap& rParameters)
1405 {
1406  if (rAction == "VALUE")
1407  {
1408  auto itPos = rParameters.find("VALUE");
1409  if (itPos != rParameters.end())
1410  {
1411  mxMetricField->SetValueFromString(itPos->second);
1412  }
1413  }
1414  else
1415  SpinFieldUIObject::execute(rAction, rParameters);
1416 }
1417 
1419 {
1421  aMap["Value"] = mxMetricField->GetValueString();
1422 
1423  return aMap;
1424 }
1425 
1427 {
1428  return "MetricFieldUIObject";
1429 }
1430 
1431 std::unique_ptr<UIObject> MetricFieldUIObject::create(vcl::Window* pWindow)
1432 {
1433  MetricField* pMetricField = dynamic_cast<MetricField*>(pWindow);
1434  assert(pMetricField);
1435  return std::unique_ptr<UIObject>(new MetricFieldUIObject(pMetricField));
1436 }
1437 
1439  SpinFieldUIObject(xFormattedField),
1440  mxFormattedField(xFormattedField)
1441 {
1442 }
1443 
1445 {
1446 }
1447 
1448 void FormattedFieldUIObject::execute(const OUString& rAction,
1449  const StringMap& rParameters)
1450 {
1451  if (rAction == "VALUE")
1452  {
1453  auto itPos = rParameters.find("VALUE");
1454  if (itPos != rParameters.end())
1455  {
1456  mxFormattedField->SetValueFromString(itPos->second);
1457  }
1458  }
1459  else
1460  SpinFieldUIObject::execute(rAction, rParameters);
1461 }
1462 
1464 {
1466  aMap["Value"] = OUString::number(mxFormattedField->GetFormatter().GetValue());
1467 
1468  return aMap;
1469 }
1470 
1472 {
1473  return "FormattedFieldUIObject";
1474 }
1475 
1476 std::unique_ptr<UIObject> FormattedFieldUIObject::create(vcl::Window* pWindow)
1477 {
1478  FormattedField* pFormattedField = dynamic_cast<FormattedField*>(pWindow);
1479  assert(pFormattedField);
1480  return std::unique_ptr<UIObject>(new FormattedFieldUIObject(pFormattedField));
1481 }
1482 
1484  WindowUIObject(xTabControl),
1485  mxTabControl(xTabControl)
1486 {
1487 }
1488 
1490 {
1491 }
1492 
1493 void TabControlUIObject::execute(const OUString& rAction,
1494  const StringMap& rParameters)
1495 {
1496  if (rAction == "SELECT")
1497  {
1498  if (rParameters.find("POS") != rParameters.end())
1499  {
1500  auto itr = rParameters.find("POS");
1501  sal_uInt32 nPos = itr->second.toUInt32();
1502  std::vector<sal_uInt16> aIds = mxTabControl->GetPageIDs();
1503  mxTabControl->SelectTabPage(aIds[nPos]);
1504  }
1505  }
1506  else
1507  WindowUIObject::execute(rAction, rParameters);
1508 }
1509 
1511 {
1513  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1514 
1515  sal_uInt16 nPageId = mxTabControl->GetCurPageId();
1516  aMap["CurrPageId"] = OUString::number(nPageId);
1517  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1518 
1519  return aMap;
1520 }
1521 
1523 {
1524  if (nEvent == VclEventId::TabpageActivate)
1525  {
1526  sal_Int32 nPageId = mxTabControl->GetCurPageId();
1527 
1528  if(get_top_parent(mxTabControl)->get_id().isEmpty()){
1529  //This part because if we don't have parent
1530  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1531  " in '" + mxTabControl->get_id();
1532  }
1533  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1534  " in '" + mxTabControl->get_id()+
1535  "' from " + get_top_parent(mxTabControl)->get_id() ;
1536  }
1537  else
1538  return WindowUIObject::get_action(nEvent);
1539 }
1540 
1542 {
1543  return "TabControlUIObject";
1544 }
1545 
1546 std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow)
1547 {
1548  TabControl* pTabControl = dynamic_cast<TabControl*>(pWindow);
1549  assert(pTabControl);
1550  return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl));
1551 }
1552 
1554  WindowUIObject(xRoadmapWizard),
1555  mxRoadmapWizard(xRoadmapWizard)
1556 {
1557 }
1558 
1560 {
1561 }
1562 
1563 void RoadmapWizardUIObject::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();
1573  }
1574  }
1575  else
1576  WindowUIObject::execute(rAction, rParameters);
1577 }
1578 
1580 {
1582 
1583  aMap["CurrentStep"] = OUString::number(mxRoadmapWizard->GetCurrentRoadmapItemID());
1584 
1585  return aMap;
1586 }
1587 
1589 {
1590  return "RoadmapWizardUIObject";
1591 }
1592 
1593 std::unique_ptr<UIObject> RoadmapWizardUIObject::create(vcl::Window* pWindow)
1594 {
1595  vcl::RoadmapWizard* pRoadmapWizard = dynamic_cast<vcl::RoadmapWizard*>(pWindow);
1596  assert(pRoadmapWizard);
1597  return std::unique_ptr<UIObject>(new RoadmapWizardUIObject(pRoadmapWizard));
1598 }
1599 
1601  WindowUIObject(xTabControl),
1602  mxTabControl(xTabControl)
1603 {
1604 }
1605 
1607 {
1608 }
1609 
1610 void VerticalTabControlUIObject::execute(const OUString& rAction,
1611  const StringMap& rParameters)
1612 {
1613  if (rAction == "SELECT")
1614  {
1615  if (rParameters.find("POS") != rParameters.end())
1616  {
1617  auto itr = rParameters.find("POS");
1618  sal_uInt32 nPos = itr->second.toUInt32();
1619  OString xid = mxTabControl->GetPageId(nPos);
1620  mxTabControl->SetCurPageId(xid);
1621  }
1622  }
1623  else
1624  WindowUIObject::execute(rAction, rParameters);
1625 }
1626 
1628 {
1630  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1631 
1632  OString nPageId = mxTabControl->GetCurPageId();
1633  aMap["CurrPageTitel"] = mxTabControl->GetPageText(nPageId);
1634  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1635 
1636  return aMap;
1637 }
1638 
1640 {
1641  return "VerticalTabControlUIObject";
1642 }
1643 
1644 std::unique_ptr<UIObject> VerticalTabControlUIObject::create(vcl::Window* pWindow)
1645 {
1646  VerticalTabControl* pTabControl = dynamic_cast<VerticalTabControl*>(pWindow);
1647  assert(pTabControl);
1648  return std::unique_ptr<UIObject>(new VerticalTabControlUIObject(pTabControl));
1649 }
1650 
1651 
1653  WindowUIObject(xToolBox),
1654  mxToolBox(xToolBox)
1655 {
1656 }
1657 
1659 {
1660 }
1661 
1662 void ToolBoxUIObject::execute(const OUString& rAction,
1663  const StringMap& rParameters)
1664 {
1665  if (rAction == "CLICK")
1666  {
1667  if (rParameters.find("POS") != rParameters.end())
1668  {
1669  auto itr = rParameters.find("POS");
1670  sal_uInt16 nPos = itr->second.toUInt32();
1672  mxToolBox->Click();
1673  mxToolBox->Select();
1674  }
1675  }
1676  else
1677  WindowUIObject::execute(rAction, rParameters);
1678 }
1679 
1681 {
1682  if (nEvent == VclEventId::ToolboxClick)
1683  {
1684  return "Click on item number " + OUString::number(sal_uInt16(mxToolBox->GetCurItemId())) +
1685  " in " + mxToolBox->get_id();
1686  }
1687  else
1688  return WindowUIObject::get_action(nEvent);
1689 }
1690 
1692 {
1694  aMap["CurrSelectedItemID"] = OUString::number(sal_uInt16(mxToolBox->GetCurItemId()));
1695  aMap["CurrSelectedItemText"] = mxToolBox->GetItemText(mxToolBox->GetCurItemId());
1696  aMap["CurrSelectedItemCommand"] = mxToolBox->GetItemCommand(mxToolBox->GetCurItemId());
1697  aMap["ItemCount"] = OUString::number(mxToolBox->GetItemCount());
1698  return aMap;
1699 }
1700 
1702 {
1703  return "ToolBoxUIObject";
1704 }
1705 
1706 std::unique_ptr<UIObject> ToolBoxUIObject::create(vcl::Window* pWindow)
1707 {
1708  ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
1709  assert(pToolBox);
1710  return std::unique_ptr<UIObject>(new ToolBoxUIObject(pToolBox));
1711 }
1712 
1714  WindowUIObject(xMenuButton),
1715  mxMenuButton(xMenuButton)
1716 {
1717 }
1718 
1720 {
1721 }
1722 
1724 {
1726  aMap["Label"] = mxMenuButton->GetDisplayText();
1727  aMap["CurrentItem"] = OUString::createFromAscii(mxMenuButton->GetCurItemIdent());
1728  return aMap;
1729 }
1730 
1731 void MenuButtonUIObject::execute(const OUString& rAction,
1732  const StringMap& rParameters)
1733 {
1734  if (rAction == "CLICK")
1735  {
1737  mxMenuButton->Toggle();
1738  }
1739  else if (rAction == "OPENLIST")
1740  {
1742  }
1743  else if (rAction == "OPENFROMLIST")
1744  {
1745  auto itr = rParameters.find("POS");
1746  sal_uInt32 nPos = itr->second.toUInt32();
1747 
1748  sal_uInt32 nId = mxMenuButton->GetPopupMenu()->GetItemId(nPos);
1751  mxMenuButton->Select();
1752  }
1753  else if (rAction == "CLOSELIST")
1754  {
1756  }
1757  else
1758  WindowUIObject::execute(rAction, rParameters);
1759 }
1760 
1762 {
1763  return "MenuButtonUIObject";
1764 }
1765 
1766 std::unique_ptr<UIObject> MenuButtonUIObject::create(vcl::Window* pWindow)
1767 {
1768  MenuButton* pMenuButton = dynamic_cast<MenuButton*>(pWindow);
1769  assert(pMenuButton);
1770  return std::unique_ptr<UIObject>(new MenuButtonUIObject(pMenuButton));
1771 }
1772 
1774  : WindowUIObject(rDrawingArea)
1775  , mxDrawingArea(dynamic_cast<VclDrawingArea*>(rDrawingArea.get()))
1776 {
1777  assert(mxDrawingArea);
1779 }
1780 
1782 {
1783 }
1784 
1785 void DrawingAreaUIObject::execute(const OUString& rAction, const StringMap& rParameters)
1786 {
1787  if (rAction == "CLICK")
1788  {
1789  // POSX and POSY are percentage of width/height dimensions
1790  if (rParameters.find("POSX") != rParameters.end() &&
1791  rParameters.find("POSY") != rParameters.end())
1792  {
1793  auto aPosX = rParameters.find("POSX");
1794  auto aPosY = rParameters.find("POSY");
1795 
1796  OString sPosX2 = OUStringToOString(aPosX->second, RTL_TEXTENCODING_ASCII_US);
1797  OString sPoxY2 = OUStringToOString(aPosY->second, RTL_TEXTENCODING_ASCII_US);
1798 
1799  if (!sPosX2.isEmpty() && !sPoxY2.isEmpty())
1800  {
1801  double fPosX = std::atof(sPosX2.getStr());
1802  double fPosY = std::atof(sPoxY2.getStr());
1803 
1804  fPosX = fPosX * mxDrawingArea->GetOutputSizePixel().Width();
1805  fPosY = fPosY * mxDrawingArea->GetOutputSizePixel().Height();
1806 
1808  mxDrawingArea->MouseButtonDown(aEvent);
1809  mxDrawingArea->MouseButtonUp(aEvent);
1810  }
1811  }
1812  }
1813  else
1814  WindowUIObject::execute(rAction, rParameters);
1815 }
1816 
1817 std::unique_ptr<UIObject> DrawingAreaUIObject::create(vcl::Window* pWindow)
1818 {
1819  VclDrawingArea* pVclDrawingArea = dynamic_cast<VclDrawingArea*>(pWindow);
1820  assert(pVclDrawingArea);
1821  return std::unique_ptr<UIObject>(new DrawingAreaUIObject(pVclDrawingArea));
1822 }
1823 
1825  TreeListUIObject(xIconView)
1826 {
1827 }
1828 
1830 {
1832 
1834 
1835  OUString* pId = static_cast<OUString*>(pEntry->GetUserData());
1836  if (pId)
1837  aMap["SelectedItemId"] = *pId;
1838 
1839  SvTreeList* pModel = mxTreeList->GetModel();
1840  if (pModel)
1841  aMap["SelectedItemPos"] = OUString::number(pModel->GetAbsPos(pEntry));
1842 
1843  return aMap;
1844 }
1845 
1847 {
1848  return "IconViewUIObject";
1849 }
1850 
1851 std::unique_ptr<UIObject> IconViewUIObject::create(vcl::Window* pWindow)
1852 {
1853  SvTreeListBox* pTreeList = dynamic_cast<SvTreeListBox*>(pWindow);
1854  assert(pTreeList);
1855  return std::unique_ptr<UIObject>(new IconViewUIObject(pTreeList));
1856 }
1857 
1858 /* 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:2796
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:219
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:989
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:3940
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:1001
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:532
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: layout.hxx:703
std::vector< OUString > split(std::u16string_view rStr, sal_Unicode cSeparator)
VclPtr< SpinButton > mxSpinButton
Definition: uiobject.hxx:378
Edit * GetSubEdit() const
Definition: edit.hxx:217
void SetValueFromString(const OUString &rStr)
Definition: fmtfield.cxx:1321
void Check(bool bCheck=true)
Definition: button.hxx:223
weld::CustomWidgetController * mpController
Definition: uiobject.hxx:579
OUString GetItemCommand(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1335
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:1845
constexpr sal_uInt16 KEY_F3
Definition: keycodes.hxx:85
Formatter & GetFormatter()
Definition: fmtfield.cxx:1304
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:358
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:897
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:1255
sal_Int64 n
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2404
void * GetUserData() const
Definition: layout.hxx:721
VclPtr< FormattedField > mxFormattedField
constexpr sal_uInt16 KEY_F4
Definition: keycodes.hxx:86
VclPtr< VclDrawingArea > mxDrawingArea
Definition: uiobject.hxx:577
sal_Int16 nId
SAL_DLLPRIVATE void ImplCallClick(bool bGrabFocus=false, GetFocusFlags nFocusFlags=GetFocusFlags::NONE)
Definition: button.cxx:2361
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:2737
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:820
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
virtual void Up()
Definition: spinfld.cxx:357
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:3009
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:597
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
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:611
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:3934
sal_uInt16 nPageId
void setAppName(OUString name)
Definition: logger.hxx:61
sal_Int32 GetEntryCount() const
Definition: listbox.cxx:982
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:521
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:1466
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:861
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:455
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:128
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:150
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:3060
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:362
bool IsReadOnly() const
Definition: listbox.cxx:1323
virtual OUString GetDisplayText() const
Definition: window.cxx:3066
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:1761
SAL_DLLPRIVATE void ImplCheck()
Definition: button.cxx:3208
#define MOUSE_LEFT
Definition: event.hxx:102
VclPtr< Edit > mxEdit
Definition: uiobject.hxx:196
MultiLineEditUIObject(const VclPtr< VclMultiLineEdit > &xEdit)
DialogUIObject(const VclPtr< Dialog > &xDialog)
DocumentType eType
void SelectEntry(std::u16string_view rStr, bool bSelect=true)
Definition: listbox.cxx:1021
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:708
bool IsChecked() const
Definition: button.hxx:228
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:356
A toolbar: contains all those icons, typically below the menu bar.
Definition: toolbox.hxx:75
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
bool get_expanded() const
Definition: layout.cxx:1642
constexpr sal_uInt16 KEY_HOME
Definition: keycodes.hxx:114
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: listbox.cxx:1026
virtual OUString get_type() const
Returns the type of the UIObject.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:623
ListBoxUIObject(const VclPtr< ListBox > &xListBox)
TabPageUIObject(const VclPtr< TabPage > &xTabPage)
VclPtr< Button > mxButton
Definition: uiobject.hxx:156
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:994
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: combobox.cxx:1359
bool IsChecked() const
Definition: button.hxx:350
ExpanderUIObject(const VclPtr< VclExpander > &xExpander)
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:329
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:3864
virtual OUString get_name() const override
VclPtr< SvTreeListBox > mxTreeList
Definition: uiobject.hxx:488
void GrabFocus()
Definition: window.cxx:2981
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:2399
virtual void KeyInput(const KeyEvent &rKEvt) override
Definition: edit.cxx:1711
vcl::Window * GetParent() const
Definition: window2.cxx:1120
void SetCurItemId(ToolBoxItemId CurID)
Definition: toolbox.hxx:85
void Toggle()
Definition: button.cxx:1606
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:1773
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:2164
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:1807
VerticalTabControlUIObject(const VclPtr< VerticalTabControl > &mxTabControl)
VclPtr< VclExpander > mxExpander
Definition: uiobject.hxx:240
sal_uInt16 GetChildCount() const
Definition: stacking.cxx:1001
VclPtr< ComboBox > mxComboBox
Definition: uiobject.hxx:354
virtual OUString get_name() const override
const OString & GetPageId(sal_uInt16 nIndex) const
Definition: ivctrl.cxx:549
VclPtr< VerticalTabControl > mxTabControl
Definition: uiobject.hxx:449
void EndExecute()
Definition: menu.cxx:2700
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:178
#define SAL_WARN_IF(condition, area, stream)
constexpr tools::Long Height() const
void set_expanded(bool bExpanded)
Definition: layout.cxx:1647
VclPtr< CheckBox > mxCheckBox
Definition: uiobject.hxx:263
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:425
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
bool IsVisible() const
Definition: window2.cxx:1125
VclPtr< RadioButton > mxRadioButton
Definition: uiobject.hxx:286
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:1072
VclPtr< ListBox > mxListBox
Definition: uiobject.hxx:329
virtual ~ExpanderUIObject() override
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:555
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
VclPtr< vcl::Window > mxWindow
Definition: uiobject.hxx:120
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:1138
int GetCurrentRoadmapItemID() const
VclPtr< SpinField > mxSpinField
Definition: uiobject.hxx:401
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:997
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:1145
#define SAL_WARN(area, stream)
WinBits GetStyle() const
Definition: window2.cxx:976
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:366
virtual OUString get_name() const override
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
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_INSERT
Definition: keycodes.hxx:124
bool IsReallyVisible() const
Definition: window2.cxx:1130
ToolBoxItemId GetItemId(ImplToolItems::size_type nPos) const
Definition: toolbox2.cxx:743
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:613
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:3859
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:709
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:1837
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
OUString aId