LibreOffice Module vcl (master) 1
jsdialogbuilder.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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#pragma once
11
12#include <comphelper/string.hxx>
13#include <osl/mutex.hxx>
14#include <utility>
15#include <vcl/weld.hxx>
17#include <vcl/sysdata.hxx>
18#include <vcl/virdev.hxx>
19#include <vcl/builder.hxx>
20#include <salvtables.hxx>
23
24#include <com/sun/star/lang/XInitialization.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
28
29#include <deque>
30#include <list>
31#include <mutex>
32
33#define ACTION_TYPE "action_type"
34#define PARENT_ID "parent_id"
35#define WINDOW_ID "id"
36#define CLOSE_ID "close_id"
37
38class ToolBox;
39class ComboBox;
41class SvTabListBox;
42class IconView;
44
45namespace vcl
46{
47class ILibreOfficeKitNotifier;
48}
49
50typedef std::map<OUString, weld::Widget*> WidgetMap;
51
52namespace jsdialog
53{
55{
62};
63}
64
67{
68public:
71 std::unique_ptr<jsdialog::ActionDataMap> m_pData;
72
73private:
74 void copy(const JSDialogMessageInfo& rInfo)
75 {
76 this->m_eType = rInfo.m_eType;
77 this->m_pWindow = rInfo.m_pWindow;
78 if (rInfo.m_pData)
79 {
80 std::unique_ptr<jsdialog::ActionDataMap> pData(
82 this->m_pData = std::move(pData);
83 }
84 }
85
86public:
88 std::unique_ptr<jsdialog::ActionDataMap> pData)
89 : m_eType(eType)
90 , m_pWindow(std::move(pWindow))
91 , m_pData(std::move(pData))
92 {
93 }
94
96
98 {
99 if (this == &aInfo)
100 return *this;
101
102 copy(aInfo);
103 return *this;
104 }
105};
106
107class JSDialogNotifyIdle final : public Idle
108{
109 // used to send message
111 // used to generate JSON
116
117 std::deque<JSDialogMessageInfo> m_aMessageQueue;
118 std::mutex m_aQueueMutex;
119
120public:
122 const OUString& sTypeOfJSON);
123
124 void Invoke() override;
125
129 std::unique_ptr<jsdialog::ActionDataMap> pData = nullptr);
130
131private:
132 void send(tools::JsonWriter& aJsonWriter);
133 std::unique_ptr<tools::JsonWriter> generateFullUpdate() const;
134 std::unique_ptr<tools::JsonWriter> generateWidgetUpdate(VclPtr<vcl::Window> pWindow) const;
135 std::unique_ptr<tools::JsonWriter> generateCloseMessage() const;
136 std::unique_ptr<tools::JsonWriter>
138 std::unique_ptr<jsdialog::ActionDataMap> pData) const;
139 std::unique_ptr<tools::JsonWriter>
140 generatePopupMessage(VclPtr<vcl::Window> pWindow, OUString sParentId, OUString sCloseId) const;
141 std::unique_ptr<tools::JsonWriter> generateClosePopupMessage(OUString sWindowId) const;
142};
143
145{
146 std::unique_ptr<JSDialogNotifyIdle> mpIdleNotify;
147
148protected:
149 bool m_bCanClose; // specifies if can send a close message
150
151public:
153 : m_bCanClose(true)
154 {
155 }
157 const OUString& sTypeOfJSON)
158 : m_bCanClose(true)
159 {
160 initializeSender(aNotifierWindow, aContentWindow, sTypeOfJSON);
161 }
162
163 virtual ~JSDialogSender() COVERITY_NOEXCEPT_FALSE;
164
165 virtual void sendFullUpdate(bool bForce = false);
166 void sendClose();
167 void sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce = false);
168 virtual void sendAction(VclPtr<vcl::Window> pWindow,
169 std::unique_ptr<jsdialog::ActionDataMap> pData);
170 virtual void sendPopup(VclPtr<vcl::Window> pWindow, OUString sParentId, OUString sCloseId);
171 virtual void sendClosePopup(vcl::LOKWindowId nWindowId);
172 void flush() { mpIdleNotify->Invoke(); }
173
174protected:
175 void initializeSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
176 const OUString& sTypeOfJSON)
177 {
178 mpIdleNotify.reset(new JSDialogNotifyIdle(aNotifierWindow, aContentWindow, sTypeOfJSON));
179 }
180};
181
182class JSDropTarget final
184 css::datatransfer::dnd::XDropTarget, css::lang::XInitialization, css::lang::XServiceInfo>
185{
186 std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
187
188public:
190
191 // XInitialization
192 virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArgs) override;
193
194 // XDropTarget
195 virtual void SAL_CALL addDropTargetListener(
196 const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
197 virtual void SAL_CALL removeDropTargetListener(
198 const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
199 virtual sal_Bool SAL_CALL isActive() override;
200 virtual void SAL_CALL setActive(sal_Bool active) override;
201 virtual sal_Int8 SAL_CALL getDefaultActions() override;
202 virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override;
203
204 OUString SAL_CALL getImplementationName() override;
205
206 sal_Bool SAL_CALL supportsService(OUString const& ServiceName) override;
207
208 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
209
210 void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
211
212 void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde);
213};
214
216{
217 sal_uInt64 m_nWindowId;
221 std::list<OUString> m_aRememberedWidgets;
231
232 friend class JSMessageDialog; // static message boxes have to be registered outside
233 friend class JSDialog;
234 friend class JSAssistant;
235
236 friend VCL_DLLPUBLIC bool jsdialog::ExecuteAction(const OUString& nWindowId,
237 const OUString& rWidget, StringMap& rData);
238 friend VCL_DLLPUBLIC void jsdialog::SendFullUpdate(const OUString& nWindowId,
239 const OUString& rWidget);
240 friend VCL_DLLPUBLIC void jsdialog::SendAction(const OUString& nWindowId,
241 const OUString& rWidget,
242 std::unique_ptr<jsdialog::ActionDataMap> pData);
243
244 static std::map<OUString, WidgetMap>& GetLOKWeldWidgetsMap();
245 static void InsertWindowToMap(const OUString& nWindowId);
246 void RememberWidget(OUString id, weld::Widget* pWidget);
247 static void RememberWidget(const OUString& nWindowId, const OUString& id,
248 weld::Widget* pWidget);
249 static weld::Widget* FindWeldWidgetsMap(const OUString& nWindowId, const OUString& rWidget);
250
251 OUString getMapIdFromWindowId() const;
252
253public:
255 JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile,
256 bool bPopup = false);
258 JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile,
259 sal_uInt64 nLOKWindowId);
261 JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
262 const css::uno::Reference<css::frame::XFrame>& rFrame,
263 sal_uInt64 nWindowId = 0);
265 JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
266 sal_uInt64 nLOKWindowId);
267
268 static std::unique_ptr<JSInstanceBuilder>
269 CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
270 static std::unique_ptr<JSInstanceBuilder>
271 CreateNotebookbarBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
272 const css::uno::Reference<css::frame::XFrame>& rFrame,
273 sal_uInt64 nWindowId = 0);
274 static std::unique_ptr<JSInstanceBuilder> CreateSidebarBuilder(weld::Widget* pParent,
275 const OUString& rUIRoot,
276 const OUString& rUIFile,
277 sal_uInt64 nLOKWindowId = 0);
278 static std::unique_ptr<JSInstanceBuilder>
279 CreatePopupBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
280 static std::unique_ptr<JSInstanceBuilder> CreateFormulabarBuilder(vcl::Window* pParent,
281 const OUString& rUIRoot,
282 const OUString& rUIFile,
283 sal_uInt64 nLOKWindowId);
284
285 virtual ~JSInstanceBuilder() override;
286 virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OUString& id) override;
287 virtual std::unique_ptr<weld::Dialog> weld_dialog(const OUString& id) override;
288 virtual std::unique_ptr<weld::Assistant> weld_assistant(const OUString& id) override;
289 virtual std::unique_ptr<weld::Container> weld_container(const OUString& id) override;
290 virtual std::unique_ptr<weld::Label> weld_label(const OUString& id) override;
291 virtual std::unique_ptr<weld::Button> weld_button(const OUString& id) override;
292 virtual std::unique_ptr<weld::LinkButton> weld_link_button(const OUString& id) override;
293 virtual std::unique_ptr<weld::ToggleButton> weld_toggle_button(const OUString& id) override;
294 virtual std::unique_ptr<weld::Entry> weld_entry(const OUString& id) override;
295 virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OUString& id) override;
296 virtual std::unique_ptr<weld::Notebook> weld_notebook(const OUString& id) override;
297 virtual std::unique_ptr<weld::SpinButton> weld_spin_button(const OUString& id) override;
298 virtual std::unique_ptr<weld::FormattedSpinButton>
299 weld_formatted_spin_button(const OUString& id) override;
300 virtual std::unique_ptr<weld::CheckButton> weld_check_button(const OUString& id) override;
301 virtual std::unique_ptr<weld::DrawingArea>
302 weld_drawing_area(const OUString& id, const a11yref& rA11yImpl = nullptr,
303 FactoryFunction pUITestFactoryFunction = nullptr,
304 void* pUserData = nullptr) override;
305 virtual std::unique_ptr<weld::Toolbar> weld_toolbar(const OUString& id) override;
306 virtual std::unique_ptr<weld::TextView> weld_text_view(const OUString& id) override;
307 virtual std::unique_ptr<weld::TreeView> weld_tree_view(const OUString& id) override;
308 virtual std::unique_ptr<weld::Expander> weld_expander(const OUString& id) override;
309 virtual std::unique_ptr<weld::IconView> weld_icon_view(const OUString& id) override;
310 virtual std::unique_ptr<weld::ScrolledWindow>
311 weld_scrolled_window(const OUString& id, bool bUserManagedScrolling = false) override;
312 virtual std::unique_ptr<weld::RadioButton> weld_radio_button(const OUString& id) override;
313 virtual std::unique_ptr<weld::Frame> weld_frame(const OUString& id) override;
314 virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OUString& id) override;
315 virtual std::unique_ptr<weld::Popover> weld_popover(const OUString& id) override;
316 virtual std::unique_ptr<weld::Box> weld_box(const OUString& id) override;
317 virtual std::unique_ptr<weld::Widget> weld_widget(const OUString& id) override;
318 virtual std::unique_ptr<weld::Image> weld_image(const OUString& id) override;
319 virtual std::unique_ptr<weld::Calendar> weld_calendar(const OUString& id) override;
320
321 static weld::MessageDialog*
323 VclButtonsType eButtonType, const OUString& rPrimaryMessage,
324 const vcl::ILibreOfficeKitNotifier* pNotifier = nullptr);
325
326 static void AddChildWidget(const OUString& nWindowId, const OUString& id,
327 weld::Widget* pWidget);
328 static void RemoveWindowWidget(const OUString& nWindowId);
329
330 // we need to remember original popup window to close it properly (its handled by vcl)
331 static void RememberPopup(const OUString& nWindowId, VclPtr<vcl::Window> pWidget);
332 static void ForgetPopup(const OUString& nWindowId);
333 static vcl::Window* FindPopup(const OUString& nWindowId);
334
335private:
336 const OUString& GetTypeOfJSON() const;
339};
340
341class SAL_LOPLUGIN_ANNOTATE("crosscast") BaseJSWidget
342{
343public:
344 virtual ~BaseJSWidget() = default;
345
346 virtual void sendClose() = 0;
347
348 virtual void sendUpdate(bool bForce = false) = 0;
349
350 virtual void sendFullUpdate(bool bForce = false) = 0;
351
352 virtual void sendAction(std::unique_ptr<jsdialog::ActionDataMap> pData) = 0;
353
354 virtual void sendPopup(vcl::Window* pPopup, OUString sParentId, OUString sCloseId) = 0;
355
356 virtual void sendClosePopup(vcl::LOKWindowId nWindowId) = 0;
357};
358
359template <class BaseInstanceClass, class VclClass>
360class JSWidget : public BaseInstanceClass, public BaseJSWidget
361{
362protected:
365
367
368public:
369 JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* pBuilder,
370 bool bTakeOwnership)
371 : BaseInstanceClass(pObject, pBuilder, bTakeOwnership)
372 , m_bIsFreezed(false)
373 , m_pSender(pSender)
374 {
375 }
376
377 JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* pBuilder,
378 bool bTakeOwnership, bool bUserManagedScrolling)
379 : BaseInstanceClass(pObject, pBuilder, bTakeOwnership, bUserManagedScrolling)
380 , m_bIsFreezed(false)
381 , m_pSender(pSender)
382 {
383 }
384
385 JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* pBuilder,
386 const a11yref& rAlly, FactoryFunction pUITestFactoryFunction, void* pUserData,
387 bool bTakeOwnership)
388 : BaseInstanceClass(pObject, pBuilder, rAlly, pUITestFactoryFunction, pUserData,
389 bTakeOwnership)
390 , m_bIsFreezed(false)
391 , m_pSender(pSender)
392 {
393 }
394
395 virtual void show() override
396 {
397 bool bWasVisible = BaseInstanceClass::get_visible();
398 BaseInstanceClass::show();
399 if (!bWasVisible)
400 {
401 std::unique_ptr<jsdialog::ActionDataMap> pMap
402 = std::make_unique<jsdialog::ActionDataMap>();
403 (*pMap)[ACTION_TYPE] = "show";
404 sendAction(std::move(pMap));
405 }
406 }
407
408 virtual void hide() override
409 {
410 bool bWasVisible = BaseInstanceClass::get_visible();
411 BaseInstanceClass::hide();
412 if (bWasVisible)
413 {
414 std::unique_ptr<jsdialog::ActionDataMap> pMap
415 = std::make_unique<jsdialog::ActionDataMap>();
416 (*pMap)[ACTION_TYPE] = "hide";
417 sendAction(std::move(pMap));
418 }
419 }
420
421 using BaseInstanceClass::set_sensitive;
422 virtual void set_sensitive(bool sensitive) override
423 {
424 bool bIsSensitive = BaseInstanceClass::get_sensitive();
425 BaseInstanceClass::set_sensitive(sensitive);
426 if (bIsSensitive != sensitive)
427 sendUpdate();
428 }
429
430 virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override
431 {
432 if (!m_xDropTarget)
434
435 return m_xDropTarget;
436 }
437
438 virtual void freeze() override
439 {
440 BaseInstanceClass::freeze();
441 m_bIsFreezed = true;
442 }
443
444 virtual void thaw() override
445 {
446 BaseInstanceClass::thaw();
447 m_bIsFreezed = false;
448 sendUpdate();
449 }
450
451 virtual void grab_focus() override
452 {
453 BaseInstanceClass::grab_focus();
454 std::unique_ptr<jsdialog::ActionDataMap> pMap = std::make_unique<jsdialog::ActionDataMap>();
455 (*pMap)[ACTION_TYPE] = "grab_focus";
456 sendAction(std::move(pMap));
457 }
458
459 virtual void sendClose() override
460 {
461 if (m_pSender)
463 }
464
465 virtual void sendUpdate(bool bForce = false) override
466 {
467 if (!m_bIsFreezed && m_pSender)
468 m_pSender->sendUpdate(BaseInstanceClass::m_xWidget, bForce);
469 }
470
471 virtual void sendFullUpdate(bool bForce = false) override
472 {
473 if ((!m_bIsFreezed || bForce) && m_pSender)
474 m_pSender->sendFullUpdate(bForce);
475 }
476
477 virtual void sendAction(std::unique_ptr<jsdialog::ActionDataMap> pData) override
478 {
479 if (!m_bIsFreezed && m_pSender && pData)
480 m_pSender->sendAction(BaseInstanceClass::m_xWidget, std::move(pData));
481 }
482
483 virtual void sendPopup(vcl::Window* pPopup, OUString sParentId, OUString sCloseId) override
484 {
485 if (!m_bIsFreezed && m_pSender)
486 m_pSender->sendPopup(pPopup, sParentId, sCloseId);
487 }
488
489 virtual void sendClosePopup(vcl::LOKWindowId nWindowId) override
490 {
491 if (!m_bIsFreezed && m_pSender)
492 m_pSender->sendClosePopup(nWindowId);
493 }
494
495 virtual void set_buildable_name(const OUString& rName) override
496 {
498 assert(false); // we remember old name in GetLOKWeldWidgetsMap()
499 // TODO: implement renaming or avoid it for LOK
500 }
501};
502
503class JSDialog final : public JSWidget<SalInstanceDialog, ::Dialog>
504{
505public:
506 JSDialog(JSDialogSender* pSender, ::Dialog* pDialog, SalInstanceBuilder* pBuilder,
507 bool bTakeOwnership);
508
509 virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override;
510 virtual void undo_collapse() override;
511 virtual void response(int response) override;
513 virtual int run() override;
514 virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner,
515 const std::function<void(sal_Int32)>& rEndDialogFn) override;
516 virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf,
517 const std::function<void(sal_Int32)>& func) override;
518};
519
520class JSAssistant final : public JSWidget<SalInstanceAssistant, vcl::RoadmapWizard>
521{
522public:
524 bool bTakeOwnership);
525
526 virtual void set_current_page(int nPage) override;
527 virtual void set_current_page(const OUString& rIdent) override;
528 virtual void response(int response) override;
530 virtual int run() override;
531 virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner,
532 const std::function<void(sal_Int32)>& rEndDialogFn) override;
533 virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf,
534 const std::function<void(sal_Int32)>& func) override;
535};
536
537class JSContainer final : public JSWidget<SalInstanceContainer, vcl::Window>
538{
539public:
541 bool bTakeOwnership);
542};
543
544class JSScrolledWindow final : public JSWidget<SalInstanceScrolledWindow, ::VclScrolledWindow>
545{
546public:
548 SalInstanceBuilder* pBuilder, bool bTakeOwnership, bool bUserManagedScrolling);
549
550 virtual void vadjustment_configure(int value, int lower, int upper, int step_increment,
551 int page_increment, int page_size) override;
552 virtual void vadjustment_set_value(int value) override;
554 virtual void vadjustment_set_page_size(int size) override;
555 virtual void set_vpolicy(VclPolicyType eVPolicy) override;
556
557 virtual void hadjustment_configure(int value, int lower, int upper, int step_increment,
558 int page_increment, int page_size) override;
559 virtual void hadjustment_set_value(int value) override;
561 virtual void hadjustment_set_page_size(int size) override;
562 virtual void set_hpolicy(VclPolicyType eVPolicy) override;
563};
564
565class JSLabel final : public JSWidget<SalInstanceLabel, Control>
566{
567public:
568 JSLabel(JSDialogSender* pSender, Control* pLabel, SalInstanceBuilder* pBuilder,
569 bool bTakeOwnership);
570 virtual void set_label(const OUString& rText) override;
571};
572
573class JSButton final : public JSWidget<SalInstanceButton, ::Button>
574{
575public:
576 JSButton(JSDialogSender* pSender, ::Button* pButton, SalInstanceBuilder* pBuilder,
577 bool bTakeOwnership);
578};
579
580class JSLinkButton final : public JSWidget<SalInstanceLinkButton, ::FixedHyperlink>
581{
582public:
583 JSLinkButton(JSDialogSender* pSender, ::FixedHyperlink* pButton, SalInstanceBuilder* pBuilder,
584 bool bTakeOwnership);
585};
586
587class JSToggleButton final : public JSWidget<SalInstanceToggleButton, ::PushButton>
588{
589public:
591 bool bTakeOwnership);
592};
593
594class JSEntry final : public JSWidget<SalInstanceEntry, ::Edit>
595{
596public:
597 JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* pBuilder,
598 bool bTakeOwnership);
599 virtual void set_text(const OUString& rText) override;
600 void set_text_without_notify(const OUString& rText);
601 virtual void replace_selection(const OUString& rText) override;
602};
603
604class JSListBox final : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>
605{
606public:
607 JSListBox(JSDialogSender* pSender, ::ListBox* pListBox, SalInstanceBuilder* pBuilder,
608 bool bTakeOwnership);
609 virtual void insert(int pos, const OUString& rStr, const OUString* pId,
610 const OUString* pIconName, VirtualDevice* pImageSurface) override;
611 virtual void remove(int pos) override;
612 virtual void set_active(int pos) override;
613};
614
615class JSComboBox final : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>
616{
617public:
619 bool bTakeOwnership);
620 virtual void insert(int pos, const OUString& rStr, const OUString* pId,
621 const OUString* pIconName, VirtualDevice* pImageSurface) override;
622 virtual void remove(int pos) override;
623 virtual void set_entry_text_without_notify(const OUString& rText);
624 virtual void set_entry_text(const OUString& rText) override;
625 virtual void set_active(int pos) override;
626 virtual bool changed_by_direct_pick() const override;
627};
628
629class JSNotebook final : public JSWidget<SalInstanceNotebook, ::TabControl>
630{
631public:
633 bool bTakeOwnership);
634
635 virtual void remove_page(const OUString& rIdent) override;
636 virtual void insert_page(const OUString& rIdent, const OUString& rLabel, int nPos) override;
637};
638
639class JSSpinButton final : public JSWidget<SalInstanceSpinButton, ::FormattedField>
640{
641public:
643 bool bTakeOwnership);
644
645 virtual void set_value(sal_Int64 value) override;
646};
647
649 : public JSWidget<SalInstanceFormattedSpinButton, ::FormattedField>
650{
651public:
653 SalInstanceBuilder* pBuilder, bool bTakeOwnership);
654
655 virtual void set_text(const OUString& rText) override;
656 void set_text_without_notify(const OUString& rText);
657};
658
659class JSMessageDialog final : public JSWidget<SalInstanceMessageDialog, ::MessageDialog>
660{
661 std::unique_ptr<JSDialogSender> m_pOwnedSender;
662 std::unique_ptr<JSButton> m_pOK;
663 std::unique_ptr<JSButton> m_pCancel;
664
665 // used for message dialogs created using static functions
666 OUString m_sWindowId;
667
668 DECL_LINK(OKHdl, weld::Button&, void);
669 DECL_LINK(CancelHdl, weld::Button&, void);
670
672
673public:
675 bool bTakeOwnership);
676 JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
678
679 virtual void set_primary_text(const OUString& rText) override;
680
681 virtual void set_secondary_text(const OUString& rText) override;
682
683 virtual void response(int response) override;
684
685 virtual int run() override;
686 // TODO: move to dialog class so we will not send json when built but on run
687 bool runAsync(std::shared_ptr<weld::DialogController> aOwner,
688 const std::function<void(sal_Int32)>& rEndDialogFn) override;
689
690 bool runAsync(std::shared_ptr<Dialog> const& rxSelf,
691 const std::function<void(sal_Int32)>& rEndDialogFn) override;
692};
693
694class JSCheckButton final : public JSWidget<SalInstanceCheckButton, ::CheckBox>
695{
696public:
698 bool bTakeOwnership);
699
700 virtual void set_active(bool active) override;
701};
702
703class JSDrawingArea final : public JSWidget<SalInstanceDrawingArea, VclDrawingArea>
704{
705public:
707 SalInstanceBuilder* pBuilder, const a11yref& rAlly,
708 FactoryFunction pUITestFactoryFunction, void* pUserData);
709
710 virtual void queue_draw() override;
711 virtual void queue_draw_area(int x, int y, int width, int height) override;
712};
713
714class JSToolbar final : public JSWidget<SalInstanceToolbar, ::ToolBox>
715{
716 std::map<sal_uInt16, weld::Widget*> m_pPopovers;
717
718public:
719 JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder,
720 bool bTakeOwnership);
721
722 virtual void set_menu_item_active(const OUString& rIdent, bool bActive) override;
723 virtual void set_item_sensitive(const OUString& rIdent, bool bSensitive) override;
724 virtual void set_item_icon_name(const OUString& rIdent, const OUString& rIconName) override;
725};
726
727class JSTextView final : public JSWidget<SalInstanceTextView, ::VclMultiLineEdit>
728{
729public:
731 bool bTakeOwnership);
732 virtual void set_text(const OUString& rText) override;
733 void set_text_without_notify(const OUString& rText);
734 virtual void replace_selection(const OUString& rText) override;
735};
736
737class JSTreeView final : public JSWidget<SalInstanceTreeView, ::SvTabListBox>
738{
739public:
741 bool bTakeOwnership);
742
745 virtual void set_toggle(int pos, TriState eState, int col = -1) override;
746 virtual void set_toggle(const weld::TreeIter& rIter, TriState bOn, int col = -1) override;
747
750 virtual void select(int pos) override;
751
752 virtual weld::TreeView* get_drag_source() const override;
753
755 virtual void insert(const weld::TreeIter* pParent, int pos, const OUString* pStr,
756 const OUString* pId, const OUString* pIconName,
757 VirtualDevice* pImageSurface, bool bChildrenOnDemand,
758 weld::TreeIter* pRet) override;
759
760 virtual void set_text(int row, const OUString& rText, int col = -1) override;
761 virtual void set_text(const weld::TreeIter& rIter, const OUString& rStr, int col = -1) override;
762
763 virtual void expand_row(const weld::TreeIter& rIter) override;
764 virtual void collapse_row(const weld::TreeIter& rIter) override;
765
766 virtual void set_cursor(const weld::TreeIter& rIter) override;
768 virtual void set_cursor(int pos) override;
769
771 virtual void remove(int pos) override;
772 virtual void remove(const weld::TreeIter& rIter) override;
773
774 virtual void clear() override;
775
777 void drag_end();
778};
779
780class JSExpander final : public JSWidget<SalInstanceExpander, ::VclExpander>
781{
782public:
784 bool bTakeOwnership);
785
786 virtual void set_expanded(bool bExpand) override;
787};
788
789class JSIconView final : public JSWidget<SalInstanceIconView, ::IconView>
790{
791public:
793 bool bTakeOwnership);
794
795 virtual void insert(int pos, const OUString* pStr, const OUString* pId,
796 const OUString* pIconName, weld::TreeIter* pRet) override;
797
798 virtual void insert(int pos, const OUString* pStr, const OUString* pId,
799 const VirtualDevice* pIcon, weld::TreeIter* pRet) override;
800
801 virtual void insert_separator(int pos, const OUString* pId) override;
802
803 virtual void clear() override;
804 virtual void select(int pos) override;
805 virtual void unselect(int pos) override;
806};
807
808class JSRadioButton final : public JSWidget<SalInstanceRadioButton, ::RadioButton>
809{
810public:
812 SalInstanceBuilder* pBuilder, bool bTakeOwnership);
813
814 virtual void set_active(bool active) override;
815};
816
817class JSFrame : public JSWidget<SalInstanceFrame, ::VclFrame>
818{
819public:
821 bool bTakeOwnership);
822};
823
824class JSMenuButton : public JSWidget<SalInstanceMenuButton, ::MenuButton>
825{
826public:
828 bool bTakeOwnership);
829
830 virtual void set_label(const OUString& rText) override;
831 virtual void set_image(VirtualDevice* pDevice) override;
832 virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override;
833 virtual void set_active(bool active) override;
834};
835
836class JSPopover : public JSWidget<SalInstancePopover, DockingWindow>
837{
839
840public:
842 bool bTakeOwnership);
843
844 virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect,
845 weld::Placement ePlace = weld::Placement::Under) override;
846 virtual void popdown() override;
847
848 void set_window_id(vcl::LOKWindowId nWindowId) { mnWindowId = nWindowId; }
849};
850
851class JSBox : public JSWidget<SalInstanceBox, VclBox>
852{
853public:
854 JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
855
856 void reorder_child(weld::Widget* pWidget, int nNewPosition) override;
857};
858
859class JSWidgetInstance : public JSWidget<SalInstanceWidget, vcl::Window>
860{
861public:
863 bool bTakeOwnership)
864 : JSWidget<SalInstanceWidget, vcl::Window>(pSender, pObject, pBuilder, bTakeOwnership)
865 {
866 }
867};
868
869class JSImage : public JSWidget<SalInstanceImage, FixedImage>
870{
871public:
873 bool bTakeOwnership);
874 virtual void set_image(VirtualDevice* pDevice) override;
875 virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override;
876};
877
878class JSCalendar : public JSWidget<SalInstanceCalendar, ::Calendar>
879{
880public:
882 bool bTakeOwnership);
883};
884
885/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:39
Definition: ctrl.hxx:80
Definition: edit.hxx:56
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:35
virtual weld::Button * weld_widget_for_response(int response) override
JSAssistant(JSDialogSender *pSender, vcl::RoadmapWizard *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual int run() override
virtual void set_current_page(const OUString &rIdent) override
virtual void set_current_page(int nPage) override
virtual bool runAsync(std::shared_ptr< weld::DialogController > aOwner, const std::function< void(sal_Int32)> &rEndDialogFn) override
virtual bool runAsync(std::shared_ptr< Dialog > const &rxSelf, const std::function< void(sal_Int32)> &func) override
virtual void response(int response) override
JSBox(JSDialogSender *pSender, VclBox *pBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void reorder_child(weld::Widget *pWidget, int nNewPosition) override
JSButton(JSDialogSender *pSender, ::Button *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSCalendar(JSDialogSender *pSender, ::Calendar *pCalendar, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSCheckButton(JSDialogSender *pSender, ::CheckBox *pCheckBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_active(bool active) override
virtual bool changed_by_direct_pick() const override
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
JSComboBox(JSDialogSender *pSender, ::ComboBox *pComboBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void remove(int pos) override
virtual void set_entry_text_without_notify(const OUString &rText)
virtual void set_active(int pos) override
virtual void set_entry_text(const OUString &rText) override
JSContainer(JSDialogSender *pSender, vcl::Window *pContainer, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
Class with the message description for storing in the queue.
JSDialogMessageInfo & operator=(JSDialogMessageInfo aInfo)
JSDialogMessageInfo(jsdialog::MessageType eType, VclPtr< vcl::Window > pWindow, std::unique_ptr< jsdialog::ActionDataMap > pData)
JSDialogMessageInfo(const JSDialogMessageInfo &rInfo)
jsdialog::MessageType m_eType
std::unique_ptr< jsdialog::ActionDataMap > m_pData
void copy(const JSDialogMessageInfo &rInfo)
VclPtr< vcl::Window > m_pWindow
std::unique_ptr< tools::JsonWriter > generateActionMessage(VclPtr< vcl::Window > pWindow, std::unique_ptr< jsdialog::ActionDataMap > pData) const
std::unique_ptr< tools::JsonWriter > generateFullUpdate() const
void sendMessage(jsdialog::MessageType eType, VclPtr< vcl::Window > pWindow, std::unique_ptr< jsdialog::ActionDataMap > pData=nullptr)
std::unique_ptr< tools::JsonWriter > generateCloseMessage() const
std::deque< JSDialogMessageInfo > m_aMessageQueue
JSDialogNotifyIdle(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, const OUString &sTypeOfJSON)
std::unique_ptr< tools::JsonWriter > generatePopupMessage(VclPtr< vcl::Window > pWindow, OUString sParentId, OUString sCloseId) const
std::unique_ptr< tools::JsonWriter > generateClosePopupMessage(OUString sWindowId) const
void Invoke() override
Calls the maInvokeHandler with the parameter this.
VclPtr< vcl::Window > m_aNotifierWindow
VclPtr< vcl::Window > m_aContentWindow
std::unique_ptr< tools::JsonWriter > generateWidgetUpdate(VclPtr< vcl::Window > pWindow) const
void send(tools::JsonWriter &aJsonWriter)
void initializeSender(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, const OUString &sTypeOfJSON)
virtual void sendFullUpdate(bool bForce=false)
void sendUpdate(VclPtr< vcl::Window > pWindow, bool bForce=false)
virtual ~JSDialogSender() COVERITY_NOEXCEPT_FALSE
virtual void sendPopup(VclPtr< vcl::Window > pWindow, OUString sParentId, OUString sCloseId)
std::unique_ptr< JSDialogNotifyIdle > mpIdleNotify
virtual void sendAction(VclPtr< vcl::Window > pWindow, std::unique_ptr< jsdialog::ActionDataMap > pData)
virtual void sendClosePopup(vcl::LOKWindowId nWindowId)
JSDialogSender(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, const OUString &sTypeOfJSON)
virtual bool runAsync(std::shared_ptr< weld::DialogController > aOwner, const std::function< void(sal_Int32)> &rEndDialogFn) override
virtual void collapse(weld::Widget *pEdit, weld::Widget *pButton) override
virtual int run() override
JSDialog(JSDialogSender *pSender, ::Dialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void undo_collapse() override
virtual bool runAsync(std::shared_ptr< Dialog > const &rxSelf, const std::function< void(sal_Int32)> &func) override
virtual void response(int response) override
virtual weld::Button * weld_widget_for_response(int response) override
JSDrawingArea(JSDialogSender *pSender, VclDrawingArea *pDrawingArea, SalInstanceBuilder *pBuilder, const a11yref &rAlly, FactoryFunction pUITestFactoryFunction, void *pUserData)
virtual void queue_draw_area(int x, int y, int width, int height) override
virtual void queue_draw() override
virtual sal_Bool SAL_CALL isActive() override
void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde)
virtual void SAL_CALL removeDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtde)
OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override
virtual void SAL_CALL addDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
virtual sal_Int8 SAL_CALL getDefaultActions() override
std::vector< css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > > m_aListeners
virtual void SAL_CALL setActive(sal_Bool active) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArgs) override
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void set_text(const OUString &rText) override
JSEntry(JSDialogSender *pSender, ::Edit *pEntry, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void set_text_without_notify(const OUString &rText)
virtual void replace_selection(const OUString &rText) override
virtual void set_expanded(bool bExpand) override
JSExpander(JSDialogSender *pSender, ::VclExpander *pExpander, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_text(const OUString &rText) override
JSFormattedSpinButton(JSDialogSender *pSender, ::FormattedField *pSpin, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void set_text_without_notify(const OUString &rText)
JSFrame(JSDialogSender *pSender, ::VclFrame *pFrame, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void unselect(int pos) override
virtual void insert(int pos, const OUString *pStr, const OUString *pId, const VirtualDevice *pIcon, weld::TreeIter *pRet) override
JSIconView(JSDialogSender *pSender, ::IconView *pIconView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void select(int pos) override
virtual void insert_separator(int pos, const OUString *pId) override
virtual void insert(int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, weld::TreeIter *pRet) override
virtual void clear() override
virtual void set_image(VirtualDevice *pDevice) override
JSImage(JSDialogSender *pSender, FixedImage *pImage, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_image(const css::uno::Reference< css::graphic::XGraphic > &rImage) override
virtual ~JSInstanceBuilder() override
virtual std::unique_ptr< weld::TextView > weld_text_view(const OUString &id) override
static std::unique_ptr< JSInstanceBuilder > CreateSidebarBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId=0)
static void RememberPopup(const OUString &nWindowId, VclPtr< vcl::Window > pWidget)
virtual std::unique_ptr< weld::Frame > weld_frame(const OUString &id) override
static void ForgetPopup(const OUString &nWindowId)
VclPtr< vcl::Window > & GetContentWindow()
virtual std::unique_ptr< weld::RadioButton > weld_radio_button(const OUString &id) override
virtual std::unique_ptr< weld::Assistant > weld_assistant(const OUString &id) override
virtual std::unique_ptr< weld::LinkButton > weld_link_button(const OUString &id) override
virtual std::unique_ptr< weld::Widget > weld_widget(const OUString &id) override
virtual std::unique_ptr< weld::DrawingArea > weld_drawing_area(const OUString &id, const a11yref &rA11yImpl=nullptr, FactoryFunction pUITestFactoryFunction=nullptr, void *pUserData=nullptr) override
OUString getMapIdFromWindowId() const
virtual std::unique_ptr< weld::Button > weld_button(const OUString &id) override
static std::unique_ptr< JSInstanceBuilder > CreateNotebookbarBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, const css::uno::Reference< css::frame::XFrame > &rFrame, sal_uInt64 nWindowId=0)
JSInstanceBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, const css::uno::Reference< css::frame::XFrame > &rFrame, sal_uInt64 nWindowId=0)
used for notebookbar, optional nWindowId is used if getting parent id failed
virtual std::unique_ptr< weld::Image > weld_image(const OUString &id) override
JSInstanceBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile, bool bPopup=false)
used for dialogs or popups
static void RememberWidget(const OUString &nWindowId, const OUString &id, weld::Widget *pWidget)
VclPtr< vcl::Window > m_aWindowToRelease
When LOKNotifier is set by jsdialogs code we need to release it.
bool m_bIsNestedBuilder
is true for tabpages, prevents from closing parent window on destroy
std::list< OUString > m_aRememberedWidgets
static std::map< OUString, WidgetMap > & GetLOKWeldWidgetsMap()
const OUString & GetTypeOfJSON() const
static weld::Widget * FindWeldWidgetsMap(const OUString &nWindowId, const OUString &rWidget)
virtual std::unique_ptr< weld::Dialog > weld_dialog(const OUString &id) override
virtual std::unique_ptr< weld::Entry > weld_entry(const OUString &id) override
static std::unique_ptr< JSInstanceBuilder > CreateFormulabarBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
VclPtr< vcl::Window > m_aParentDialog
used in case of tab pages where dialog is not a direct top level
virtual std::unique_ptr< weld::SpinButton > weld_spin_button(const OUString &id) override
virtual std::unique_ptr< weld::Box > weld_box(const OUString &id) override
static vcl::Window * FindPopup(const OUString &nWindowId)
virtual std::unique_ptr< weld::Calendar > weld_calendar(const OUString &id) override
static std::unique_ptr< JSInstanceBuilder > CreatePopupBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
virtual std::unique_ptr< weld::FormattedSpinButton > weld_formatted_spin_button(const OUString &id) override
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
static std::unique_ptr< JSInstanceBuilder > CreateDialogBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
virtual std::unique_ptr< weld::MessageDialog > weld_message_dialog(const OUString &id) override
virtual std::unique_ptr< weld::Toolbar > weld_toolbar(const OUString &id) override
bool m_bSentInitialUpdate
used to detect when we have to send Full Update in container handler
static void AddChildWidget(const OUString &nWindowId, const OUString &id, weld::Widget *pWidget)
static void InsertWindowToMap(const OUString &nWindowId)
virtual std::unique_ptr< weld::ScrolledWindow > weld_scrolled_window(const OUString &id, bool bUserManagedScrolling=false) override
virtual std::unique_ptr< weld::Notebook > weld_notebook(const OUString &id) override
virtual std::unique_ptr< weld::TreeView > weld_tree_view(const OUString &id) override
VclPtr< vcl::Window > m_aContentWindow
static void RemoveWindowWidget(const OUString &nWindowId)
virtual std::unique_ptr< weld::ComboBox > weld_combo_box(const OUString &id) override
virtual std::unique_ptr< weld::Label > weld_label(const OUString &id) override
JSInstanceBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
used for sidebar panels
virtual std::unique_ptr< weld::ToggleButton > weld_toggle_button(const OUString &id) override
virtual std::unique_ptr< weld::Container > weld_container(const OUString &id) override
virtual std::unique_ptr< weld::IconView > weld_icon_view(const OUString &id) override
void RememberWidget(OUString id, weld::Widget *pWidget)
virtual std::unique_ptr< weld::MenuButton > weld_menu_button(const OUString &id) override
JSInstanceBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
used for formulabar
VclPtr< vcl::Window > & GetNotifierWindow()
virtual std::unique_ptr< weld::Popover > weld_popover(const OUString &id) override
virtual std::unique_ptr< weld::Expander > weld_expander(const OUString &id) override
virtual std::unique_ptr< weld::CheckButton > weld_check_button(const OUString &id) override
virtual void set_label(const OUString &rText) override
JSLabel(JSDialogSender *pSender, Control *pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSLinkButton(JSDialogSender *pSender, ::FixedHyperlink *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_active(int pos) override
virtual void remove(int pos) override
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
JSListBox(JSDialogSender *pSender, ::ListBox *pListBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_active(bool active) override
virtual void set_image(VirtualDevice *pDevice) override
virtual void set_label(const OUString &rText) override
JSMenuButton(JSDialogSender *pSender, ::MenuButton *pMenuButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_image(const css::uno::Reference< css::graphic::XGraphic > &rImage) override
DECL_LINK(CancelHdl, weld::Button &, void)
std::unique_ptr< JSDialogSender > m_pOwnedSender
virtual ~JSMessageDialog()
JSMessageDialog(::MessageDialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSMessageDialog(JSDialogSender *pSender, ::MessageDialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_secondary_text(const OUString &rText) override
void RememberMessageDialog()
DECL_LINK(OKHdl, weld::Button &, void)
bool runAsync(std::shared_ptr< weld::DialogController > aOwner, const std::function< void(sal_Int32)> &rEndDialogFn) override
std::unique_ptr< JSButton > m_pOK
std::unique_ptr< JSButton > m_pCancel
virtual void response(int response) override
bool runAsync(std::shared_ptr< Dialog > const &rxSelf, const std::function< void(sal_Int32)> &rEndDialogFn) override
virtual int run() override
virtual void set_primary_text(const OUString &rText) override
virtual void insert_page(const OUString &rIdent, const OUString &rLabel, int nPos) override
virtual void remove_page(const OUString &rIdent) override
JSNotebook(JSDialogSender *pSender, ::TabControl *pControl, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void popup_at_rect(weld::Widget *pParent, const tools::Rectangle &rRect, weld::Placement ePlace=weld::Placement::Under) override
JSPopover(JSDialogSender *pSender, DockingWindow *pPopover, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
vcl::LOKWindowId mnWindowId
virtual void popdown() override
void set_window_id(vcl::LOKWindowId nWindowId)
virtual void set_active(bool active) override
JSRadioButton(JSDialogSender *pSender, ::RadioButton *pRadioButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void hadjustment_set_page_size(int size) override
void vadjustment_set_value_no_notification(int value)
virtual void vadjustment_configure(int value, int lower, int upper, int step_increment, int page_increment, int page_size) override
JSScrolledWindow(JSDialogSender *pSender, ::VclScrolledWindow *pWindow, SalInstanceBuilder *pBuilder, bool bTakeOwnership, bool bUserManagedScrolling)
virtual void set_hpolicy(VclPolicyType eVPolicy) override
virtual void hadjustment_set_value(int value) override
virtual void set_vpolicy(VclPolicyType eVPolicy) override
void hadjustment_set_value_no_notification(int value)
virtual void vadjustment_set_page_size(int size) override
virtual void hadjustment_configure(int value, int lower, int upper, int step_increment, int page_increment, int page_size) override
virtual void vadjustment_set_value(int value) override
JSSpinButton(JSDialogSender *pSender, ::FormattedField *pSpin, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_value(sal_Int64 value) override
JSTextView(JSDialogSender *pSender, ::VclMultiLineEdit *pTextView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_text(const OUString &rText) override
virtual void replace_selection(const OUString &rText) override
void set_text_without_notify(const OUString &rText)
JSToggleButton(JSDialogSender *pSender, ::PushButton *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_item_sensitive(const OUString &rIdent, bool bSensitive) override
std::map< sal_uInt16, weld::Widget * > m_pPopovers
JSToolbar(JSDialogSender *pSender, ::ToolBox *pToolbox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_menu_item_active(const OUString &rIdent, bool bActive) override
virtual void set_item_icon_name(const OUString &rIdent, const OUString &rIconName) override
virtual void set_toggle(int pos, TriState eState, int col=-1) override
pos is used differently here, it defines how many steps of iterator we need to perform to take entry
virtual void remove(const weld::TreeIter &rIter) override
virtual void set_cursor(const weld::TreeIter &rIter) override
virtual void clear() override
virtual weld::TreeView * get_drag_source() const override
void set_cursor_without_notify(const weld::TreeIter &rIter)
virtual void select(int pos) override
pos is used differently here, it defines how many steps of iterator we need to perform to take entry
void drag_start()
virtual void set_cursor(int pos) override
virtual void insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet) override
virtual void set_text(int row, const OUString &rText, int col=-1) override
virtual void remove(int pos) override
virtual void collapse_row(const weld::TreeIter &rIter) override
virtual void set_text(const weld::TreeIter &rIter, const OUString &rStr, int col=-1) override
virtual void expand_row(const weld::TreeIter &rIter) override
void drag_end()
JSTreeView(JSDialogSender *pSender, ::SvTabListBox *pTextView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_toggle(const weld::TreeIter &rIter, TriState bOn, int col=-1) override
JSWidgetInstance(JSDialogSender *pSender, vcl::Window *pObject, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
rtl::Reference< JSDropTarget > m_xDropTarget
virtual void sendFullUpdate(bool bForce=false) override
virtual css::uno::Reference< css::datatransfer::dnd::XDropTarget > get_drop_target() override
virtual void show() override
JSDialogSender * m_pSender
virtual void grab_focus() override
virtual void sendPopup(vcl::Window *pPopup, OUString sParentId, OUString sCloseId) override
JSWidget(JSDialogSender *pSender, VclClass *pObject, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void sendAction(std::unique_ptr< jsdialog::ActionDataMap > pData) override
JSWidget(JSDialogSender *pSender, VclClass *pObject, SalInstanceBuilder *pBuilder, const a11yref &rAlly, FactoryFunction pUITestFactoryFunction, void *pUserData, bool bTakeOwnership)
virtual void freeze() override
virtual void set_buildable_name(const OUString &rName) override
virtual void hide() override
virtual void thaw() override
virtual void sendClosePopup(vcl::LOKWindowId nWindowId) override
virtual void set_sensitive(bool sensitive) override
JSWidget(JSDialogSender *pSender, VclClass *pObject, SalInstanceBuilder *pBuilder, bool bTakeOwnership, bool bUserManagedScrolling)
virtual void sendClose() override
virtual void sendUpdate(bool bForce=false) override
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
void set_toggle(SvTreeListEntry *pEntry, TriState eState, int col)
virtual void remove(int pos) override
virtual void select(int pos) override
virtual void insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet) override
virtual void set_buildable_name(const OUString &rId) override
Definition: salvtables.cxx:433
A toolbar: contains all those icons, typically below the menu bar.
Definition: toolbox.hxx:74
wizard for a roadmap
Definition: wizdlg.hxx:65
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
EmbeddedObjectRef * pObject
DocumentType eType
TriState
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
std::map< OUString, weld::Widget * > WidgetMap
#define ACTION_TYPE
class SAL_LOPLUGIN_ANNOTATE("crosscast") BaseJSWidget
std::unique_ptr< sal_Int32[]> pData
VCL_DLLPUBLIC bool ExecuteAction(const OUString &nWindowId, const OUString &rWidget, StringMap &rData)
execute action on a widget
VCL_DLLPUBLIC void SendFullUpdate(const OUString &nWindowId, const OUString &rWidget)
send full update message to the client
std::unordered_map< OString, OUString > ActionDataMap
Definition: executor.hxx:134
VCL_DLLPUBLIC void SendAction(const OUString &nWindowId, const OUString &rWidget, std::unique_ptr< ActionDataMap > pData)
send action message to the client
sal_uInt32 LOKWindowId
Placement
Definition: weld.hxx:2390
unsigned char sal_Bool
signed char sal_Int8
VclPolicyType
Definition: vclenum.hxx:243
VclMessageType
Definition: vclenum.hxx:226
VclButtonsType
Definition: vclenum.hxx:216
css::uno::Reference< css::accessibility::XAccessible > a11yref
Definition: weld.hxx:51
std::map< OUString, OUString > StringMap