LibreOffice Module vcl (master)  1
weldutils.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 <com/sun/star/util/URLTransformer.hpp>
11 #include <com/sun/star/frame/Desktop.hpp>
13 #include <svl/numformat.hxx>
14 #include <svl/zforlist.hxx>
15 #include <svl/zformat.hxx>
16 #include <vcl/builderpage.hxx>
17 #include <vcl/commandevent.hxx>
19 #include <vcl/event.hxx>
20 #include <vcl/toolkit/floatwin.hxx>
21 #include <vcl/settings.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/weldutils.hxx>
24 
26  const OUString& rUIXMLDescription, const OString& rID, bool bIsMobile)
27  : m_pDialogController(pController)
28  , m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription, bIsMobile))
29  , m_xContainer(m_xBuilder->weld_container(rID))
30 {
31 }
32 
34 
36 
37 BuilderPage::~BuilderPage() COVERITY_NOEXCEPT_FALSE {}
38 
39 namespace weld
40 {
41 bool DialogController::runAsync(const std::shared_ptr<DialogController>& rController,
42  const std::function<void(sal_Int32)>& func)
43 {
44  return rController->getDialog()->runAsync(rController, func);
45 }
46 
47 DialogController::~DialogController() COVERITY_NOEXCEPT_FALSE {}
48 
50 
52  const OString& rDialogId, bool bMobile)
53  : m_xBuilder(Application::CreateBuilder(pParent, rUIFile, bMobile))
54  , m_xDialog(m_xBuilder->weld_dialog(rDialogId))
55 {
56 }
57 
59 
61 
63  const OString& rDialogId,
64  const OString& rRelocateId)
65  : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
66  , m_xDialog(m_xBuilder->weld_message_dialog(rDialogId))
67  , m_xContentArea(m_xDialog->weld_message_area())
68 {
69  if (!rRelocateId.isEmpty())
70  {
71  m_xRelocate = m_xBuilder->weld_container(rRelocateId);
72  m_xOrigParent = m_xRelocate->weld_parent();
73  //fdo#75121, a bit tricky because the widgets we want to align with
74  //don't actually exist in the ui description, they're implied
75  m_xOrigParent->move(m_xRelocate.get(), m_xContentArea.get());
76  }
77 }
78 
80 {
81  if (m_xRelocate)
82  {
83  m_xContentArea->move(m_xRelocate.get(), m_xOrigParent.get());
84  }
85 }
86 
87 AssistantController::AssistantController(weld::Widget* pParent, const OUString& rUIFile,
88  const OString& rDialogId)
89  : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
90  , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
91 {
92 }
93 
95 
97 
99 {
100  if (bTriStateEnabled)
101  {
102  switch (eState)
103  {
104  case TRISTATE_INDET:
105  rToggle.set_state(TRISTATE_FALSE);
106  break;
107  case TRISTATE_TRUE:
108  rToggle.set_state(TRISTATE_INDET);
109  break;
110  case TRISTATE_FALSE:
111  rToggle.set_state(TRISTATE_TRUE);
112  break;
113  }
114  }
115  eState = rToggle.get_state();
116 }
117 
119 {
120  if (rTreeView.iter_has_child(rParent))
121  {
122  std::unique_ptr<weld::TreeIter> xNewParent(rTreeView.make_iterator(&rParent));
123  if (!rTreeView.iter_parent(*xNewParent))
124  xNewParent.reset();
125 
126  while (true)
127  {
128  std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator(&rParent));
129  if (!rTreeView.iter_children(*xChild))
130  break;
131  rTreeView.move_subtree(*xChild, xNewParent.get(), -1);
132  }
133  }
134  rTreeView.remove(rParent);
135 }
136 
138  : m_rEntry(rSpinButton)
139  , m_pSpinButton(&rSpinButton)
140  , m_eOptions(Application::GetSettings().GetStyleSettings().GetSelectionOptions())
141 {
142  Init();
143 }
144 
146  : m_rEntry(rEntry)
147  , m_pSpinButton(nullptr)
148  , m_eOptions(Application::GetSettings().GetStyleSettings().GetSelectionOptions())
149 {
150  Init();
151 }
152 
154 {
157  if (m_pSpinButton)
158  m_pSpinButton->SetFormatter(nullptr);
159 }
160 
162 {
163  m_rEntry.connect_changed(LINK(this, EntryFormatter, ModifyHdl));
164  m_rEntry.connect_focus_out(LINK(this, EntryFormatter, FocusOutHdl));
165  if (m_pSpinButton)
167 }
168 
170 {
171  int nStartPos, nEndPos;
172  m_rEntry.get_selection_bounds(nStartPos, nEndPos);
173  return Selection(nStartPos, nEndPos);
174 }
175 
176 OUString EntryFormatter::GetEntryText() const { return m_rEntry.get_text(); }
177 
178 void EntryFormatter::SetEntryText(const OUString& rText, const Selection& rSel)
179 {
180  m_rEntry.set_text(rText);
181  auto nMin = rSel.Min();
182  auto nMax = rSel.Max();
183  m_rEntry.select_region(nMin < 0 ? 0 : nMin, nMax == SELECTION_MAX ? -1 : nMax);
184 }
185 
187 {
188  m_rEntry.set_font_color(pColor ? *pColor : COL_AUTO);
189 }
190 
191 void EntryFormatter::UpdateCurrentValue(double dCurrentValue)
192 {
193  Formatter::UpdateCurrentValue(dCurrentValue);
194  if (m_pSpinButton)
196 }
197 
199 {
201  if (m_pSpinButton)
203 }
204 
206 {
208  if (m_pSpinButton)
210 }
211 
213 {
215  if (m_pSpinButton)
217 }
218 
220 {
222  if (m_pSpinButton)
224 }
225 
226 void EntryFormatter::SetSpinSize(double dStep)
227 {
228  Formatter::SetSpinSize(dStep);
229  if (m_pSpinButton)
231 }
232 
234 
236 
238 {
239  // This leads to FieldModified getting called at the end of Modify() and
240  // FieldModified then calls any modification callback
241  Modify();
242 }
243 
245 {
246  EntryLostFocus();
247  m_aFocusOutHdl.Call(m_rEntry);
248 }
249 
251  : EntryFormatter(rEntry)
252 {
254 }
255 
257  : EntryFormatter(rSpinButton)
258 {
260 }
261 
263 
265 {
268 }
269 
270 bool DoubleNumericFormatter::CheckText(const OUString& sText) const
271 {
272  // We'd like to implement this using the NumberFormatter::IsNumberFormat, but unfortunately, this doesn't
273  // recognize fragments of numbers (like, for instance "1e", which happens during entering e.g. "1e10")
274  // Thus, the roundabout way via a regular expression
275  return m_pNumberValidator->isValidNumericFragment(sText);
276 }
277 
279 {
280  // the thousands and the decimal separator are language dependent
281  const SvNumberformat* pFormatEntry = GetOrCreateFormatter()->GetEntry(m_nFormatKey);
282 
283  sal_Unicode cSeparatorThousand = ',';
284  sal_Unicode cSeparatorDecimal = '.';
285  if (pFormatEntry)
286  {
287  LocaleDataWrapper aLocaleInfo(LanguageTag(pFormatEntry->GetLanguage()));
288 
289  OUString sSeparator = aLocaleInfo.getNumThousandSep();
290  if (!sSeparator.isEmpty())
291  cSeparatorThousand = sSeparator[0];
292 
293  sSeparator = aLocaleInfo.getNumDecimalSep();
294  if (!sSeparator.isEmpty())
295  cSeparatorDecimal = sSeparator[0];
296  }
297 
298  m_pNumberValidator.reset(
299  new validation::NumberValidator(cSeparatorThousand, cSeparatorDecimal));
300 }
301 
303  : EntryFormatter(rEntry)
304  , m_bThousandSep(true)
305 {
306  Init();
307 }
308 
310  : EntryFormatter(rSpinButton)
311  , m_bThousandSep(true)
312 {
313  Init();
314 }
315 
317 {
318  SetOutputHdl(LINK(this, LongCurrencyFormatter, FormatOutputHdl));
319  SetInputHdl(LINK(this, LongCurrencyFormatter, ParseInputHdl));
320 }
321 
323 {
324  m_bThousandSep = b;
325  ReFormat();
326 }
327 
329 {
330  m_aCurrencySymbol = rStr;
331  ReFormat();
332 }
333 
335 
337  : EntryFormatter(rEntry)
338  , m_eFormat(TimeFieldFormat::F_NONE)
339  , m_eTimeFormat(TimeFormat::Hour24)
340  , m_bDuration(false)
341 {
342  Init();
343 }
344 
346  : EntryFormatter(rSpinButton)
347  , m_eFormat(TimeFieldFormat::F_NONE)
348  , m_eTimeFormat(TimeFormat::Hour24)
349  , m_bDuration(false)
350 {
351  Init();
352 }
353 
355 {
356  DisableRemainderFactor(); //so with hh::mm::ss, incrementing mm will not reset ss
357 
358  SetOutputHdl(LINK(this, TimeFormatter, FormatOutputHdl));
359  SetInputHdl(LINK(this, TimeFormatter, ParseInputHdl));
360 
361  SetMin(tools::Time(0, 0));
362  SetMax(tools::Time(23, 59, 59, 999999999));
363 
364  // so the spin size can depend on which zone the cursor is in
365  get_widget().connect_cursor_position(LINK(this, TimeFormatter, CursorChangedHdl));
366  // and set the initial spin size
367  CursorChangedHdl(get_widget());
368 }
369 
371 {
372  switch (eFormat)
373  {
375  {
377  m_bDuration = false;
379  }
380  break;
382  {
384  m_bDuration = false;
386  }
387  break;
389  {
391  m_bDuration = false;
393  }
394  break;
396  {
398  m_bDuration = false;
400  }
401  break;
403  {
404  m_bDuration = true;
406  }
407  break;
409  {
410  m_bDuration = true;
412  }
413  break;
414  }
415 
416  ReFormat();
417 }
418 
419 void TimeFormatter::SetDuration(bool bDuration)
420 {
421  m_bDuration = bDuration;
422  ReFormat();
423 }
424 
426 {
427  m_eFormat = eTimeFormat;
428  ReFormat();
429 }
430 
432 
434  : EntryFormatter(rEntry)
435  , m_eFormat(ExtDateFieldFormat::SystemShort)
436 {
437  Init();
438 }
439 
441 {
442  SetOutputHdl(LINK(this, DateFormatter, FormatOutputHdl));
443  SetInputHdl(LINK(this, DateFormatter, ParseInputHdl));
444 
445  SetMin(Date(1, 1, 1900));
446  SetMax(Date(31, 12, 2200));
447 }
448 
450 {
451  m_eFormat = eFormat;
452  ReFormat();
453 }
454 
456 
458  : m_rEntry(rEntry)
459  , m_bStrictFormat(false)
460  , m_bSameMask(true)
461  , m_bReformat(false)
462  , m_bInPattKeyInput(false)
463 {
464  m_rEntry.connect_changed(LINK(this, PatternFormatter, ModifyHdl));
465  m_rEntry.connect_focus_in(LINK(this, PatternFormatter, FocusInHdl));
466  m_rEntry.connect_focus_out(LINK(this, PatternFormatter, FocusOutHdl));
467  m_rEntry.connect_key_press(LINK(this, PatternFormatter, KeyInputHdl));
468 }
469 
471 
473 {
474  EntryLostFocus();
475  m_aFocusOutHdl.Call(m_rEntry);
476 }
477 
479 {
480  EntryGainFocus();
481  m_aFocusInHdl.Call(m_rEntry);
482 }
483 
485 {
488 }
489 
491 {
492  // load this little .ui just to measure the height of an Entry
493  std::unique_ptr<weld::Builder> xBuilder(
494  Application::CreateBuilder(nullptr, "cui/ui/namedialog.ui"));
495  std::unique_ptr<weld::Entry> xEntry(xBuilder->weld_entry("name_entry"));
496  return xEntry->get_preferred_size().Height();
497 }
498 
500  : mWidget(widget)
501 {
502  css::uno::Reference<css::uno::XComponentContext> xContext
503  = ::comphelper::getProcessComponentContext();
504  css::uno::Reference<css::frame::XDesktop2> xDesktop = css::frame::Desktop::create(xContext);
505 
506  css::uno::Reference<css::frame::XFrame> xFrame(xDesktop->getActiveFrame());
507  if (!xFrame.is())
508  xFrame = xDesktop;
509 
510  mxFrame = xFrame;
511 
512  maCommandURL.Complete = aCommand;
513  css::uno::Reference<css::util::XURLTransformer> xParser
514  = css::util::URLTransformer::create(xContext);
515  xParser->parseStrict(maCommandURL);
516 }
517 
519 {
520  if (mxDispatch.is())
521  mxDispatch->removeStatusListener(this, maCommandURL);
522 
523  css::uno::Reference<css::frame::XDispatchProvider> xDispatchProvider(mxFrame,
524  css::uno::UNO_QUERY);
525  if (!xDispatchProvider.is())
526  return;
527 
528  mxDispatch = xDispatchProvider->queryDispatch(maCommandURL, "", 0);
529  if (mxDispatch.is())
530  mxDispatch->addStatusListener(this, maCommandURL);
531 }
532 
533 void WidgetStatusListener::statusChanged(const css::frame::FeatureStateEvent& rEvent)
534 {
535  mWidget->set_sensitive(rEvent.IsEnabled);
536 }
537 
538 void WidgetStatusListener::disposing(const css::lang::EventObject& /*Source*/)
539 {
540  mxDispatch.clear();
541 }
542 
544 {
545  if (mxDispatch.is())
546  {
547  mxDispatch->removeStatusListener(this, maCommandURL);
548  mxDispatch.clear();
549  }
550  mxFrame.clear();
551  mWidget = nullptr;
552 }
553 
555  const Link<const CommandEvent&, void>& rContextLink)
556  : m_rButton(rButton)
557  , m_aRepeat("vcl ButtonPressRepeater m_aRepeat")
558  , m_aLink(rLink)
559  , m_aContextLink(rContextLink)
560  , m_bModKey(false)
561 {
562  // instead of connect_clicked because we want a button held down to
563  // repeat the next/prev
564  m_rButton.connect_mouse_press(LINK(this, ButtonPressRepeater, MousePressHdl));
565  m_rButton.connect_mouse_release(LINK(this, ButtonPressRepeater, MouseReleaseHdl));
566 
567  m_aRepeat.SetInvokeHandler(LINK(this, ButtonPressRepeater, RepeatTimerHdl));
568 }
569 
570 IMPL_LINK(ButtonPressRepeater, MousePressHdl, const MouseEvent&, rMouseEvent, bool)
571 {
572  if (rMouseEvent.IsRight())
573  {
574  m_aContextLink.Call(
575  CommandEvent(rMouseEvent.GetPosPixel(), CommandEventId::ContextMenu, true));
576  return false;
577  }
578  m_bModKey = rMouseEvent.IsMod1();
579  if (!m_rButton.get_sensitive())
580  return false;
581  auto self = weak_from_this();
582  RepeatTimerHdl(nullptr);
583  if (!self.lock())
584  return false;
585  if (!m_rButton.get_sensitive())
586  return false;
588  m_aRepeat.Start();
589  return true;
590 }
591 
592 IMPL_LINK_NOARG(ButtonPressRepeater, MouseReleaseHdl, const MouseEvent&, bool)
593 {
594  m_bModKey = false;
595  m_aRepeat.Stop();
596  return true;
597 }
598 
599 IMPL_LINK_NOARG(ButtonPressRepeater, RepeatTimerHdl, Timer*, void)
600 {
601  m_aRepeat.SetTimeout(Application::GetSettings().GetMouseSettings().GetButtonRepeat());
602  m_aLink.Call(m_rButton);
603 }
604 
606 {
607  rRect.SetPos(rOutWin.OutputToScreenPixel(rRect.TopLeft()));
608  rRect = FloatingWindow::ImplConvertToAbsPos(&rOutWin, rRect);
609 
610  vcl::Window* pWin = rOutWin.GetFrameWindow();
611 
612  rRect = FloatingWindow::ImplConvertToRelPos(pWin, rRect);
613  rRect.SetPos(pWin->ScreenToOutputPixel(rRect.TopLeft()));
614 
615  return rOutWin.GetFrameWeld();
616 }
617 
618 void SetPointFont(OutputDevice& rDevice, const vcl::Font& rFont)
619 {
620  auto pDefaultDevice = Application::GetDefaultDevice();
621  if (pDefaultDevice)
622  if (vcl::Window* pDefaultWindow = pDefaultDevice->GetOwnerWindow())
623  pDefaultWindow->SetPointFont(rDevice, rFont);
624 }
625 }
626 
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long Max() const
PatternFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:457
std::shared_ptr< weld::Dialog > m_xDialog
Definition: weld.hxx:2515
void SetPos(const Point &rPoint)
TimeFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:336
virtual void connect_changed(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1667
virtual void connect_focus_out(const Link< Widget &, void > &rLink)
Definition: weld.hxx:227
virtual void SetMinValue(double dMin) override
Definition: weldutils.cxx:205
LongCurrencyFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:302
void set_state(TriState eState)
Definition: weld.hxx:1458
void SetDuration(bool bDuration)
Definition: weldutils.cxx:419
ExtTimeFieldFormat
Definition: vclenum.hxx:146
void SetCurrencySymbol(const OUString &rStr)
Definition: weldutils.cxx:328
AutoTimer m_aRepeat
TimeFieldFormat
Definition: vclenum.hxx:28
virtual bool iter_parent(TreeIter &rIter) const =0
void SetInputHdl(const Link< sal_Int64 *, TriState > &rLink)
Definition: formatter.hxx:238
virtual Dialog * getDialog() override
Definition: weldutils.cxx:94
virtual void SetEntryText(const OUString &rText, const Selection &rSel) override
Definition: weldutils.cxx:178
virtual SelectionOptions GetEntrySelectionOptions() const override
Definition: weldutils.cxx:233
SelectionOptions
Definition: settings.hxx:178
virtual void ClearMaxValue()
Definition: formatter.hxx:168
Reference< XFrame > xFrame
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:733
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
FORMAT_CHANGE_TYPE
Definition: formatter.hxx:76
void SetTimeFormat(TimeFieldFormat eTimeFormat)
Definition: weldutils.cxx:425
Link< weld::Entry &, void > m_aModifyHdl
Definition: weldutils.hxx:241
virtual ~TimeFormatter() override
Definition: field2.cxx:2688
the first 4 of these are only used by base/dbaccess
void SAL_CALL disposing(const css::lang::EventObject &) override
Definition: weldutils.cxx:538
std::unique_ptr< weld::Builder > m_xBuilder
Definition: weld.hxx:2527
std::unique_ptr< weld::Widget > m_xRelocate
Definition: weld.hxx:2530
virtual ~MessageDialogController() override
Definition: weldutils.cxx:79
void SetExtFormat(ExtTimeFieldFormat eFormat)
Definition: weldutils.cxx:370
void DisableRemainderFactor()
Definition: fmtfield.cxx:870
TimeFormat m_eTimeFormat
Definition: weldutils.hxx:321
virtual Dialog * getDialog() override
Definition: weldutils.cxx:49
virtual void set_text(const OUString &rText)=0
TRISTATE_TRUE
virtual void SetMinValue(double dMin)
Definition: fmtfield.cxx:703
void ReFormat()
Definition: fmtfield.cxx:687
virtual ~BuilderPage() COVERITY_NOEXCEPT_FALSE
Definition: weldutils.cxx:37
virtual void sync_increments_from_formatter()=0
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const =0
virtual void ClearMinValue() override
Definition: weldutils.cxx:198
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1069
std::unique_ptr< weld::Container > m_xOrigParent
Definition: weld.hxx:2531
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
Definition: weldutils.cxx:41
weld::Window * GetFrameWeld() const
Definition: window2.cxx:842
sal_uInt16 sal_Unicode
Reference< XNameAccess > m_xContainer
ButtonPressRepeater(weld::Button &rButton, const Link< Button &, void > &rLink, const Link< const CommandEvent &, void > &rContextLink=Link< const CommandEvent &, void >())
Definition: weldutils.cxx:554
virtual ~DateFormatter() override
Definition: field2.cxx:1727
static tools::Rectangle ImplConvertToRelPos(vcl::Window *pReference, const tools::Rectangle &rRect)
Definition: floatwin.cxx:526
virtual void ClearMaxValue() override
Definition: weldutils.cxx:212
TimeFormat
Definition: vclenum.hxx:141
vcl::Window * GetFrameWindow() const
Definition: window2.cxx:848
virtual void SetMaxValue(double dMin) override
Definition: weldutils.cxx:219
IMPL_LINK(CustomWeld, DoResize, const Size &, rSize, void)
Definition: customweld.cxx:46
virtual void UpdateCurrentValue(double dCurrentValue)
Definition: formatter.hxx:313
css::uno::Reference< css::frame::XDispatch > mxDispatch
The widget on which actions are performed.
Definition: weldutils.hxx:183
virtual void connect_mouse_release(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:272
void RemoveParentKeepChildren(weld::TreeView &rTreeView, const weld::TreeIter &rParent)
Definition: weldutils.cxx:118
virtual bool CheckText(const OUString &sText) const override
Definition: weldutils.cxx:270
void ButtonToggled(Toggleable &rToggle)
Definition: weldutils.cxx:98
void SetOutputHdl(const Link< LinkParamNone *, bool > &rLink)
Definition: formatter.hxx:239
css::util::URL maCommandURL
Definition: weldutils.hxx:184
virtual void Deactivate()
Definition: weldutils.cxx:35
ExtDateFieldFormat m_eFormat
Definition: weldutils.hxx:351
TRISTATE_INDET
weld::Entry & m_rEntry
Definition: weldutils.hxx:239
AssistantController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId)
Definition: weldutils.cxx:87
const OUString & getNumDecimalSep() const
virtual bool get_selection_bounds(int &rStartPos, int &rEndPos)=0
virtual ~DialogController() COVERITY_NOEXCEPT_FALSE
Definition: weldutils.cxx:47
virtual void ClearMinValue()
Definition: formatter.hxx:163
virtual ~GenericDialogController() COVERITY_NOEXCEPT_FALSE override
Definition: weldutils.cxx:58
virtual OUString GetEntryText() const override
Definition: weldutils.cxx:176
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat) override
Definition: weldutils.cxx:264
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
Definition: weldutils.cxx:605
virtual void connect_cursor_position(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1671
virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat)
Definition: fmtfield.cxx:628
TRISTATE_FALSE
virtual bool iter_has_child(const TreeIter &rIter) const =0
static Point ImplConvertToAbsPos(vcl::Window *pReference, const Point &rPos)
Definition: floatwin.cxx:481
std::unique_ptr< weld::Container > m_xContentArea
Definition: weld.hxx:2529
virtual void select_region(int nStartPos, int nEndPos)=0
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
virtual ~DoubleNumericFormatter() override
TimeFieldFormat m_eFormat
Definition: weldutils.hxx:320
weld::Entry & get_widget()
Definition: weldutils.hxx:205
virtual void connect_focus_in(const Link< Widget &, void > &rLink)
Definition: weld.hxx:221
virtual Selection GetEntrySelection() const override
Definition: weldutils.cxx:169
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:233
virtual void SetMaxValue(double dMax)
Definition: fmtfield.cxx:713
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2809
void SetUseThousandSep(bool b)
Definition: weldutils.cxx:322
virtual void connect_key_press(const Link< const KeyEvent &, bool > &rLink)
Definition: weld.hxx:248
virtual OUString get_text() const =0
WidgetStatusListener(weld::Widget *widget, const OUString &rCommand)
Definition: weldutils.cxx:499
constexpr Point TopLeft() const
void SetMax(const Date &rNewMax)
Definition: field2.cxx:1770
virtual void Activate()
Definition: weldutils.cxx:33
void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: weldutils.cxx:533
virtual bool iter_children(TreeIter &rIter) const =0
virtual void remove(int pos)=0
virtual void UpdateCurrentValue(double dCurrentValue) override
Definition: weldutils.cxx:191
ExtDateFieldFormat
Definition: vclenum.hxx:154
EntryFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:145
void SetMin(const Date &rNewMin)
Definition: field2.cxx:1763
virtual Dialog * getDialog() override
Definition: weldutils.cxx:60
IMPL_LINK_NOARG(HexColorControl, OnAsyncModifyHdl, void *, void)
void Stop()
Definition: scheduler.cxx:590
TriState get_state() const
Definition: weld.hxx:1449
virtual ~EntryFormatter() override
Definition: weldutils.cxx:153
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
void SetExtDateFormat(ExtDateFieldFormat eFormat)
Definition: weldutils.cxx:449
std::unique_ptr< validation::NumberValidator > m_pNumberValidator
Definition: weldutils.hxx:266
tools::Long Min() const
virtual void connect_mouse_press(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:260
virtual ~AssistantController() override
Definition: weldutils.cxx:96
virtual void FieldModified() override
Definition: weldutils.cxx:235
void SetPointFont(OutputDevice &rDevice, const vcl::Font &rFont)
Definition: weldutils.cxx:618
Reference< XExecutableDialog > m_xDialog
virtual void sync_value_from_formatter()=0
weld::Button & m_rButton
Definition: weldutils.hxx:403
css::uno::Reference< css::frame::XFrame > mxFrame
Definition: weldutils.hxx:185
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
DateFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:433
virtual void SetEntryTextColor(const Color *pColor) override
Definition: weldutils.cxx:186
const OUString & getNumThousandSep() const
virtual ~LongCurrencyFormatter() override
Definition: longcurr.cxx:287
SvNumberFormatter * GetOrCreateFormatter() const
Definition: formatter.hxx:194
#define SELECTION_MAX
virtual void sync_range_from_formatter()=0
weld::Entry & m_rEntry
Definition: weldutils.hxx:379
Definition: timer.hxx:26
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2803
SelectionOptions m_eOptions
Definition: weldutils.hxx:243
virtual void SetFormatter(weld::EntryFormatter *pFormatter)=0
void SetMax(const tools::Time &rNewMax)
Definition: field2.cxx:2704
std::unique_ptr< weld::Assistant > m_xAssistant
Definition: weld.hxx:2557
std::shared_ptr< osl::Mutex > const & lock()
std::unique_ptr< weld::MessageDialog > m_xDialog
Definition: weld.hxx:2528
int GetMinimumEditHeight()
Definition: weldutils.cxx:490
sal_uLong m_nFormatKey
Definition: formatter.hxx:125
LanguageType GetLanguage() const
virtual void move_subtree(TreeIter &rNode, const TreeIter *pNewParent, int nIndexInNewParent)=0
virtual void set_sensitive(bool sensitive)=0
virtual void set_font_color(const Color &rColor)=0
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
Definition: builder.cxx:181
virtual void SetSpinSize(double dStep)
Definition: formatter.hxx:226
DoubleNumericFormatter(weld::Entry &rEntry)
Definition: weldutils.cxx:250
static sal_Int32 GetButtonStartRepeat()
GenericDialogController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId, bool bMobile=false)
Definition: weldutils.cxx:51
MessageDialogController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId, const OString &rRelocateId=OString())
Definition: weldutils.cxx:62
BuilderPage(weld::Widget *pParent, weld::DialogController *pController, const OUString &rUIXMLDescription, const OString &rID, bool bIsMobile=false)
Definition: weldutils.cxx:25
void SetMin(const tools::Time &rNewMin)
Definition: field2.cxx:2697
virtual void SetSpinSize(double dStep) override
Definition: weldutils.cxx:226
weld::FormattedSpinButton * m_pSpinButton
Definition: weldutils.hxx:240