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>
11 
12 #include <vcl/event.hxx>
13 #include <vcl/tabpage.hxx>
14 #include <vcl/lstbox.hxx>
15 #include <vcl/combobox.hxx>
16 #include <vcl/spin.hxx>
17 #include <vcl/spinfld.hxx>
18 #include <vcl/button.hxx>
19 #include <vcl/dialog.hxx>
20 #include <vcl/edit.hxx>
21 #include <vcl/vclmedit.hxx>
22 #include <vcl/uitest/logger.hxx>
23 
24 #include <comphelper/string.hxx>
25 
26 #include <rtl/ustrbuf.hxx>
27 #include <sal/log.hxx>
28 
29 #include <iostream>
30 #include <memory>
31 #include <vector>
32 
34 {
35 }
36 
38 {
39  StringMap aMap;
40  aMap["NotImplemented"] = "NotImplemented";
41  return aMap;
42 }
43 
44 void UIObject::execute(const OUString& /*rAction*/,
45  const StringMap& /*rParameters*/)
46 {
47  // should never be called
48  throw std::exception();
49 }
50 
51 OUString UIObject::get_type() const
52 {
53  return "Generic UIObject";
54 }
55 
56 std::unique_ptr<UIObject> UIObject::get_child(const OUString&)
57 {
58  return std::unique_ptr<UIObject>();
59 }
60 
61 std::set<OUString> UIObject::get_children() const
62 {
63  return std::set<OUString>();
64 }
65 
66 OUString UIObject::dumpState() const
67 {
68  return OUString();
69 }
70 
71 OUString UIObject::dumpHierarchy() const
72 {
73  return OUString();
74 }
75 
76 OUString UIObject::get_action(VclEventId /*nEvent*/) const
77 {
78  return OUString();
79 }
80 
81 namespace {
82 
83 bool isDialogWindow(vcl::Window const * pWindow)
84 {
85  WindowType nType = pWindow->GetType();
86  // DIALOG to MODALDIALOG
87  if (nType >= WindowType::DIALOG && nType <= WindowType::MODALDIALOG)
88  return true;
89 
90  // MESSBOX, INFOBOX, WARNINGBOX, ERRORBOX, QUERYBOX
91  if (nType >= WindowType::MESSBOX && nType <= WindowType::QUERYBOX)
92  return true;
93 
94  if (nType == WindowType::TABDIALOG)
95  return true;
96 
97  return false;
98 }
99 
100 bool isTopWindow(vcl::Window const * pWindow)
101 {
102  WindowType eType = pWindow->GetType();
103  if (eType == WindowType::FLOATINGWINDOW)
104  {
105  return pWindow->GetStyle() & WB_SYSTEMFLOATWIN;
106  }
107  return false;
108 }
109 
110 vcl::Window* get_top_parent(vcl::Window* pWindow)
111 {
112  if (isDialogWindow(pWindow) || isTopWindow(pWindow))
113  return pWindow;
114 
115  vcl::Window* pParent = pWindow->GetParent();
116  if (!pParent)
117  return pWindow;
118 
119  return get_top_parent(pParent);
120 }
121 
122 std::vector<KeyEvent> generate_key_events_from_text(const OUString& rStr)
123 {
124  std::vector<KeyEvent> aEvents;
125  vcl::KeyCode aCode;
126  for (sal_Int32 i = 0, n = rStr.getLength();
127  i != n; ++i)
128  {
129  aEvents.emplace_back(rStr[i], aCode);
130  }
131  return aEvents;
132 }
133 
134 sal_uInt16 get_key(sal_Unicode cChar, bool& bShift)
135 {
136  bShift = false;
137  if (cChar >= 'a' && cChar <= 'z')
138  return KEY_A + (cChar - 'a');
139  else if (cChar >= 'A' && cChar <= 'Z')
140  {
141  bShift = true;
142  return KEY_A + (cChar - 'A');
143  }
144  else if (cChar >= '0' && cChar <= '9')
145  return KEY_0 + (cChar - 'A');
146 
147  return cChar;
148 }
149 
150 bool isFunctionKey(const OUString& rStr, sal_uInt16& rKeyCode)
151 {
152  std::map<OUString, sal_uInt16> aFunctionKeyMap = {
153  {"F1", KEY_F1},
154  {"F2", KEY_F2},
155  {"F3", KEY_F3},
156  {"F4", KEY_F4},
157  {"F5", KEY_F5},
158  {"F6", KEY_F6},
159  {"F7", KEY_F7},
160  {"F8", KEY_F8},
161  {"F9", KEY_F9},
162  {"F10", KEY_F10},
163  {"F11", KEY_F11},
164  {"F12", KEY_F12}
165  };
166 
167  rKeyCode = 0;
168  auto itr = aFunctionKeyMap.find(rStr);
169  if (itr == aFunctionKeyMap.end())
170  return false;
171 
172  rKeyCode = itr->second;
173  return true;
174 }
175 
176 std::vector<KeyEvent> generate_key_events_from_keycode(const OUString& rStr)
177 {
178  std::vector<KeyEvent> aEvents;
179 
180  std::map<OUString, sal_uInt16> aKeyMap = {
181  {"ESC", KEY_ESCAPE},
182  {"TAB", KEY_TAB},
183  {"DOWN", KEY_DOWN},
184  {"UP", KEY_UP},
185  {"LEFT", KEY_LEFT},
186  {"RIGHT", KEY_RIGHT},
187  {"DELETE", KEY_DELETE},
188  {"INSERT", KEY_INSERT},
189  {"BACKSPACE", KEY_BACKSPACE},
190  {"RETURN", KEY_RETURN},
191  {"HOME", KEY_HOME},
192  {"END", KEY_END},
193  {"PAGEUP", KEY_PAGEUP},
194  {"PAGEDOWN", KEY_PAGEDOWN}
195  };
196 
197  // split string along '+'
198  // then translate to keycodes
199  bool bShift = false;
200  bool bMod1 = false;
201  bool bMod2 = false;
202  OUString aRemainingText;
203 
204  std::vector<OUString> aTokens = comphelper::string::split(rStr, '+');
205  for (auto const& token : aTokens)
206  {
207  OUString aToken = token.trim();
208  if (aToken == "CTRL")
209  {
210  bMod1 = true;
211  }
212  else if (aToken == "SHIFT")
213  {
214  bShift = true;
215  }
216  else if (aToken == "ALT")
217  {
218  bMod2 = true;
219  }
220  else
221  aRemainingText = aToken;
222  }
223 
224  sal_uInt16 nFunctionKey = 0;
225  if (isFunctionKey(aRemainingText, nFunctionKey))
226  {
227  vcl::KeyCode aCode(nFunctionKey, bShift, bMod1, bMod2, false);
228  aEvents.emplace_back(0, aCode);
229  }
230  else if (aKeyMap.find(aRemainingText) != aKeyMap.end())
231  {
232  sal_uInt16 nKey = aKeyMap[aRemainingText];
233  vcl::KeyCode aCode(nKey, bShift, bMod1, bMod2, false);
234  aEvents.emplace_back( 'a', aCode);
235  }
236  else
237  {
238  for (sal_Int32 i = 0; i < aRemainingText.getLength(); ++i)
239  {
240  bool bShiftThroughKey = false;
241  sal_uInt16 nKey = get_key(aRemainingText[i], bShiftThroughKey);
242  vcl::KeyCode aCode(nKey, bShift || bShiftThroughKey, bMod1, bMod2, false);
243  aEvents.emplace_back(aRemainingText[i], aCode);
244  }
245  }
246 
247  return aEvents;
248 }
249 
250 OUString to_string(const Point& rPos)
251 {
252  OUString sStr = OUString::number(rPos.X())
253  + "x"
254  + OUString::number(rPos.Y());
255 
256  return sStr;
257 }
258 
259 OUString to_string(const Size& rSize)
260 {
261  OUString sStr = OUString::number(rSize.Width())
262  + "x"
263  + OUString::number(rSize.Height());
264 
265  return sStr;
266 }
267 
268 }
269 
271  mxWindow(xWindow)
272 {
273 }
274 
276 {
277  // Double-buffering is not interesting for uitesting, but can result in direct paint for a
278  // double-buffered widget, which is incorrect.
281 
282  StringMap aMap;
283  aMap["Visible"] = OUString::boolean(mxWindow->IsVisible());
284  aMap["ReallyVisible"] = OUString::boolean(mxWindow->IsReallyVisible());
285  aMap["Enabled"] = OUString::boolean(mxWindow->IsEnabled());
286  aMap["WindowType"] = OUString::number(static_cast<sal_uInt16>(mxWindow->GetType()), 16);
287 
288  Point aPos = mxWindow->GetPosPixel();
289  aMap["RelPosition"] = to_string(aPos);
290  aMap["Size"] = to_string(mxWindow->GetSizePixel());
291  aMap["ID"] = mxWindow->get_id();
292  vcl::Window* pParent = mxWindow->GetParent();
293  if (pParent)
294  aMap["Parent"] = mxWindow->GetParent()->get_id();
295 
296  bool bIgnoreAllExceptTop = isDialogWindow(mxWindow.get());
297  while(pParent)
298  {
299  Point aParentPos = pParent->GetPosPixel();
300  if (!bIgnoreAllExceptTop)
301  aPos += aParentPos;
302 
303  if (isDialogWindow(pParent))
304  {
305  bIgnoreAllExceptTop = true;
306  }
307 
308  pParent = pParent->GetParent();
309 
310  if (!pParent && bIgnoreAllExceptTop)
311  aPos += aParentPos;
312  }
313  aMap["AbsPosition"] = to_string(aPos);
314  aMap["Text"] = mxWindow->GetText();
315  aMap["DisplayText"] = mxWindow->GetDisplayText();
316 
317  return aMap;
318 }
319 
320 void WindowUIObject::execute(const OUString& rAction,
321  const StringMap& rParameters)
322 {
323  bool bHandled = true;
324  if (rAction == "SET")
325  {
326  for (auto const& parameter : rParameters)
327  {
328  std::cout << parameter.first;
329  }
330  }
331  else if (rAction == "TYPE")
332  {
333  auto it = rParameters.find("TEXT");
334  if (it != rParameters.end())
335  {
336  const OUString& rText = it->second;
337  auto aKeyEvents = generate_key_events_from_text(rText);
338  for (auto const& keyEvent : aKeyEvents)
339  {
340  mxWindow->KeyInput(keyEvent);
341  }
342  }
343  else if (rParameters.find("KEYCODE") != rParameters.end())
344  {
345  auto itr = rParameters.find("KEYCODE");
346  const OUString rText = itr->second;
347  auto aKeyEvents = generate_key_events_from_keycode(rText);
348  for (auto const& keyEvent : aKeyEvents)
349  {
350  mxWindow->KeyInput(keyEvent);
351  }
352  }
353  else
354  {
355  SAL_WARN("vcl.uitest", "missing parameter TEXT to action TYPE");
356  return;
357  }
358  }
359  else if (rAction == "FOCUS")
360  {
361  mxWindow->GrabFocus();
362  }
363  else
364  {
365  bHandled = false;
366  }
367 
368  if (!bHandled)
369  {
370  SAL_WARN("vcl.uitest", "unknown action or parameter for " << get_name() << ". Action: " << rAction);
371  }
372 }
373 
374 OUString WindowUIObject::get_type() const
375 {
376  return get_name();
377 }
378 
379 namespace {
380 
381 vcl::Window* findChild(vcl::Window* pParent, const OUString& rID)
382 {
383  if (!pParent)
384  return nullptr;
385 
386  if (pParent->get_id() == rID)
387  return pParent;
388 
389  size_t nCount = pParent->GetChildCount();
390  for (size_t i = 0; i < nCount; ++i)
391  {
392  vcl::Window* pChild = pParent->GetChild(i);
393  if (pChild && pChild->get_id() == rID)
394  return pChild;
395 
396  vcl::Window* pResult = findChild(pChild, rID);
397  if (pResult)
398  return pResult;
399  }
400 
401  return nullptr;
402 }
403 
404 void addChildren(vcl::Window const * pParent, std::set<OUString>& rChildren)
405 {
406  if (!pParent)
407  return;
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)
414  {
415  OUString aId = pChild->get_id();
416  if (!aId.isEmpty())
417  {
418  auto ret = rChildren.insert(aId);
419  SAL_WARN_IF(!ret.second, "vcl.uitest", "duplicate ids for ui elements. violates locally unique requirement");
420  }
421 
422  addChildren(pChild, rChildren);
423  }
424  }
425 }
426 
427 }
428 
429 std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID)
430 {
431  // in a first step try the real children before moving to the top level parent
432  // This makes it easier to handle cases with the same ID as there is a way
433  // to resolve conflicts
434  vcl::Window* pWindow = findChild(mxWindow.get(), rID);
435  if (!pWindow)
436  {
437  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
438  pWindow = findChild(pDialogParent, rID);
439  }
440 
441  if (!pWindow)
442  throw css::uno::RuntimeException("Could not find child with id: " + rID);
443 
444  FactoryFunction aFunction = pWindow->GetUITestFactory();
445  return aFunction(pWindow);
446 }
447 
448 std::set<OUString> WindowUIObject::get_children() const
449 {
450  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
451  std::set<OUString> aChildren;
452  aChildren.insert(pDialogParent->get_id());
453  addChildren(pDialogParent, aChildren);
454  return aChildren;
455 }
456 
457 OUString WindowUIObject::get_name() const
458 {
459  return "WindowUIObject";
460 }
461 
462 namespace {
463 
464 OUString escape(const OUString& rStr)
465 {
466  return rStr.replaceAll("\"", "\\\"");
467 }
468 
469 }
470 
472 {
473  OUStringBuffer aStateString = "{\"name\":\"" + mxWindow->get_id() + "\"";
474  aStateString.append(", \"ImplementationName\":\"").appendAscii(typeid(*mxWindow).name()).append("\"");
475  StringMap aState = const_cast<WindowUIObject*>(this)->get_state();
476  for (auto const& elem : aState)
477  {
478  OUString property = ",\"" + elem.first + "\":\"" + escape(elem.second) + "\"";
479  aStateString.append(property);
480  }
481 
482  size_t nCount = mxWindow->GetChildCount();
483 
484  if (nCount)
485  aStateString.append(",\"children\":[");
486 
487  for (size_t i = 0; i < nCount; ++i)
488  {
489  if (i != 0)
490  {
491  aStateString.append(",");
492  }
493  vcl::Window* pChild = mxWindow->GetChild(i);
494  std::unique_ptr<UIObject> pChildWrapper =
495  pChild->GetUITestFactory()(pChild);
496  OUString children = pChildWrapper->dumpState();
497  aStateString.append(children);
498  }
499 
500  if (nCount)
501  aStateString.append("]");
502 
503  aStateString.append("}");
504 
505  OUString aString = aStateString.makeStringAndClear();
506  return aString.replaceAll("\n", "\\n");
507 }
508 
510 {
511  vcl::Window* pDialogParent = get_top_parent(mxWindow.get());
512  std::unique_ptr<UIObject> pParentWrapper =
513  pDialogParent->GetUITestFactory()(pDialogParent);
514  return pParentWrapper->dumpState();
515 }
516 
518 {
519 
520  OUString aActionName;
521  switch (nEvent)
522  {
525  return OUString();
526 
529  aActionName = "CLICK";
530  break;
531 
533  aActionName = "TYPE";
534  break;
535  default:
536  aActionName = OUString::number(static_cast<int>(nEvent));
537  }
538  return "";
539  //return "Action on element: " + mxWindow->get_id() + " with action : " + aActionName;
540 }
541 
542 std::unique_ptr<UIObject> WindowUIObject::create(vcl::Window* pWindow)
543 {
544  return std::unique_ptr<UIObject>(new WindowUIObject(pWindow));
545 }
546 
548  WindowUIObject(xButton),
549  mxButton(xButton)
550 {
551 }
552 
554 {
555 }
556 
558 {
560  // Move that to a Control base class
561  aMap["Label"] = mxButton->GetDisplayText();
562 
563  return aMap;
564 }
565 
566 void ButtonUIObject::execute(const OUString& rAction,
567  const StringMap& rParameters)
568 {
569  if (rAction == "CLICK")
570  {
571  //Click doesn't call toggle when it's a pushbutton tweaked to be a toggle-button
572  if (PushButton *pPushButton = (mxButton->GetStyle() & WB_TOGGLE) ? dynamic_cast<PushButton*>(mxButton.get()) : nullptr)
573  {
574  pPushButton->Check(!pPushButton->IsChecked());
575  pPushButton->Toggle();
576  return;
577  }
578  mxButton->Click();
579  }
580  else
581  WindowUIObject::execute(rAction, rParameters);
582 }
583 
584 OUString ButtonUIObject::get_name() const
585 {
586  return "ButtonUIObject";
587 }
588 
590 {
591  if (nEvent == VclEventId::ButtonClick)
592  {
593  if(mxButton->get_id()=="writer_all")
594  {
596  return "Start writer" ;
597  }
598  else if(mxButton->get_id()=="calc_all")
599  {
601  return "Start calc" ;
602  }
603  else if(mxButton->get_id()=="impress_all")
604  {
606  return "Start impress" ;
607  }
608  else if(mxButton->get_id()=="draw_all")
609  {
611  return "Start draw" ;
612  }
613  else if(mxButton->get_id()=="math_all")
614  {
616  return "Start math" ;
617  }
618  else if(mxButton->get_id()=="database_all")
619  {
621  return "Start database" ;
622  }
623  else{
624  if (get_top_parent(mxButton)->get_id().isEmpty()){
625  //This part because if we don't have parent
626  return "Click on '" + mxButton->get_id() ;
627  }
628  return "Click on '" + mxButton->get_id() + "' from "+
629  get_top_parent(mxButton)->get_id();
630  }
631  }
632  else
633  return WindowUIObject::get_action(nEvent);
634 }
635 
636 std::unique_ptr<UIObject> ButtonUIObject::create(vcl::Window* pWindow)
637 {
638  Button* pButton = dynamic_cast<Button*>(pWindow);
639  assert(pButton);
640  return std::unique_ptr<UIObject>(new ButtonUIObject(pButton));
641 }
642 
644  WindowUIObject(xDialog),
645  mxDialog(xDialog)
646 {
647 }
648 
650 {
651 }
652 
654 {
656  aMap["Modal"] = OUString::boolean(mxDialog->IsModalInputMode());
657 
658  return aMap;
659 }
660 
661 OUString DialogUIObject::get_name() const
662 {
663  return "DialogUIObject";
664 }
665 
666 std::unique_ptr<UIObject> DialogUIObject::create(vcl::Window* pWindow)
667 {
668  Dialog* pDialog = dynamic_cast<Dialog*>(pWindow);
669  assert(pDialog);
670  return std::unique_ptr<UIObject>(new DialogUIObject(pDialog));
671 }
672 
674  WindowUIObject(xEdit),
675  mxEdit(xEdit)
676 {
677 }
678 
680 {
681 }
682 
683 void EditUIObject::execute(const OUString& rAction,
684  const StringMap& rParameters)
685 {
686  bool bHandled = true;
687  if (rAction == "SET")
688  {
689  if (rParameters.find("TEXT") != rParameters.end())
690  {
691  auto it = rParameters.find("TEXT");
692  if (it == rParameters.end())
693  {
694  SAL_WARN("vcl.uitest", "missing parameter TEXT to action SET");
695  return;
696  }
697 
698  const OUString& rText = it->second;
699  auto aKeyEvents = generate_key_events_from_text(rText);
700  for (auto const& keyEvent : aKeyEvents)
701  {
702  mxEdit->KeyInput(keyEvent);
703  }
704  }
705  else
706  {
707  bHandled = false;
708  }
709  }
710  else if (rAction == "SELECT")
711  {
712  if (rParameters.find("FROM") != rParameters.end() &&
713  rParameters.find("TO") != rParameters.end())
714  {
715  long nMin = rParameters.find("FROM")->second.toInt32();
716  long nMax = rParameters.find("TO")->second.toInt32();
717  Selection aSelection(nMin, nMax);
718  mxEdit->SetSelection(aSelection);
719  }
720  }
721  else if (rAction == "CLEAR")
722  {
723  mxEdit->SetText("");
724  mxEdit->Modify();
725  bHandled = true;
726  }
727  else
728  {
729  bHandled = false;
730  }
731 
732  if (!bHandled)
733  WindowUIObject::execute(rAction, rParameters);
734 }
735 
737 {
739  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
740  aMap["SelectedText"] = mxEdit->GetSelected();
741  aMap["Text"] = mxEdit->GetText();
742 
743  return aMap;
744 }
745 
746 OUString EditUIObject::get_action(VclEventId nEvent) const
747 {
748  if (nEvent == VclEventId::EditSelectionChanged)
749  {
750  const Selection& rSelection = mxEdit->GetSelection();
751  long nMin = rSelection.Min();
752  long nMax = rSelection.Max();
753  if(get_top_parent(mxEdit)->get_id().isEmpty()){
754  //This part because if we don't have parent
755  return "Select in '" +
756  mxEdit->get_id() +
757  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
758  OUString::number(nMax) + "\"}"
759  ;
760  }
761  return "Select in '" +
762  mxEdit->get_id() +
763  "' {\"FROM\": \"" + OUString::number(nMin) + "\", \"TO\": \"" +
764  OUString::number(nMax) + "\"} from "
765  + get_top_parent(mxEdit)->get_id()
766  ;
767  }
768  else
769  return WindowUIObject::get_action(nEvent);
770 }
771 
772 OUString EditUIObject::get_name() const
773 {
774  return "EditUIObject";
775 }
776 
777 std::unique_ptr<UIObject> EditUIObject::create(vcl::Window* pWindow)
778 {
779  Edit* pEdit = dynamic_cast<Edit*>(pWindow);
780  assert(pEdit);
781  return std::unique_ptr<UIObject>(new EditUIObject(pEdit));
782 }
783 
785  WindowUIObject(xEdit),
786  mxEdit(xEdit)
787 {
788 }
789 
791 {
792 }
793 
794 void MultiLineEditUIObject::execute(const OUString& rAction,
795  const StringMap& rParameters)
796 {
797  bool bHandled = true;
798  if (rAction == "TYPE")
799  {
800  WindowUIObject aChildObj(mxEdit->GetTextWindow());
801  aChildObj.execute(rAction, rParameters);
802  }
803  else if (rAction == "SELECT")
804  {
805  if (rParameters.find("FROM") != rParameters.end() &&
806  rParameters.find("TO") != rParameters.end())
807  {
808  long nMin = rParameters.find("FROM")->second.toInt32();
809  long nMax = rParameters.find("TO")->second.toInt32();
810  Selection aSelection(nMin, nMax);
811  mxEdit->SetSelection(aSelection);
812  }
813  }
814  else
815  {
816  bHandled = false;
817  }
818 
819  if (!bHandled)
820  WindowUIObject::execute(rAction, rParameters);
821 }
822 
824 {
826  aMap["MaxTextLength"] = OUString::number(mxEdit->GetMaxTextLen());
827  aMap["SelectedText"] = mxEdit->GetSelected();
828  aMap["Text"] = mxEdit->GetText();
829 
830  return aMap;
831 }
832 
834 {
835  return "MultiLineEditUIObject";
836 }
837 
838 std::unique_ptr<UIObject> MultiLineEditUIObject::create(vcl::Window* pWindow)
839 {
840  VclMultiLineEdit* pEdit = dynamic_cast<VclMultiLineEdit*>(pWindow);
841  assert(pEdit);
842  return std::unique_ptr<UIObject>(new MultiLineEditUIObject(pEdit));
843 }
844 
846  WindowUIObject(xCheckbox),
847  mxCheckBox(xCheckbox)
848 {
849 }
850 
852 {
853 }
854 
855 void CheckBoxUIObject::execute(const OUString& rAction,
856  const StringMap& /*rParameters*/)
857 {
858  if (rAction == "CLICK")
859  {
860  // don't use toggle directly, it does not set the value
862  }
863 }
864 
866 {
868  aMap["Selected"] = OUString::boolean(mxCheckBox->IsChecked());
869  aMap["TriStateEnabled"] = OUString::boolean(mxCheckBox->IsTriStateEnabled());
870  return aMap;
871 }
872 
874 {
875  return "CheckBoxUIObject";
876 }
877 
879 {
880  if (nEvent == VclEventId::CheckboxToggle)
881  {
882  if(get_top_parent(mxCheckBox)->get_id().isEmpty()){
883  //This part because if we don't have parent
884  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox";
885  }
886  return "Toggle '" + mxCheckBox->get_id() + "' CheckBox from " +
887  get_top_parent(mxCheckBox)->get_id();
888  }
889  else
890  return WindowUIObject::get_action(nEvent);
891 }
892 
893 std::unique_ptr<UIObject> CheckBoxUIObject::create(vcl::Window* pWindow)
894 {
895  CheckBox* pCheckBox = dynamic_cast<CheckBox*>(pWindow);
896  assert(pCheckBox);
897  return std::unique_ptr<UIObject>(new CheckBoxUIObject(pCheckBox));
898 }
899 
901  WindowUIObject(xRadioButton),
902  mxRadioButton(xRadioButton)
903 {
904 }
905 
907 {
908 }
909 
910 void RadioButtonUIObject::execute(const OUString& rAction,
911  const StringMap& /*rParameters*/)
912 {
913  if (rAction == "CLICK")
914  {
916  }
917 }
918 
920 {
922  aMap["Checked"] = OUString::boolean(mxRadioButton->IsChecked());
923 
924  return aMap;
925 }
926 
928 {
929  return "RadioButtonUIObject";
930 }
931 
933 {
934  if (nEvent == VclEventId::RadiobuttonToggle)
935  {
936  if(get_top_parent(mxRadioButton)->get_id().isEmpty()){
937  //This part because if we don't have parent
938  return "Select '" + mxRadioButton->get_id() + "' RadioButton";
939  }
940  return "Select '" + mxRadioButton->get_id() + "' RadioButton from " +
941  get_top_parent(mxRadioButton)->get_id();
942  }
943  else
944  return WindowUIObject::get_action(nEvent);
945 }
946 
947 std::unique_ptr<UIObject> RadioButtonUIObject::create(vcl::Window* pWindow)
948 {
949  RadioButton* pRadioButton = dynamic_cast<RadioButton*>(pWindow);
950  assert(pRadioButton);
951  return std::unique_ptr<UIObject>(new RadioButtonUIObject(pRadioButton));
952 }
953 
955  WindowUIObject(xTabPage),
956  mxTabPage(xTabPage)
957 {
958 }
959 
961 {
962 }
963 
964 void TabPageUIObject::execute(const OUString& rAction,
965  const StringMap& /*rParameters*/)
966 {
967  if (rAction == "SELECT")
968  {
969  /* code */
970  }
971 }
972 
974 {
976 
977  return aMap;
978 }
979 
981 {
982  return "TabPageUIObject";
983 }
984 
986  WindowUIObject(xListBox),
987  mxListBox(xListBox)
988 {
989 }
990 
992 {
993 }
994 
995 void ListBoxUIObject::execute(const OUString& rAction,
996  const StringMap& rParameters)
997 {
999  return;
1000 
1001  if (rAction == "SELECT")
1002  {
1003  bool bSelect = true;
1004  if (rParameters.find("POS") != rParameters.end())
1005  {
1006  auto itr = rParameters.find("POS");
1007  OUString aVal = itr->second;
1008  sal_Int32 nPos = aVal.toInt32();
1009  mxListBox->SelectEntryPos(nPos, bSelect);
1010  }
1011  else if (rParameters.find("TEXT") != rParameters.end())
1012  {
1013  auto itr = rParameters.find("TEXT");
1014  OUString aText = itr->second;
1015  mxListBox->SelectEntry(aText, bSelect);
1016  }
1017  mxListBox->Select();
1018  }
1019  else
1020  WindowUIObject::execute(rAction, rParameters);
1021 }
1022 
1024 {
1026  aMap["ReadOnly"] = OUString::boolean(mxListBox->IsReadOnly());
1027  aMap["MultiSelect"] = OUString::boolean(mxListBox->IsMultiSelectionEnabled());
1028  aMap["EntryCount"] = OUString::number(mxListBox->GetEntryCount());
1029  aMap["SelectEntryCount"] = OUString::number(mxListBox->GetSelectedEntryCount());
1030  aMap["SelectEntryPos"] = OUString::number(mxListBox->GetSelectedEntryPos());
1031  aMap["SelectEntryText"] = mxListBox->GetSelectedEntry();
1032 
1033  return aMap;
1034 }
1035 
1037 {
1038  return "ListBoxUIObject";
1039 }
1040 
1042 {
1043  if (nEvent == VclEventId::ListboxSelect)
1044  {
1045  sal_Int32 nPos = mxListBox->GetSelectedEntryPos();
1046  if(get_top_parent(mxListBox)->get_id().isEmpty()){
1047  //This part because if we don't have parent
1048  return "Select element with position " + OUString::number(nPos) +
1049  " in '" + mxListBox->get_id();
1050  }
1051  return "Select element with position " + OUString::number(nPos) +
1052  " in '" + mxListBox->get_id() +"' from" + get_top_parent(mxListBox)->get_id() ;
1053  }
1054  else if (nEvent == VclEventId::ListboxFocus)
1055  {
1056  if(get_top_parent(mxListBox)->get_id().isEmpty())
1057  {
1058  //This part because if we don't have parent
1059  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id();
1060  }
1061  return this->get_type() + " Action:FOCUS Id:" + mxListBox->get_id() +
1062  " Parent:" + get_top_parent(mxListBox)->get_id();
1063  }
1064  else
1065  return WindowUIObject::get_action(nEvent);
1066 }
1067 
1068 std::unique_ptr<UIObject> ListBoxUIObject::create(vcl::Window* pWindow)
1069 {
1070  ListBox* pListBox = dynamic_cast<ListBox*>(pWindow);
1071  assert(pListBox);
1072  return std::unique_ptr<UIObject>(new ListBoxUIObject(pListBox));
1073 }
1074 
1076  WindowUIObject(xComboBox),
1077  mxComboBox(xComboBox)
1078 {
1079 }
1080 
1082 {
1083 }
1084 
1085 void ComboBoxUIObject::execute(const OUString& rAction,
1086  const StringMap& rParameters)
1087 {
1088  if (rAction == "SELECT")
1089  {
1090  if (rParameters.find("POS") != rParameters.end())
1091  {
1092  auto itr = rParameters.find("POS");
1093  OUString aVal = itr->second;
1094  sal_Int32 nPos = aVal.toInt32();
1095  mxComboBox->SelectEntryPos(nPos);
1096  }
1097  mxComboBox->Select();
1098  }
1099  else if (rAction == "TYPE")
1100  {
1101  if (mxComboBox->GetSubEdit())
1102  {
1103  Edit* pEdit = mxComboBox->GetSubEdit();
1104  std::unique_ptr<UIObject> pObj = EditUIObject::create(pEdit);
1105  pObj->execute(rAction, rParameters);
1106  }
1107  else
1108  WindowUIObject::execute(rAction, rParameters);
1109  }
1110  else
1111  WindowUIObject::execute(rAction, rParameters);
1112 }
1113 
1115 {
1117 
1118  return aMap;
1119 }
1120 
1122 {
1123  return "ComboBoxUIObject";
1124 }
1125 
1127 {
1128  if (nEvent == VclEventId::ComboboxSelect)
1129  {
1130  sal_Int32 nPos = mxComboBox->GetSelectedEntryPos();
1131  if (get_top_parent(mxComboBox)->get_id().isEmpty()){
1132  //This part because if we don't have parent
1133  return "Select in '" + mxComboBox->get_id() +
1134  "' ComboBox item number " + OUString::number(nPos);
1135  }
1136  return "Select in '" + mxComboBox->get_id() +
1137  "' ComboBox item number " + OUString::number(nPos) +
1138  " from " + get_top_parent(mxComboBox)->get_id();
1139  }
1140  else
1141  return WindowUIObject::get_action(nEvent);
1142 }
1143 
1144 std::unique_ptr<UIObject> ComboBoxUIObject::create(vcl::Window* pWindow)
1145 {
1146  ComboBox* pComboBox = dynamic_cast<ComboBox*>(pWindow);
1147  assert(pComboBox);
1148  return std::unique_ptr<UIObject>(new ComboBoxUIObject(pComboBox));
1149 }
1150 
1152  WindowUIObject(xSpinButton),
1153  mxSpinButton(xSpinButton)
1154 {
1155 }
1156 
1158 {
1159 }
1160 
1161 void SpinUIObject::execute(const OUString& rAction,
1162  const StringMap& /*rParameters*/)
1163 {
1164  if (rAction == "UP")
1165  {
1166  mxSpinButton->Up();
1167  }
1168  else if (rAction == "DOWN")
1169  {
1170  mxSpinButton->Down();
1171  }
1172 }
1173 
1175 {
1177  aMap["Min"] = OUString::number(mxSpinButton->GetRangeMin());
1178  aMap["Max"] = OUString::number(mxSpinButton->GetRangeMax());
1179  aMap["Step"] = OUString::number(mxSpinButton->GetValueStep());
1180  aMap["Value"] = OUString::number(mxSpinButton->GetValue());
1181 
1182  return aMap;
1183 }
1184 
1185 OUString SpinUIObject::get_action(VclEventId nEvent) const
1186 {
1187  if (nEvent == VclEventId::SpinbuttonUp)
1188  {
1189  return this->get_type() + " Action:UP Id:" + mxSpinButton->get_id() +
1190  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1191  }
1192  else if (nEvent == VclEventId::SpinbuttonDown)
1193  {
1194  return this->get_type() + " Action:DOWN Id:" + mxSpinButton->get_id() +
1195  " Parent:" + get_top_parent(mxSpinButton)->get_id();
1196  }
1197  else
1198  return WindowUIObject::get_action(nEvent);
1199 }
1200 
1201 OUString SpinUIObject::get_name() const
1202 {
1203  return "SpinUIObject";
1204 }
1205 
1207  EditUIObject(xSpinField),
1208  mxSpinField(xSpinField)
1209 {
1210 }
1211 
1213 {
1214 }
1215 
1216 void SpinFieldUIObject::execute(const OUString& rAction,
1217  const StringMap& rParameters)
1218 {
1219  if (rAction == "UP")
1220  {
1221  mxSpinField->Up();
1222  }
1223  else if (rAction == "DOWN")
1224  {
1225  mxSpinField->Down();
1226  }
1227  else if (rAction == "TYPE")
1228  {
1229  if (mxSpinField->GetSubEdit())
1230  {
1231  Edit* pSubEdit = mxSpinField->GetSubEdit();
1232  EditUIObject aSubObject(pSubEdit);
1233  aSubObject.execute(rAction, rParameters);
1234  }
1235  }
1236  else
1237  EditUIObject::execute(rAction, rParameters);
1238 }
1239 
1241 {
1243 
1244  return aMap;
1245 }
1246 
1248 {
1249  if (nEvent == VclEventId::SpinfieldUp)
1250  {
1251  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1252  {
1253  //This part because if we don't have parent
1254  return "Increase '" + mxSpinField->get_id();
1255  }
1256  return "Increase '" + mxSpinField->get_id() +
1257  "' from " + get_top_parent(mxSpinField)->get_id();
1258  }
1259  else if (nEvent == VclEventId::SpinfieldDown)
1260  {
1261  if(get_top_parent(mxSpinField)->get_id().isEmpty())
1262  {
1263  //This part because if we don't have parent
1264  return "Decrease '" + mxSpinField->get_id();
1265  }
1266  return "Decrease '" + mxSpinField->get_id() +
1267  "' from " + get_top_parent(mxSpinField)->get_id();
1268  }
1269  else
1270  return WindowUIObject::get_action(nEvent);
1271 }
1272 
1274 {
1275  return "SpinFieldUIObject";
1276 }
1277 
1278 std::unique_ptr<UIObject> SpinFieldUIObject::create(vcl::Window* pWindow)
1279 {
1280  SpinField* pSpinField = dynamic_cast<SpinField*>(pWindow);
1281  assert(pSpinField);
1282  return std::unique_ptr<UIObject>(new SpinFieldUIObject(pSpinField));
1283 }
1284 
1286  WindowUIObject(xTabControl),
1287  mxTabControl(xTabControl)
1288 {
1289 }
1290 
1292 {
1293 }
1294 
1295 void TabControlUIObject::execute(const OUString& rAction,
1296  const StringMap& rParameters)
1297 {
1298  if (rAction == "SELECT")
1299  {
1300  if (rParameters.find("POS") != rParameters.end())
1301  {
1302  auto itr = rParameters.find("POS");
1303  sal_uInt32 nPos = itr->second.toUInt32();
1304  std::vector<sal_uInt16> aIds = mxTabControl->GetPageIDs();
1305  mxTabControl->SelectTabPage(aIds[nPos]);
1306  }
1307  }
1308  else
1309  WindowUIObject::execute(rAction, rParameters);
1310 }
1311 
1313 {
1315  aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount());
1316 
1317  sal_uInt16 nPageId = mxTabControl->GetCurPageId();
1318  aMap["CurrPageId"] = OUString::number(nPageId);
1319  aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId));
1320 
1321  return aMap;
1322 }
1323 
1325 {
1326  if (nEvent == VclEventId::TabpageActivate)
1327  {
1328  sal_Int32 nPageId = mxTabControl->GetCurPageId();
1329 
1330  if(get_top_parent(mxTabControl)->get_id().isEmpty()){
1331  //This part because if we don't have parent
1332  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1333  " in '" + mxTabControl->get_id();
1334  }
1335  return "Choose Tab number " + OUString::number(mxTabControl->GetPagePos(nPageId)) +
1336  " in '" + mxTabControl->get_id()+
1337  "' from " + get_top_parent(mxTabControl)->get_id() ;
1338  }
1339  else
1340  return WindowUIObject::get_action(nEvent);
1341 }
1342 
1344 {
1345  return "TabControlUIObject";
1346 }
1347 
1348 std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow)
1349 {
1350  TabControl* pTabControl = dynamic_cast<TabControl*>(pWindow);
1351  assert(pTabControl);
1352  return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl));
1353 }
1354 
1355 
1356 
1357 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString GetDisplayText() const override
Definition: ctrl.cxx:218
virtual Point GetPosPixel() const
Definition: window.cxx:2806
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
long Width() const
#define KEY_F2
Definition: keycodes.hxx:84
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual ~MultiLineEditUIObject() override
VclPtr< VclMultiLineEdit > mxEdit
Definition: uiobject.hxx:203
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
#define KEY_BACKSPACE
Definition: keycodes.hxx:122
OUString GetSelectedEntry(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:1018
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
#define KEY_DELETE
Definition: keycodes.hxx:125
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual FactoryFunction GetUITestFactory() const
Definition: window.cxx:3766
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:1030
virtual OUString GetSelected() const
Definition: edit.cxx:2545
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.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
#define KEY_TAB
Definition: keycodes.hxx:121
#define KEY_PAGEDOWN
Definition: keycodes.hxx:117
VclPtr< SpinButton > mxSpinButton
Definition: uiobject.hxx:341
Edit * GetSubEdit() const
Definition: edit.hxx:238
#define KEY_F4
Definition: keycodes.hxx:86
long Height() const
#define KEY_PAGEUP
Definition: keycodes.hxx:116
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:78
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.
#define KEY_F1
Definition: keycodes.hxx:83
void SelectTabPage(sal_uInt16 nPageId)
Definition: tabctrl.cxx:1881
virtual OUString get_action(VclEventId nEvent) const
Gets the corresponding Action string for the event.
virtual OUString get_name() const override
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual void Select()
Definition: listbox.cxx:911
virtual std::set< OUString > get_children() const override
Returns a set containing all descendants of the object.
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual Size GetSizePixel() const
Definition: window.cxx:2364
#define KEY_0
Definition: keycodes.hxx:45
SAL_DLLPRIVATE void ImplCallClick(bool bGrabFocus=false, GetFocusFlags nFocusFlags=GetFocusFlags::NONE)
Definition: button.cxx:2239
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.
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual void Up()
Definition: spinfld.cxx:359
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.
long GetValueStep() const
virtual void Select()
Definition: combobox.cxx:486
long GetRangeMax() const
virtual ~DialogUIObject() override
#define KEY_LEFT
Definition: keycodes.hxx:112
virtual OUString get_name() const
#define KEY_F5
Definition: keycodes.hxx:87
#define KEY_F9
Definition: keycodes.hxx:91
std::vector< OUString > split(const OUString &rStr, sal_Unicode cSeparator)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
void SelectEntry(const OUString &rStr, bool bSelect=true)
Definition: listbox.cxx:1055
long GetValue() const
static UITestLogger & getInstance()
Definition: logger.cxx:537
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
const OUString & get_id() const
Get the ID of the window.
Definition: window.cxx:3761
sal_uInt16 nPageId
void setAppName(OUString name)
Definition: logger.hxx:74
sal_Int32 GetEntryCount() const
Definition: listbox.cxx:1011
FUNC_TYPE const nType
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.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
TextWindow * GetTextWindow()
Definition: vclmedit.cxx:1482
void Down()
Definition: spinbtn.cxx:88
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
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:199
bool IsChecked() const
Definition: button.hxx:346
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual void Click()
Definition: button.cxx:121
VclEventId
Definition: vclevent.hxx:41
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:170
virtual const Selection & GetSelection() const
Definition: edit.cxx:2518
#define KEY_A
Definition: keycodes.hxx:56
WindowUIObject(const VclPtr< vcl::Window > &xWindow)
virtual OUString get_name() const override
virtual OUString GetText() const
Definition: window.cxx:3051
WinBits const WB_SYSTEMFLOATWIN
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:58
virtual OUString get_name() const override
SpinFieldUIObject(const VclPtr< SpinField > &xEdit)
virtual void Down()
Definition: spinfld.cxx:364
bool IsReadOnly() const
Definition: listbox.cxx:1361
virtual OUString GetDisplayText() const
Definition: window.cxx:3057
virtual void SetSelection(const Selection &rSelection)
Definition: edit.cxx:2444
sal_uInt16 GetPageCount() const
Definition: tabctrl.cxx:1790
SAL_DLLPRIVATE void ImplCheck()
Definition: button.cxx:3109
VclPtr< Edit > mxEdit
Definition: uiobject.hxx:180
MultiLineEditUIObject(const VclPtr< VclMultiLineEdit > &xEdit)
DialogUIObject(const VclPtr< Dialog > &xDialog)
virtual OUString dumpHierarchy() const
Currently an internal method to dump the parent-child relationship starting from the current top focu...
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
virtual ~ButtonUIObject() override
long Min() const
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
bool IsTriStateEnabled() const
Definition: button.hxx:449
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: listbox.cxx:1060
virtual OUString get_type() const
Returns the type of the UIObject.
int i
#define KEY_ESCAPE
Definition: keycodes.hxx:120
ListBoxUIObject(const VclPtr< ListBox > &xListBox)
TabPageUIObject(const VclPtr< TabPage > &xTabPage)
VclPtr< Button > mxButton
Definition: uiobject.hxx:140
virtual OUString GetText() const override
Definition: edit.cxx:2614
#define KEY_F8
Definition: keycodes.hxx:90
virtual void Modify()
Definition: edit.cxx:2320
sal_Int32 GetSelectedEntryCount() const
Definition: listbox.cxx:1023
sal_Int32 GetSelectedEntryPos(sal_Int32 nSelIndex=0) const
Definition: combobox.cxx:1380
bool IsChecked() const
Definition: button.hxx:474
CheckBoxUIObject(const VclPtr< CheckBox > &xCheckbox)
std::map< const OUString, OUString > StringMap
Definition: uiobject.hxx:31
virtual OUString get_name() const override
virtual sal_Int32 GetMaxTextLen() const override
Definition: vclmedit.cxx:1071
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:1086
void Up()
Definition: spinbtn.cxx:75
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.
void RequestDoubleBuffering(bool bRequest)
Enable/disable double-buffering of the frame window and all its children.
Definition: window.cxx:3697
virtual OUString get_name() const override
DocumentType const eType
void GrabFocus()
Definition: window.cxx:2980
static void append(std::bitset< N > &rSet, size_t const nOffset, sal_uInt32 const nValue)
Definition: sft.cxx:2611
virtual void KeyInput(const KeyEvent &rKEvt) override
Definition: edit.cxx:1702
vcl::Window * GetParent() const
Definition: window2.cxx:1091
long X() const
#define KEY_END
Definition: keycodes.hxx:115
#define KEY_F12
Definition: keycodes.hxx:94
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:1802
virtual OUString dumpState() const
Currently an internal method to dump the state of the current UIObject as represented by get_state()...
virtual ~SpinFieldUIObject() override
#define KEY_F7
Definition: keycodes.hxx:89
std::vector< sal_uInt16 > GetPageIDs() const
Definition: tabctrl.cxx:2198
virtual OUString get_action(VclEventId nEvent) const override
Gets the corresponding Action string for the event.
virtual void KeyInput(const KeyEvent &rKEvt)
Definition: window.cxx:1767
#define KEY_RETURN
Definition: keycodes.hxx:119
long GetRangeMin() const
sal_uInt16 GetChildCount() const
Definition: stacking.cxx:1001
VclPtr< ComboBox > mxComboBox
Definition: uiobject.hxx:317
virtual OUString get_name() const override
#define KEY_DOWN
Definition: keycodes.hxx:110
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:162
#define SAL_WARN_IF(condition, area, stream)
#define KEY_F10
Definition: keycodes.hxx:92
VclPtr< CheckBox > mxCheckBox
Definition: uiobject.hxx:226
VclPtr< TabControl > mxTabControl
Definition: uiobject.hxx:388
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
bool IsVisible() const
Definition: window2.cxx:1096
VclPtr< RadioButton > mxRadioButton
Definition: uiobject.hxx:249
ComboBoxUIObject(const VclPtr< ComboBox > &xListBox)
VclPtr< ListBox > mxListBox
Definition: uiobject.hxx:292
virtual ~CheckBoxUIObject() override
virtual OUString get_type() const override
Returns the type of the UIObject.
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
SpinUIObject(const VclPtr< SpinButton > &xSpinButton)
VclPtr< vcl::Window > mxWindow
Definition: uiobject.hxx:106
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
TabControlUIObject(const VclPtr< TabControl > &mxTabControl)
bool IsMultiSelectionEnabled() const
Definition: listbox.cxx:1152
#define KEY_F6
Definition: keycodes.hxx:88
VclPtr< SpinField > mxSpinField
Definition: uiobject.hxx:364
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:34
WindowType GetType() const
Definition: window2.cxx:968
#define KEY_HOME
Definition: keycodes.hxx:114
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
OUString GetText() const override
Definition: vclmedit.cxx:1116
bool IsEnabled() const
Definition: window2.cxx:1116
#define KEY_INSERT
Definition: keycodes.hxx:124
#define SAL_WARN(area, stream)
WinBits GetStyle() const
Definition: window2.cxx:947
virtual void execute(const OUString &rAction, const StringMap &rParameters) override
Executes an action on the wrapped UI object, possibly with some additional parameters.
virtual ~UIObject()
virtual StringMap get_state() override
Returns the state of the wrapped UI object as a string key value map.
long Max() const
void SelectEntryPos(sal_Int32 nPos, bool bSelect=true)
Definition: combobox.cxx:1398
virtual void SetText(const OUString &rStr) override
Definition: edit.cxx:2595
bool IsReallyVisible() const
Definition: window2.cxx:1101
virtual ~TabPageUIObject() 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)
sal_Int32 nPos
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:3692
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.
#define KEY_RIGHT
Definition: keycodes.hxx:113
#define KEY_F11
Definition: keycodes.hxx:93
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:1144
long Y() const
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1873
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
vcl::Window * GetChild(sal_uInt16 nChild) const
Definition: stacking.cxx:1017
#define KEY_UP
Definition: keycodes.hxx:111
#define KEY_F3
Definition: keycodes.hxx:85
virtual ~ListBoxUIObject() override