1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include <jsdialog/jsdialogbuilder.hxx>
11 #include <sal/log.hxx>
12 #include <comphelper/base64.hxx>
13 #include <iconview.hxx>
15 #include <vcl/menu.hxx>
16 #include <vcl/svapp.hxx>
17 #include <vcl/toolbox.hxx>
18 #include <vcl/toolkit/button.hxx>
19 #include <vcl/toolkit/combobox.hxx>
20 #include <vcl/toolkit/dialog.hxx>
21 #include <vcl/toolkit/treelistentry.hxx>
22 #include <vcl/toolkit/vclmedit.hxx>
23 #include <verticaltabctrl.hxx>
24 #include <messagedialog.hxx>
25 #include <tools/json_writer.hxx>
27 #include <vcl/jsdialog/executor.hxx>
28 #include <cppuhelper/supportsservice.hxx>
29 #include <tools/stream.hxx>
30 #include <vcl/cvtgrf.hxx>
35 void response_help(vcl::Window
* pWindow
)
37 ::Dialog
* pDialog
= dynamic_cast<::Dialog
*>(pWindow
);
41 vcl::Window
* pButtonWindow
= pDialog
->get_widget_for_response(RET_HELP
);
42 ::Button
* pButton
= dynamic_cast<::Button
*>(pButtonWindow
);
45 // Is it a wizard dialog?
46 vcl::RoadmapWizard
* pWizard
= dynamic_cast<vcl::RoadmapWizard
*>(pWindow
);
47 if (!pWizard
|| !pWizard
->m_pHelp
)
49 pWizard
->m_pHelp
->Click();
59 vcl::Window
* extract_sal_widget(weld::Widget
* pParent
)
61 SalInstanceWidget
* pInstanceWidget
= dynamic_cast<SalInstanceWidget
*>(pParent
);
62 return pInstanceWidget
? pInstanceWidget
->getWidget() : nullptr;
70 class JSDropTargetDropContext
71 : public cppu::WeakImplHelper
<css::datatransfer::dnd::XDropTargetDropContext
>
74 JSDropTargetDropContext() {}
76 // XDropTargetDropContext
77 virtual void SAL_CALL
acceptDrop(sal_Int8
/*dragOperation*/) override
{}
79 virtual void SAL_CALL
rejectDrop() override
{}
81 virtual void SAL_CALL
dropComplete(sal_Bool
/*bSuccess*/) override
{}
85 static JSTreeView
* g_DragSource
;
87 JSDropTarget::JSDropTarget() {}
89 void JSDropTarget::initialize(const css::uno::Sequence
<css::uno::Any
>& /*rArgs*/) {}
91 void JSDropTarget::addDropTargetListener(
92 const css::uno::Reference
<css::datatransfer::dnd::XDropTargetListener
>& xListener
)
94 std::unique_lock
aGuard(m_aMutex
);
96 m_aListeners
.push_back(xListener
);
99 void JSDropTarget::removeDropTargetListener(
100 const css::uno::Reference
<css::datatransfer::dnd::XDropTargetListener
>& xListener
)
102 std::unique_lock
aGuard(m_aMutex
);
104 std::erase(m_aListeners
, xListener
);
107 sal_Bool
JSDropTarget::isActive() { return false; }
109 void JSDropTarget::setActive(sal_Bool
/*active*/) {}
111 sal_Int8
JSDropTarget::getDefaultActions() { return 0; }
113 void JSDropTarget::setDefaultActions(sal_Int8
/*actions*/) {}
115 OUString
JSDropTarget::getImplementationName()
117 return u
"com.sun.star.datatransfer.dnd.JSDropTarget"_ustr
;
120 sal_Bool
JSDropTarget::supportsService(OUString
const& ServiceName
)
122 return cppu::supportsService(this, ServiceName
);
125 css::uno::Sequence
<OUString
> JSDropTarget::getSupportedServiceNames()
127 css::uno::Sequence
<OUString
> aRet
{ u
"com.sun.star.datatransfer.dnd.JSDropTarget"_ustr
};
131 void JSDropTarget::fire_drop(const css::datatransfer::dnd::DropTargetDropEvent
& dtde
)
133 std::unique_lock
aGuard(m_aMutex
);
134 std::vector
<css::uno::Reference
<css::datatransfer::dnd::XDropTargetListener
>> aListeners(
138 for (auto const& listener
: aListeners
)
140 listener
->drop(dtde
);
144 void JSDropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent
& dtde
)
146 std::unique_lock
aGuard(m_aMutex
);
147 std::vector
<css::uno::Reference
<css::datatransfer::dnd::XDropTargetListener
>> aListeners(
151 for (auto const& listener
: aListeners
)
153 listener
->dragEnter(dtde
);
157 void JSInstanceBuilder::initializeDialogSender()
159 m_sTypeOfJSON
= "dialog";
161 vcl::Window
* pRoot
= m_xBuilder
->get_widget_root();
163 if (pRoot
&& pRoot
->GetParent())
165 m_aParentDialog
= pRoot
->GetParent()->GetParentWithLOKNotifier();
167 m_nWindowId
= m_aParentDialog
->GetLOKWindowId();
168 InsertWindowToMap(getMapIdFromWindowId());
171 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
174 void JSInstanceBuilder::initializePopupSender()
176 // when it is a popup we initialize sender in weld_popover
177 m_sTypeOfJSON
= "popup";
180 void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId
,
181 const std::u16string_view
& rUIFile
)
183 m_sTypeOfJSON
= "sidebar";
184 m_nWindowId
= nLOKWindowId
;
186 vcl::Window
* pRoot
= m_xBuilder
->get_widget_root();
188 m_aParentDialog
= pRoot
->GetParentWithLOKNotifier();
190 if (rUIFile
== u
"sfx/ui/panel.ui")
192 // builder for Panel, get SidebarDockingWindow as m_aContentWindow
193 m_aContentWindow
= pRoot
;
194 for (int i
= 0; i
< 7 && m_aContentWindow
; i
++)
195 m_aContentWindow
= m_aContentWindow
->GetParent();
199 // embedded fragments cannot send close message for whole sidebar
200 if (rUIFile
== u
"modules/simpress/ui/customanimationfragment.ui")
203 // builder for PanelLayout, get SidebarDockingWindow as m_aContentWindow
204 m_aContentWindow
= pRoot
;
205 for (int i
= 0; i
< 9 && m_aContentWindow
; i
++)
206 m_aContentWindow
= m_aContentWindow
->GetParent();
209 InsertWindowToMap(getMapIdFromWindowId());
211 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
214 void JSInstanceBuilder::initializeNotebookbarSender(sal_uInt64 nLOKWindowId
)
216 m_sTypeOfJSON
= "notebookbar";
218 vcl::Window
* pRoot
= m_xBuilder
->get_widget_root();
219 if (pRoot
&& pRoot
->GetParent())
221 m_aParentDialog
= pRoot
->GetParent()->GetParentWithLOKNotifier();
223 m_nWindowId
= m_aParentDialog
->GetLOKWindowId();
224 if (!m_nWindowId
&& nLOKWindowId
)
226 m_nWindowId
= nLOKWindowId
;
227 m_bIsNotebookbar
= true;
229 InsertWindowToMap(getMapIdFromWindowId());
232 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
235 void JSInstanceBuilder::initializeFormulabarSender(sal_uInt64 nLOKWindowId
,
236 const std::u16string_view
& sTypeOfJSON
,
237 vcl::Window
* pVclParent
)
239 m_sTypeOfJSON
= sTypeOfJSON
;
240 m_nWindowId
= nLOKWindowId
;
242 vcl::Window
* pRoot
= m_xBuilder
->get_widget_root();
243 m_aContentWindow
= pVclParent
;
244 if (pRoot
&& pRoot
->GetParent())
246 m_aParentDialog
= pRoot
->GetParent()->GetParentWithLOKNotifier();
247 InsertWindowToMap(getMapIdFromWindowId());
250 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
253 void JSInstanceBuilder::initializeMenuSender(weld::Widget
* pParent
)
255 m_sTypeOfJSON
= "menu";
256 m_aParentDialog
= extract_sal_widget(pParent
)->GetParentWithLOKNotifier();
257 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
260 JSInstanceBuilder::JSInstanceBuilder(weld::Widget
* pParent
, vcl::Window
* pVclParent
,
261 std::u16string_view rUIRoot
, const OUString
& rUIFile
,
262 JSInstanceBuilder::Type eBuilderType
, sal_uInt64 nLOKWindowId
,
263 const std::u16string_view
& sTypeOfJSON
,
264 const css::uno::Reference
<css::frame::XFrame
>& rFrame
)
265 : SalInstanceBuilder(pVclParent
? pVclParent
: extract_sal_widget(pParent
), rUIRoot
, rUIFile
,
268 , m_aParentDialog(nullptr)
269 , m_aContentWindow(nullptr)
270 , m_sTypeOfJSON("unknown")
271 , m_bHasTopLevelDialog(false)
272 , m_bIsNotebookbar(false)
273 , m_bSentInitialUpdate(false)
274 , m_bIsNestedBuilder(false)
275 , m_aWindowToRelease(nullptr)
277 switch (eBuilderType
)
279 case JSInstanceBuilder::Type::Dialog
:
280 initializeDialogSender();
283 case JSInstanceBuilder::Type::Popup
:
284 initializePopupSender();
287 case JSInstanceBuilder::Type::Sidebar
:
288 initializeSidebarSender(nLOKWindowId
, rUIFile
);
291 case JSInstanceBuilder::Type::Notebookbar
:
292 initializeNotebookbarSender(nLOKWindowId
);
295 case JSInstanceBuilder::Type::Formulabar
:
296 initializeFormulabarSender(nLOKWindowId
, sTypeOfJSON
, pVclParent
);
299 case JSInstanceBuilder::Type::Menu
:
300 initializeMenuSender(pParent
);
308 std::unique_ptr
<JSInstanceBuilder
> JSInstanceBuilder::CreateDialogBuilder(weld::Widget
* pParent
,
309 const OUString
& rUIRoot
,
310 const OUString
& rUIFile
)
312 return std::make_unique
<JSInstanceBuilder
>(pParent
, nullptr, rUIRoot
, rUIFile
,
313 JSInstanceBuilder::Type::Dialog
);
316 std::unique_ptr
<JSInstanceBuilder
> JSInstanceBuilder::CreateNotebookbarBuilder(
317 vcl::Window
* pParent
, const OUString
& rUIRoot
, const OUString
& rUIFile
,
318 const css::uno::Reference
<css::frame::XFrame
>& rFrame
, sal_uInt64 nWindowId
)
320 return std::make_unique
<JSInstanceBuilder
>(nullptr, pParent
, rUIRoot
, rUIFile
,
321 JSInstanceBuilder::Type::Notebookbar
, nWindowId
, u
"",
325 std::unique_ptr
<JSInstanceBuilder
> JSInstanceBuilder::CreateSidebarBuilder(weld::Widget
* pParent
,
326 const OUString
& rUIRoot
,
327 const OUString
& rUIFile
,
328 sal_uInt64 nLOKWindowId
)
330 return std::make_unique
<JSInstanceBuilder
>(pParent
, nullptr, rUIRoot
, rUIFile
,
331 JSInstanceBuilder::Type::Sidebar
, nLOKWindowId
);
334 std::unique_ptr
<JSInstanceBuilder
> JSInstanceBuilder::CreatePopupBuilder(weld::Widget
* pParent
,
335 const OUString
& rUIRoot
,
336 const OUString
& rUIFile
)
338 return std::make_unique
<JSInstanceBuilder
>(pParent
, nullptr, rUIRoot
, rUIFile
,
339 JSInstanceBuilder::Type::Popup
);
342 std::unique_ptr
<JSInstanceBuilder
> JSInstanceBuilder::CreateMenuBuilder(weld::Widget
* pParent
,
343 const OUString
& rUIRoot
,
344 const OUString
& rUIFile
)
346 return std::make_unique
<JSInstanceBuilder
>(pParent
, nullptr, rUIRoot
, rUIFile
,
347 JSInstanceBuilder::Type::Menu
);
350 std::unique_ptr
<JSInstanceBuilder
>
351 JSInstanceBuilder::CreateFormulabarBuilder(vcl::Window
* pParent
, const OUString
& rUIRoot
,
352 const OUString
& rUIFile
, sal_uInt64 nLOKWindowId
)
354 return std::make_unique
<JSInstanceBuilder
>(nullptr, pParent
, rUIRoot
, rUIFile
,
355 JSInstanceBuilder::Type::Formulabar
, nLOKWindowId
,
359 std::unique_ptr
<JSInstanceBuilder
>
360 JSInstanceBuilder::CreateAddressInputBuilder(vcl::Window
* pParent
, const OUString
& rUIRoot
,
361 const OUString
& rUIFile
, sal_uInt64 nLOKWindowId
)
363 return std::make_unique
<JSInstanceBuilder
>(nullptr, pParent
, rUIRoot
, rUIFile
,
364 JSInstanceBuilder::Type::Formulabar
, nLOKWindowId
,
365 u
"addressinputfield");
368 JSInstanceBuilder::~JSInstanceBuilder()
370 // tab page closed -> refresh parent window
371 if (m_bIsNestedBuilder
&& m_sTypeOfJSON
== "dialog")
373 jsdialog::SendFullUpdate(OUString::number(m_nWindowId
), u
"__DIALOG__"_ustr
);
376 if (m_sTypeOfJSON
== "popup" || m_sTypeOfJSON
== "menu")
377 sendClosePopup(m_nWindowId
);
379 if (m_aWindowToRelease
)
381 m_aWindowToRelease
->ReleaseLOKNotifier();
382 m_aWindowToRelease
.clear();
385 if (m_nWindowId
&& (m_bHasTopLevelDialog
|| m_bIsNotebookbar
))
387 JSInstanceBuilder::Widgets().Forget(getMapIdFromWindowId());
391 auto aWindowMap
= JSInstanceBuilder::Widgets().Find(getMapIdFromWindowId());
394 std::for_each(m_aRememberedWidgets
.begin(), m_aRememberedWidgets
.end(),
395 [&aWindowMap
](const OUString
& sId
) { aWindowMap
->Forget(sId
); });
399 JSInstanceBuilder::Popups().Forget(OUString::number(m_nWindowId
));
400 JSInstanceBuilder::Menus().Forget(OUString::number(m_nWindowId
));
403 const OUString
& JSInstanceBuilder::GetTypeOfJSON() const { return m_sTypeOfJSON
; }
405 VclPtr
<vcl::Window
>& JSInstanceBuilder::GetContentWindow()
407 if (m_aContentWindow
)
408 return m_aContentWindow
;
410 return m_bHasTopLevelDialog
? m_aOwnedToplevel
: m_aParentDialog
;
413 VclPtr
<vcl::Window
>& JSInstanceBuilder::GetNotifierWindow()
415 return m_bHasTopLevelDialog
? m_aOwnedToplevel
: m_aParentDialog
;
418 std::unique_ptr
<weld::Dialog
> JSInstanceBuilder::weld_dialog(const OUString
& id
)
420 std::unique_ptr
<weld::Dialog
> pRet
;
421 ::Dialog
* pDialog
= m_xBuilder
->get
<::Dialog
>(id
);
425 if (!pDialog
->GetLOKNotifier())
426 pDialog
->SetLOKNotifier(GetpApp());
428 m_nWindowId
= pDialog
->GetLOKWindowId();
429 pDialog
->SetLOKTunnelingState(false);
431 InsertWindowToMap(getMapIdFromWindowId());
433 assert(!m_aOwnedToplevel
&& "only one toplevel per .ui allowed");
434 m_aOwnedToplevel
.set(pDialog
);
435 m_xBuilder
->drop_ownership(pDialog
);
436 m_bHasTopLevelDialog
= true;
438 pRet
.reset(new JSDialog(this, pDialog
, this, false));
440 RememberWidget(u
"__DIALOG__"_ustr
, pRet
.get());
442 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
443 m_bSentInitialUpdate
= true;
449 std::unique_ptr
<weld::Assistant
> JSInstanceBuilder::weld_assistant(const OUString
& id
)
451 vcl::RoadmapWizard
* pDialog
= m_xBuilder
->get
<vcl::RoadmapWizard
>(id
);
452 std::unique_ptr
<JSAssistant
> pRet(pDialog
? new JSAssistant(this, pDialog
, this, false)
456 m_nWindowId
= pDialog
->GetLOKWindowId();
457 pDialog
->SetLOKTunnelingState(false);
459 InsertWindowToMap(getMapIdFromWindowId());
461 assert(!m_aOwnedToplevel
&& "only one toplevel per .ui allowed");
462 m_aOwnedToplevel
.set(pDialog
);
463 m_xBuilder
->drop_ownership(pDialog
);
464 m_bHasTopLevelDialog
= true;
466 pRet
.reset(new JSAssistant(this, pDialog
, this, false));
468 RememberWidget(u
"__DIALOG__"_ustr
, pRet
.get());
470 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
471 m_bSentInitialUpdate
= true;
477 std::unique_ptr
<weld::MessageDialog
> JSInstanceBuilder::weld_message_dialog(const OUString
& id
)
479 std::unique_ptr
<weld::MessageDialog
> pRet
;
480 ::MessageDialog
* pMessageDialog
= m_xBuilder
->get
<::MessageDialog
>(id
);
484 m_nWindowId
= pMessageDialog
->GetLOKWindowId();
485 pMessageDialog
->SetLOKTunnelingState(false);
487 InsertWindowToMap(getMapIdFromWindowId());
489 assert(!m_aOwnedToplevel
&& "only one toplevel per .ui allowed");
490 m_aOwnedToplevel
.set(pMessageDialog
);
491 m_xBuilder
->drop_ownership(pMessageDialog
);
492 m_bHasTopLevelDialog
= true;
494 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
495 m_bSentInitialUpdate
= true;
498 pRet
.reset(pMessageDialog
? new JSMessageDialog(this, pMessageDialog
, this, false) : nullptr);
501 RememberWidget(u
"__DIALOG__"_ustr
, pRet
.get());
506 std::unique_ptr
<weld::Container
> JSInstanceBuilder::weld_container(const OUString
& id
)
508 vcl::Window
* pContainer
= m_xBuilder
->get
<vcl::Window
>(id
);
510 = pContainer
? std::make_unique
<JSContainer
>(this, pContainer
, this, false) : nullptr;
513 RememberWidget(id
, pWeldWidget
.get());
515 if (!m_bSentInitialUpdate
&& pContainer
)
517 m_bSentInitialUpdate
= true;
519 // use parent builder to send update - avoid multiple calls from many builders
520 vcl::Window
* pParent
= pContainer
->GetParent();
521 OUString sId
= OUString::number(m_nWindowId
);
524 auto aWidgetMap
= Widgets().Find(sId
);
525 if (!aWidgetMap
|| !aWidgetMap
->Find(pParent
->get_id()))
527 pParent
= pParent
->GetParent();
531 jsdialog::SendFullUpdate(sId
, pParent
->get_id());
533 // this is nested builder, don't close parent dialog on destroy (eg. single tab page is closed)
535 m_bIsNestedBuilder
= true;
541 std::unique_ptr
<weld::ScrolledWindow
>
542 JSInstanceBuilder::weld_scrolled_window(const OUString
& id
, bool bUserManagedScrolling
)
544 VclScrolledWindow
* pScrolledWindow
= m_xBuilder
->get
<VclScrolledWindow
>(id
);
545 auto pWeldWidget
= pScrolledWindow
546 ? std::make_unique
<JSScrolledWindow
>(this, pScrolledWindow
, this, false,
547 bUserManagedScrolling
)
551 RememberWidget(id
, pWeldWidget
.get());
556 std::unique_ptr
<weld::Label
> JSInstanceBuilder::weld_label(const OUString
& id
)
558 Control
* pLabel
= m_xBuilder
->get
<Control
>(id
);
559 auto pWeldWidget
= std::make_unique
<JSLabel
>(this, pLabel
, this, false);
562 RememberWidget(id
, pWeldWidget
.get());
567 std::unique_ptr
<weld::Button
> JSInstanceBuilder::weld_button(const OUString
& id
)
569 ::Button
* pButton
= m_xBuilder
->get
<::Button
>(id
);
570 auto pWeldWidget
= pButton
? std::make_unique
<JSButton
>(this, pButton
, this, false) : nullptr;
573 RememberWidget(id
, pWeldWidget
.get());
578 std::unique_ptr
<weld::LinkButton
> JSInstanceBuilder::weld_link_button(const OUString
& id
)
580 ::FixedHyperlink
* pButton
= m_xBuilder
->get
<::FixedHyperlink
>(id
);
582 = pButton
? std::make_unique
<JSLinkButton
>(this, pButton
, this, false) : nullptr;
585 RememberWidget(id
, pWeldWidget
.get());
590 std::unique_ptr
<weld::ToggleButton
> JSInstanceBuilder::weld_toggle_button(const OUString
& id
)
592 ::PushButton
* pButton
= m_xBuilder
->get
<::PushButton
>(id
);
594 = pButton
? std::make_unique
<JSToggleButton
>(this, pButton
, this, false) : nullptr;
597 RememberWidget(id
, pWeldWidget
.get());
602 std::unique_ptr
<weld::Entry
> JSInstanceBuilder::weld_entry(const OUString
& id
)
604 Edit
* pEntry
= m_xBuilder
->get
<Edit
>(id
);
605 auto pWeldWidget
= pEntry
? std::make_unique
<JSEntry
>(this, pEntry
, this, false) : nullptr;
608 RememberWidget(id
, pWeldWidget
.get());
613 std::unique_ptr
<weld::ComboBox
> JSInstanceBuilder::weld_combo_box(const OUString
& id
)
615 vcl::Window
* pWidget
= m_xBuilder
->get
<vcl::Window
>(id
);
616 ::ComboBox
* pComboBox
= dynamic_cast<::ComboBox
*>(pWidget
);
617 std::unique_ptr
<weld::ComboBox
> pWeldWidget
;
621 pWeldWidget
= std::make_unique
<JSComboBox
>(this, pComboBox
, this, false);
625 ListBox
* pListBox
= dynamic_cast<ListBox
*>(pWidget
);
626 pWeldWidget
= pListBox
? std::make_unique
<JSListBox
>(this, pListBox
, this, false) : nullptr;
630 RememberWidget(id
, pWeldWidget
.get());
635 std::unique_ptr
<weld::Notebook
> JSInstanceBuilder::weld_notebook(const OUString
& id
)
637 std::unique_ptr
<weld::Notebook
> pWeldWidget
;
638 vcl::Window
* pNotebook
= m_xBuilder
->get(id
);
640 if (pNotebook
&& pNotebook
->GetType() == WindowType::TABCONTROL
)
642 = std::make_unique
<JSNotebook
>(this, static_cast<TabControl
*>(pNotebook
), this, false);
643 else if (pNotebook
&& pNotebook
->GetType() == WindowType::VERTICALTABCONTROL
)
644 pWeldWidget
= std::make_unique
<JSVerticalNotebook
>(
645 this, static_cast<VerticalTabControl
*>(pNotebook
), this, false);
648 RememberWidget(id
, pWeldWidget
.get());
653 std::unique_ptr
<weld::SpinButton
> JSInstanceBuilder::weld_spin_button(const OUString
& id
)
655 FormattedField
* pSpinButton
= m_xBuilder
->get
<FormattedField
>(id
);
657 = pSpinButton
? std::make_unique
<JSSpinButton
>(this, pSpinButton
, this, false) : nullptr;
660 RememberWidget(id
, pWeldWidget
.get());
665 std::unique_ptr
<weld::FormattedSpinButton
>
666 JSInstanceBuilder::weld_formatted_spin_button(const OUString
& id
)
668 FormattedField
* pSpinButton
= m_xBuilder
->get
<FormattedField
>(id
);
669 auto pWeldWidget
= pSpinButton
670 ? std::make_unique
<JSFormattedSpinButton
>(this, pSpinButton
, this, false)
674 RememberWidget(id
, pWeldWidget
.get());
679 std::unique_ptr
<weld::CheckButton
> JSInstanceBuilder::weld_check_button(const OUString
& id
)
681 CheckBox
* pCheckButton
= m_xBuilder
->get
<CheckBox
>(id
);
683 = pCheckButton
? std::make_unique
<JSCheckButton
>(this, pCheckButton
, this, false) : nullptr;
686 RememberWidget(id
, pWeldWidget
.get());
691 std::unique_ptr
<weld::DrawingArea
>
692 JSInstanceBuilder::weld_drawing_area(const OUString
& id
, const a11yref
& rA11yImpl
,
693 FactoryFunction pUITestFactoryFunction
, void* pUserData
)
695 VclDrawingArea
* pArea
= m_xBuilder
->get
<VclDrawingArea
>(id
);
696 auto pWeldWidget
= pArea
? std::make_unique
<JSDrawingArea
>(this, pArea
, this, rA11yImpl
,
697 pUITestFactoryFunction
, pUserData
)
701 RememberWidget(id
, pWeldWidget
.get());
706 std::unique_ptr
<weld::Toolbar
> JSInstanceBuilder::weld_toolbar(const OUString
& id
)
708 ToolBox
* pToolBox
= m_xBuilder
->get
<ToolBox
>(id
);
710 = pToolBox
? std::make_unique
<JSToolbar
>(this, pToolBox
, this, false) : nullptr;
713 RememberWidget(id
, pWeldWidget
.get());
718 std::unique_ptr
<weld::TextView
> JSInstanceBuilder::weld_text_view(const OUString
& id
)
720 VclMultiLineEdit
* pTextView
= m_xBuilder
->get
<VclMultiLineEdit
>(id
);
722 = pTextView
? std::make_unique
<JSTextView
>(this, pTextView
, this, false) : nullptr;
725 RememberWidget(id
, pWeldWidget
.get());
730 std::unique_ptr
<weld::TreeView
> JSInstanceBuilder::weld_tree_view(const OUString
& id
)
732 SvTabListBox
* pTreeView
= m_xBuilder
->get
<SvTabListBox
>(id
);
734 = pTreeView
? std::make_unique
<JSTreeView
>(this, pTreeView
, this, false) : nullptr;
737 RememberWidget(id
, pWeldWidget
.get());
742 std::unique_ptr
<weld::Expander
> JSInstanceBuilder::weld_expander(const OUString
& id
)
744 VclExpander
* pExpander
= m_xBuilder
->get
<VclExpander
>(id
);
746 = pExpander
? std::make_unique
<JSExpander
>(this, pExpander
, this, false) : nullptr;
749 RememberWidget(id
, pWeldWidget
.get());
754 std::unique_ptr
<weld::IconView
> JSInstanceBuilder::weld_icon_view(const OUString
& id
)
756 ::IconView
* pIconView
= m_xBuilder
->get
<::IconView
>(id
);
758 = pIconView
? std::make_unique
<JSIconView
>(this, pIconView
, this, false) : nullptr;
761 RememberWidget(id
, pWeldWidget
.get());
766 std::unique_ptr
<weld::RadioButton
> JSInstanceBuilder::weld_radio_button(const OUString
& id
)
768 ::RadioButton
* pRadioButton
= m_xBuilder
->get
<::RadioButton
>(id
);
770 = pRadioButton
? std::make_unique
<JSRadioButton
>(this, pRadioButton
, this, false) : nullptr;
773 RememberWidget(id
, pWeldWidget
.get());
778 std::unique_ptr
<weld::Frame
> JSInstanceBuilder::weld_frame(const OUString
& id
)
780 ::VclFrame
* pFrame
= m_xBuilder
->get
<::VclFrame
>(id
);
781 auto pWeldWidget
= pFrame
? std::make_unique
<JSFrame
>(this, pFrame
, this, false) : nullptr;
784 RememberWidget(id
, pWeldWidget
.get());
789 std::unique_ptr
<weld::MenuButton
> JSInstanceBuilder::weld_menu_button(const OUString
& id
)
791 ::MenuButton
* pMenuButton
= m_xBuilder
->get
<::MenuButton
>(id
);
793 = pMenuButton
? std::make_unique
<JSMenuButton
>(this, pMenuButton
, this, false) : nullptr;
796 RememberWidget(id
, pWeldWidget
.get());
801 std::unique_ptr
<weld::Menu
> JSInstanceBuilder::weld_menu(const OUString
& id
)
803 PopupMenu
* pPopupMenu
= m_xBuilder
->get_menu(id
);
805 JSMenu
* pMenu
= pPopupMenu
? new JSMenu(this, pPopupMenu
, this, false) : nullptr;
807 std::unique_ptr
<weld::Menu
> pWeldWidget(pMenu
);
810 JSInstanceBuilder::Menus().Remember(getMapIdFromWindowId(), pWeldWidget
.get());
815 std::unique_ptr
<weld::Popover
> JSInstanceBuilder::weld_popover(const OUString
& id
)
817 DockingWindow
* pDockingWindow
= m_xBuilder
->get
<DockingWindow
>(id
);
819 = pDockingWindow
? new JSPopover(this, pDockingWindow
, this, false) : nullptr;
820 std::unique_ptr
<weld::Popover
> pWeldWidget(pPopover
);
823 assert(!m_aOwnedToplevel
&& "only one toplevel per .ui allowed");
824 m_aOwnedToplevel
.set(pDockingWindow
);
825 m_xBuilder
->drop_ownership(pDockingWindow
);
827 if (VclPtr
<vcl::Window
> pWin
= pDockingWindow
->GetParentWithLOKNotifier())
829 vcl::Window
* pPopupRoot
= pDockingWindow
->GetChild(0);
830 pPopupRoot
->SetLOKNotifier(pWin
->GetLOKNotifier());
831 m_aParentDialog
= pPopupRoot
;
832 m_aWindowToRelease
= pPopupRoot
;
833 m_nWindowId
= m_aParentDialog
->GetLOKWindowId();
835 pPopover
->set_window_id(m_nWindowId
);
836 JSInstanceBuilder::Popups().Remember(OUString::number(m_nWindowId
), pDockingWindow
);
838 InsertWindowToMap(getMapIdFromWindowId());
839 initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON());
844 RememberWidget(u
"__POPOVER__"_ustr
, pWeldWidget
.get());
849 std::unique_ptr
<weld::Box
> JSInstanceBuilder::weld_box(const OUString
& id
)
851 VclBox
* pContainer
= m_xBuilder
->get
<VclBox
>(id
);
853 = pContainer
? std::make_unique
<JSBox
>(this, pContainer
, this, false) : nullptr;
856 RememberWidget(id
, pWeldWidget
.get());
861 std::unique_ptr
<weld::Widget
> JSInstanceBuilder::weld_widget(const OUString
& id
)
863 vcl::Window
* pWidget
= m_xBuilder
->get(id
);
865 = pWidget
? std::make_unique
<JSWidgetInstance
>(this, pWidget
, this, false) : nullptr;
868 RememberWidget(id
, pWeldWidget
.get());
873 std::unique_ptr
<weld::Image
> JSInstanceBuilder::weld_image(const OUString
& id
)
875 FixedImage
* pImage
= m_xBuilder
->get
<FixedImage
>(id
);
877 auto pWeldWidget
= pImage
? std::make_unique
<JSImage
>(this, pImage
, this, false) : nullptr;
880 RememberWidget(id
, pWeldWidget
.get());
885 std::unique_ptr
<weld::LevelBar
> JSInstanceBuilder::weld_level_bar(const OUString
& id
)
887 ::ProgressBar
* pLevelBar
= m_xBuilder
->get
<::ProgressBar
>(id
);
890 = pLevelBar
? std::make_unique
<JSLevelBar
>(this, pLevelBar
, this, false) : nullptr;
893 RememberWidget(id
, pWeldWidget
.get());
898 std::unique_ptr
<weld::Calendar
> JSInstanceBuilder::weld_calendar(const OUString
& id
)
900 ::Calendar
* pCalendar
= m_xBuilder
->get
<::Calendar
>(id
);
903 = pCalendar
? std::make_unique
<JSCalendar
>(this, pCalendar
, this, false) : nullptr;
906 RememberWidget(id
, pWeldWidget
.get());
912 JSInstanceBuilder::CreateMessageDialog(weld::Widget
* pParent
, VclMessageType eMessageType
,
913 VclButtonsType eButtonType
, const OUString
& rPrimaryMessage
,
914 const vcl::ILibreOfficeKitNotifier
* pNotifier
)
916 SalInstanceWidget
* pParentInstance
= dynamic_cast<SalInstanceWidget
*>(pParent
);
917 SystemWindow
* pParentWidget
= pParentInstance
? pParentInstance
->getSystemWindow() : nullptr;
918 VclPtrInstance
<::MessageDialog
> xMessageDialog(pParentWidget
, rPrimaryMessage
, eMessageType
,
922 xMessageDialog
->SetLOKNotifier(pNotifier
);
924 pNotifier
= xMessageDialog
->GetLOKNotifier();
927 OUString sWindowId
= OUString::number(xMessageDialog
->GetLOKWindowId());
928 InsertWindowToMap(sWindowId
);
929 xMessageDialog
->SetLOKTunnelingState(false);
931 return new JSMessageDialog(xMessageDialog
, nullptr, true);
934 SAL_WARN("vcl", "No notifier in JSInstanceBuilder::CreateMessageDialog");
936 return new JSMessageDialog(xMessageDialog
, nullptr, true);
939 JSDialog::JSDialog(JSDialogSender
* pSender
, ::Dialog
* pDialog
, SalInstanceBuilder
* pBuilder
,
941 : JSWidget
<SalInstanceDialog
, ::Dialog
>(pSender
, pDialog
, pBuilder
, bTakeOwnership
)
945 void JSDialog::collapse(weld::Widget
* pEdit
, weld::Widget
* pButton
)
947 SalInstanceDialog::collapse(pEdit
, pButton
);
951 void JSDialog::undo_collapse()
953 SalInstanceDialog::undo_collapse();
957 void JSDialog::response(int response
)
959 if (response
== RET_HELP
)
961 response_help(m_xWidget
.get());
966 SalInstanceDialog::response(response
);
969 void JSAssistant::response(int response
)
971 if (response
== RET_HELP
)
973 response_help(m_xWidget
.get());
978 SalInstanceAssistant::response(response
);
983 sendFullUpdate(true);
984 int ret
= SalInstanceDialog::run();
988 bool JSDialog::runAsync(std::shared_ptr
<weld::DialogController
> const& rxOwner
,
989 const std::function
<void(sal_Int32
)>& rEndDialogFn
)
991 bool ret
= SalInstanceDialog::runAsync(rxOwner
, rEndDialogFn
);
996 bool JSDialog::runAsync(std::shared_ptr
<Dialog
> const& rxSelf
,
997 const std::function
<void(sal_Int32
)>& func
)
999 bool ret
= SalInstanceDialog::runAsync(rxSelf
, func
);
1004 int JSAssistant::run()
1006 sendFullUpdate(true);
1007 int ret
= SalInstanceDialog::run();
1011 bool JSAssistant::runAsync(std::shared_ptr
<weld::DialogController
> const& rxOwner
,
1012 const std::function
<void(sal_Int32
)>& rEndDialogFn
)
1014 bool ret
= SalInstanceDialog::runAsync(rxOwner
, rEndDialogFn
);
1019 bool JSAssistant::runAsync(std::shared_ptr
<Dialog
> const& rxSelf
,
1020 const std::function
<void(sal_Int32
)>& func
)
1022 bool ret
= SalInstanceDialog::runAsync(rxSelf
, func
);
1027 std::unique_ptr
<weld::Button
> JSDialog::weld_button_for_response(int nResponse
)
1029 std::unique_ptr
<weld::Button
> xWeldWidget
;
1030 if (PushButton
* pButton
1031 = dynamic_cast<::PushButton
*>(m_xDialog
->get_widget_for_response(nResponse
)))
1033 xWeldWidget
= std::make_unique
<JSButton
>(m_pSender
, pButton
, nullptr, false);
1035 auto pParentDialog
= m_xDialog
->GetParentWithLOKNotifier();
1037 JSInstanceBuilder::RememberWidget(OUString::number(pParentDialog
->GetLOKWindowId()),
1038 pButton
->get_id(), xWeldWidget
.get());
1044 std::unique_ptr
<weld::Button
> JSAssistant::weld_button_for_response(int nResponse
)
1046 ::PushButton
* pButton
= nullptr;
1047 std::unique_ptr
<JSButton
> xWeldWidget
;
1048 if (nResponse
== RET_YES
)
1049 pButton
= m_xWizard
->m_pNextPage
;
1050 else if (nResponse
== RET_NO
)
1051 pButton
= m_xWizard
->m_pPrevPage
;
1052 else if (nResponse
== RET_OK
)
1053 pButton
= m_xWizard
->m_pFinish
;
1054 else if (nResponse
== RET_CANCEL
)
1055 pButton
= m_xWizard
->m_pCancel
;
1056 else if (nResponse
== RET_HELP
)
1057 pButton
= m_xWizard
->m_pHelp
;
1061 xWeldWidget
= std::make_unique
<JSButton
>(m_pSender
, pButton
, nullptr, false);
1063 auto pParentDialog
= m_xWizard
->GetParentWithLOKNotifier();
1065 JSInstanceBuilder::RememberWidget(OUString::number(pParentDialog
->GetLOKWindowId()),
1066 pButton
->get_id(), xWeldWidget
.get());
1072 JSAssistant::JSAssistant(JSDialogSender
* pSender
, vcl::RoadmapWizard
* pDialog
,
1073 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1074 : JSWidget
<SalInstanceAssistant
, vcl::RoadmapWizard
>(pSender
, pDialog
, pBuilder
, bTakeOwnership
)
1078 void JSAssistant::set_current_page(int nPage
)
1080 SalInstanceAssistant::set_current_page(nPage
);
1084 void JSAssistant::set_current_page(const OUString
& rIdent
)
1086 SalInstanceAssistant::set_current_page(rIdent
);
1090 JSContainer::JSContainer(JSDialogSender
* pSender
, vcl::Window
* pContainer
,
1091 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1092 : JSWidget
<SalInstanceContainer
, vcl::Window
>(pSender
, pContainer
, pBuilder
, bTakeOwnership
)
1096 void JSContainer::move(weld::Widget
* pWidget
, weld::Container
* pNewParent
)
1098 SalInstanceContainer::move(pWidget
, pNewParent
);
1102 JSScrolledWindow::JSScrolledWindow(JSDialogSender
* pSender
, ::VclScrolledWindow
* pContainer
,
1103 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
,
1104 bool bUserManagedScrolling
)
1105 : JSWidget
<SalInstanceScrolledWindow
, ::VclScrolledWindow
>(
1106 pSender
, pContainer
, pBuilder
, bTakeOwnership
, bUserManagedScrolling
)
1110 void JSScrolledWindow::vadjustment_configure(int value
, int lower
, int upper
, int step_increment
,
1111 int page_increment
, int page_size
)
1113 SalInstanceScrolledWindow::vadjustment_configure(value
, lower
, upper
, step_increment
,
1114 page_increment
, page_size
);
1118 void JSScrolledWindow::vadjustment_set_value(int value
)
1120 SalInstanceScrolledWindow::vadjustment_set_value(value
);
1124 void JSScrolledWindow::vadjustment_set_value_no_notification(int value
)
1126 SalInstanceScrolledWindow::vadjustment_set_value(value
);
1129 void JSScrolledWindow::vadjustment_set_page_size(int size
)
1131 SalInstanceScrolledWindow::vadjustment_set_page_size(size
);
1135 void JSScrolledWindow::set_vpolicy(VclPolicyType eVPolicy
)
1137 SalInstanceScrolledWindow::set_vpolicy(eVPolicy
);
1141 void JSScrolledWindow::hadjustment_configure(int value
, int lower
, int upper
, int step_increment
,
1142 int page_increment
, int page_size
)
1144 SalInstanceScrolledWindow::hadjustment_configure(value
, lower
, upper
, step_increment
,
1145 page_increment
, page_size
);
1149 void JSScrolledWindow::hadjustment_set_value(int value
)
1151 SalInstanceScrolledWindow::hadjustment_set_value(value
);
1155 void JSScrolledWindow::hadjustment_set_value_no_notification(int value
)
1157 SalInstanceScrolledWindow::hadjustment_set_value(value
);
1160 void JSScrolledWindow::hadjustment_set_page_size(int size
)
1162 SalInstanceScrolledWindow::hadjustment_set_page_size(size
);
1166 void JSScrolledWindow::set_hpolicy(VclPolicyType eVPolicy
)
1168 SalInstanceScrolledWindow::set_hpolicy(eVPolicy
);
1172 JSLabel::JSLabel(JSDialogSender
* pSender
, Control
* pLabel
, SalInstanceBuilder
* pBuilder
,
1173 bool bTakeOwnership
)
1174 : JSWidget
<SalInstanceLabel
, Control
>(pSender
, pLabel
, pBuilder
, bTakeOwnership
)
1178 void JSLabel::set_label(const OUString
& rText
)
1180 SalInstanceLabel::set_label(rText
);
1184 JSButton::JSButton(JSDialogSender
* pSender
, ::Button
* pButton
, SalInstanceBuilder
* pBuilder
,
1185 bool bTakeOwnership
)
1186 : JSWidget
<SalInstanceButton
, ::Button
>(pSender
, pButton
, pBuilder
, bTakeOwnership
)
1190 JSLinkButton::JSLinkButton(JSDialogSender
* pSender
, ::FixedHyperlink
* pButton
,
1191 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1192 : JSWidget
<SalInstanceLinkButton
, ::FixedHyperlink
>(pSender
, pButton
, pBuilder
, bTakeOwnership
)
1196 JSToggleButton::JSToggleButton(JSDialogSender
* pSender
, ::PushButton
* pButton
,
1197 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1198 : JSWidget
<SalInstanceToggleButton
, ::PushButton
>(pSender
, pButton
, pBuilder
, bTakeOwnership
)
1202 JSEntry::JSEntry(JSDialogSender
* pSender
, ::Edit
* pEntry
, SalInstanceBuilder
* pBuilder
,
1203 bool bTakeOwnership
)
1204 : JSWidget
<SalInstanceEntry
, ::Edit
>(pSender
, pEntry
, pBuilder
, bTakeOwnership
)
1208 void JSEntry::set_text(const OUString
& rText
)
1210 SalInstanceEntry::set_text(rText
);
1214 void JSEntry::set_text_without_notify(const OUString
& rText
) { SalInstanceEntry::set_text(rText
); }
1216 void JSEntry::replace_selection(const OUString
& rText
)
1218 SalInstanceEntry::replace_selection(rText
);
1222 JSListBox::JSListBox(JSDialogSender
* pSender
, ::ListBox
* pListBox
, SalInstanceBuilder
* pBuilder
,
1223 bool bTakeOwnership
)
1224 : JSWidget
<SalInstanceComboBoxWithoutEdit
, ::ListBox
>(pSender
, pListBox
, pBuilder
,
1229 void JSListBox::insert(int pos
, const OUString
& rStr
, const OUString
* pId
,
1230 const OUString
* pIconName
, VirtualDevice
* pImageSurface
)
1232 SalInstanceComboBoxWithoutEdit::insert(pos
, rStr
, pId
, pIconName
, pImageSurface
);
1236 void JSListBox::remove(int pos
)
1238 SalInstanceComboBoxWithoutEdit::remove(pos
);
1242 void JSListBox::set_active(int pos
)
1244 SalInstanceComboBoxWithoutEdit::set_active(pos
);
1248 JSComboBox::JSComboBox(JSDialogSender
* pSender
, ::ComboBox
* pComboBox
, SalInstanceBuilder
* pBuilder
,
1249 bool bTakeOwnership
)
1250 : JSWidget
<SalInstanceComboBoxWithEdit
, ::ComboBox
>(pSender
, pComboBox
, pBuilder
,
1255 void JSComboBox::insert(int pos
, const OUString
& rStr
, const OUString
* pId
,
1256 const OUString
* pIconName
, VirtualDevice
* pImageSurface
)
1258 SalInstanceComboBoxWithEdit::insert(pos
, rStr
, pId
, pIconName
, pImageSurface
);
1262 void JSComboBox::remove(int pos
)
1264 SalInstanceComboBoxWithEdit::remove(pos
);
1268 void JSComboBox::set_entry_text_without_notify(const OUString
& rText
)
1270 SalInstanceComboBoxWithEdit::set_entry_text(rText
);
1273 void JSComboBox::set_entry_text(const OUString
& rText
)
1275 SalInstanceComboBoxWithEdit::set_entry_text(rText
);
1277 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1278 (*pMap
)[ACTION_TYPE
""_ostr
] = "setText";
1279 (*pMap
)["text"_ostr
] = rText
;
1280 sendAction(std::move(pMap
));
1283 void JSComboBox::set_active(int pos
)
1285 if (pos
== get_active())
1288 SalInstanceComboBoxWithEdit::set_active(pos
);
1290 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1291 (*pMap
)[ACTION_TYPE
""_ostr
] = "select";
1292 (*pMap
)["position"_ostr
] = OUString::number(pos
);
1293 sendAction(std::move(pMap
));
1296 void JSComboBox::set_active_id(const OUString
& rStr
)
1298 sal_uInt16 nPos
= find_id(rStr
);
1302 bool JSComboBox::changed_by_direct_pick() const { return true; }
1304 void JSComboBox::render_entry(int pos
, int dpix
, int dpiy
)
1306 ScopedVclPtrInstance
<VirtualDevice
> pDevice(DeviceFormat::WITH_ALPHA
);
1307 pDevice
->SetDPIX(96.0 * dpix
/ 100);
1308 pDevice
->SetDPIY(96.0 * dpiy
/ 100);
1310 Size aRenderSize
= signal_custom_get_size(*pDevice
);
1311 pDevice
->SetOutputSize(aRenderSize
);
1313 signal_custom_render(*pDevice
, tools::Rectangle(Point(0, 0), aRenderSize
), false, get_id(pos
));
1315 BitmapEx aImage
= pDevice
->GetBitmapEx(Point(0, 0), aRenderSize
);
1317 SvMemoryStream
aOStm(65535, 65535);
1318 if (GraphicConverter::Export(aOStm
, aImage
, ConvertDataFormat::PNG
) == ERRCODE_NONE
)
1320 css::uno::Sequence
<sal_Int8
> aSeq(static_cast<sal_Int8
const*>(aOStm
.GetData()),
1322 OUStringBuffer
aBuffer("data:image/png;base64,");
1323 ::comphelper::Base64::encode(aBuffer
, aSeq
);
1325 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1326 (*pMap
)[ACTION_TYPE
""_ostr
] = "rendered_entry";
1327 (*pMap
)["pos"_ostr
] = OUString::number(pos
);
1328 (*pMap
)["image"_ostr
] = aBuffer
;
1329 sendAction(std::move(pMap
));
1333 JSNotebook::JSNotebook(JSDialogSender
* pSender
, ::TabControl
* pControl
,
1334 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1335 : JSWidget
<SalInstanceNotebook
, ::TabControl
>(pSender
, pControl
, pBuilder
, bTakeOwnership
)
1339 void JSNotebook::remove_page(const OUString
& rIdent
)
1341 SalInstanceNotebook::remove_page(rIdent
);
1345 void JSNotebook::insert_page(const OUString
& rIdent
, const OUString
& rLabel
, int nPos
)
1347 SalInstanceNotebook::insert_page(rIdent
, rLabel
, nPos
);
1351 JSVerticalNotebook::JSVerticalNotebook(JSDialogSender
* pSender
, ::VerticalTabControl
* pControl
,
1352 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1353 : JSWidget
<SalInstanceVerticalNotebook
, ::VerticalTabControl
>(pSender
, pControl
, pBuilder
,
1358 void JSVerticalNotebook::remove_page(const OUString
& rIdent
)
1360 SalInstanceVerticalNotebook::remove_page(rIdent
);
1364 void JSVerticalNotebook::insert_page(const OUString
& rIdent
, const OUString
& rLabel
, int nPos
)
1366 SalInstanceVerticalNotebook::insert_page(rIdent
, rLabel
, nPos
);
1370 JSSpinButton::JSSpinButton(JSDialogSender
* pSender
, ::FormattedField
* pSpin
,
1371 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1372 : JSWidget
<SalInstanceSpinButton
, ::FormattedField
>(pSender
, pSpin
, pBuilder
, bTakeOwnership
)
1376 void JSSpinButton::set_value(sal_Int64 value
)
1378 SalInstanceSpinButton::set_value(value
);
1380 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1381 (*pMap
)[ACTION_TYPE
""_ostr
] = "setText";
1382 (*pMap
)["text"_ostr
] = OUString::number(m_rFormatter
.GetValue());
1383 sendAction(std::move(pMap
));
1386 void JSSpinButton::set_range(sal_Int64 min
, sal_Int64 max
)
1388 SalInstanceSpinButton::set_range(min
, max
);
1392 JSFormattedSpinButton::JSFormattedSpinButton(JSDialogSender
* pSender
, ::FormattedField
* pSpin
,
1393 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1394 : JSWidget
<SalInstanceFormattedSpinButton
, ::FormattedField
>(pSender
, pSpin
, pBuilder
,
1399 void JSFormattedSpinButton::set_text(const OUString
& rText
)
1401 SalInstanceFormattedSpinButton::set_text(rText
);
1405 void JSFormattedSpinButton::set_text_without_notify(const OUString
& rText
)
1407 SalInstanceFormattedSpinButton::set_text(rText
);
1410 JSMessageDialog::JSMessageDialog(JSDialogSender
* pSender
, ::MessageDialog
* pDialog
,
1411 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1412 : JSWidget
<SalInstanceMessageDialog
, ::MessageDialog
>(pSender
, pDialog
, pBuilder
,
1417 JSMessageDialog::JSMessageDialog(::MessageDialog
* pDialog
, SalInstanceBuilder
* pBuilder
,
1418 bool bTakeOwnership
)
1419 : JSWidget
<SalInstanceMessageDialog
, ::MessageDialog
>(nullptr, pDialog
, pBuilder
,
1421 , m_pOwnedSender(new JSDialogSender(pDialog
, pDialog
, u
"dialog"_ustr
))
1423 m_pSender
= m_pOwnedSender
.get();
1428 m_sWindowId
= OUString::number(m_xMessageDialog
->GetLOKWindowId());
1430 if (::OKButton
* pOKBtn
1431 = dynamic_cast<::OKButton
*>(m_xMessageDialog
->get_widget_for_response(RET_OK
)))
1433 m_pOK
.reset(new JSButton(m_pSender
, pOKBtn
, nullptr, false));
1434 JSInstanceBuilder::RememberWidget(m_sWindowId
, pOKBtn
->get_id(), m_pOK
.get());
1435 m_pOK
->connect_clicked(LINK(this, JSMessageDialog
, OKHdl
));
1438 if (::CancelButton
* pCancelBtn
1439 = dynamic_cast<::CancelButton
*>(m_xMessageDialog
->get_widget_for_response(RET_CANCEL
)))
1441 m_pCancel
.reset(new JSButton(m_pSender
, pCancelBtn
, nullptr, false));
1442 JSInstanceBuilder::RememberWidget(m_sWindowId
, pCancelBtn
->get_id(), m_pCancel
.get());
1443 m_pCancel
->connect_clicked(LINK(this, JSMessageDialog
, CancelHdl
));
1447 JSMessageDialog::~JSMessageDialog()
1451 // For Message Dialogs created from Application::CreateMessageDialog
1452 // (where there is no builder to take care of this for us) explicitly
1453 // remove this window id on tear down
1454 JSInstanceBuilder::Widgets().Forget(m_sWindowId
);
1458 void JSMessageDialog::RememberMessageDialog()
1460 static constexpr OUString sWidgetName
= u
"__DIALOG__"_ustr
;
1461 OUString sWindowId
= OUString::number(m_xMessageDialog
->GetLOKWindowId());
1462 auto aWidgetMap
= JSInstanceBuilder::Widgets().Find(sWindowId
);
1463 if (aWidgetMap
&& aWidgetMap
->Find(sWidgetName
))
1466 JSInstanceBuilder::InsertWindowToMap(sWindowId
);
1467 JSInstanceBuilder::RememberWidget(sWindowId
, sWidgetName
, this);
1470 int JSMessageDialog::run()
1472 if (GetLOKNotifier())
1474 RememberMessageDialog();
1478 int bRet
= SalInstanceMessageDialog::run();
1482 bool JSMessageDialog::runAsync(std::shared_ptr
<weld::DialogController
> const& rxOwner
,
1483 const std::function
<void(sal_Int32
)>& rEndDialogFn
)
1485 bool bRet
= SalInstanceMessageDialog::runAsync(rxOwner
, rEndDialogFn
);
1487 RememberMessageDialog();
1493 bool JSMessageDialog::runAsync(std::shared_ptr
<Dialog
> const& rxSelf
,
1494 const std::function
<void(sal_Int32
)>& rEndDialogFn
)
1496 bool bRet
= SalInstanceMessageDialog::runAsync(rxSelf
, rEndDialogFn
);
1498 RememberMessageDialog();
1504 IMPL_LINK_NOARG(JSMessageDialog
, OKHdl
, weld::Button
&, void) { response(RET_OK
); }
1506 IMPL_LINK_NOARG(JSMessageDialog
, CancelHdl
, weld::Button
&, void) { response(RET_CANCEL
); }
1508 void JSMessageDialog::set_primary_text(const OUString
& rText
)
1510 SalInstanceMessageDialog::set_primary_text(rText
);
1514 void JSMessageDialog::set_secondary_text(const OUString
& rText
)
1516 SalInstanceMessageDialog::set_secondary_text(rText
);
1520 void JSMessageDialog::response(int response
)
1522 if (response
== RET_HELP
)
1524 response_help(m_xWidget
.get());
1529 SalInstanceMessageDialog::response(response
);
1532 JSCheckButton::JSCheckButton(JSDialogSender
* pSender
, ::CheckBox
* pCheckBox
,
1533 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1534 : JSWidget
<SalInstanceCheckButton
, ::CheckBox
>(pSender
, pCheckBox
, pBuilder
, bTakeOwnership
)
1538 void JSCheckButton::set_active(bool active
)
1540 bool bWasActive
= get_active();
1541 SalInstanceCheckButton::set_active(active
);
1542 if (bWasActive
!= active
)
1546 JSDrawingArea::JSDrawingArea(JSDialogSender
* pSender
, VclDrawingArea
* pDrawingArea
,
1547 SalInstanceBuilder
* pBuilder
, const a11yref
& rAlly
,
1548 FactoryFunction pUITestFactoryFunction
, void* pUserData
)
1549 : JSWidget
<SalInstanceDrawingArea
, VclDrawingArea
>(pSender
, pDrawingArea
, pBuilder
, rAlly
,
1550 std::move(pUITestFactoryFunction
), pUserData
,
1555 void JSDrawingArea::queue_draw()
1557 SalInstanceDrawingArea::queue_draw();
1561 void JSDrawingArea::queue_draw_area(int x
, int y
, int width
, int height
)
1563 SalInstanceDrawingArea::queue_draw_area(x
, y
, width
, height
);
1567 JSToolbar::JSToolbar(JSDialogSender
* pSender
, ::ToolBox
* pToolbox
, SalInstanceBuilder
* pBuilder
,
1568 bool bTakeOwnership
)
1569 : JSWidget
<SalInstanceToolbar
, ::ToolBox
>(pSender
, pToolbox
, pBuilder
, bTakeOwnership
)
1573 void JSToolbar::set_menu_item_active(const OUString
& rIdent
, bool bActive
)
1575 bool bWasActive
= get_menu_item_active(rIdent
);
1576 SalInstanceToolbar::set_menu_item_active(rIdent
, bActive
);
1578 ToolBoxItemId nItemId
= m_xToolBox
->GetItemId(rIdent
);
1579 VclPtr
<vcl::Window
> pFloat
= m_aFloats
[nItemId
];
1584 // See WeldToolbarPopup : include/svtools/toolbarmenu.hxx
1585 // TopLevel (Popover) -> Container -> main container of the popup
1586 vcl::Window
* pPopupRoot
= pFloat
->GetChild(0);
1588 pPopupRoot
= pPopupRoot
->GetChild(0);
1594 JSInstanceBuilder::Popups().Remember(OUString::number(pPopupRoot
->GetLOKWindowId()),
1596 sendPopup(pPopupRoot
, m_xToolBox
->get_id(), rIdent
);
1598 else if (bWasActive
)
1600 JSInstanceBuilder::Popups().Forget(OUString::number(pPopupRoot
->GetLOKWindowId()));
1601 sendClosePopup(pPopupRoot
->GetLOKWindowId());
1606 void JSToolbar::set_item_sensitive(const OUString
& rIdent
, bool bSensitive
)
1608 bool bWasSensitive
= get_item_sensitive(rIdent
);
1609 SalInstanceToolbar::set_item_sensitive(rIdent
, bSensitive
);
1610 if (bWasSensitive
!= bSensitive
)
1614 void JSToolbar::set_item_icon_name(const OUString
& rIdent
, const OUString
& rIconName
)
1616 SalInstanceToolbar::set_item_icon_name(rIdent
, rIconName
);
1620 JSTextView::JSTextView(JSDialogSender
* pSender
, ::VclMultiLineEdit
* pTextView
,
1621 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1622 : JSWidget
<SalInstanceTextView
, ::VclMultiLineEdit
>(pSender
, pTextView
, pBuilder
,
1627 void JSTextView::set_text(const OUString
& rText
)
1629 SalInstanceTextView::set_text(rText
);
1633 void JSTextView::set_text_without_notify(const OUString
& rText
)
1635 SalInstanceTextView::set_text(rText
);
1638 void JSTextView::replace_selection(const OUString
& rText
)
1640 SalInstanceTextView::replace_selection(rText
);
1644 JSTreeView::JSTreeView(JSDialogSender
* pSender
, ::SvTabListBox
* pTreeView
,
1645 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1646 : JSWidget
<SalInstanceTreeView
, ::SvTabListBox
>(pSender
, pTreeView
, pBuilder
, bTakeOwnership
)
1650 void JSTreeView::set_toggle(int pos
, TriState eState
, int col
)
1652 SvTreeListEntry
* pEntry
= m_xTreeView
->GetEntry(nullptr, 0);
1654 while (pEntry
&& pos
--)
1655 pEntry
= m_xTreeView
->Next(pEntry
);
1659 SalInstanceTreeView::set_toggle(pEntry
, eState
, col
);
1660 signal_toggled(iter_col(SalInstanceTreeIter(pEntry
), col
));
1666 void JSTreeView::set_toggle(const weld::TreeIter
& rIter
, TriState bOn
, int col
)
1668 SalInstanceTreeView::set_toggle(rIter
, bOn
, col
);
1672 void JSTreeView::set_sensitive(int pos
, bool bSensitive
, int col
)
1674 SvTreeListEntry
* pEntry
= m_xTreeView
->GetEntry(nullptr, 0);
1676 while (pEntry
&& pos
--)
1677 pEntry
= m_xTreeView
->Next(pEntry
);
1681 SalInstanceTreeView::set_sensitive(pEntry
, bSensitive
, col
);
1686 void JSTreeView::set_sensitive(const weld::TreeIter
& rIter
, bool bSensitive
, int col
)
1688 SalInstanceTreeView::set_sensitive(rIter
, bSensitive
, col
);
1692 void JSTreeView::select(int pos
)
1694 assert(m_xTreeView
->IsUpdateMode() && "don't select when frozen");
1695 disable_notify_events();
1696 if (pos
== -1 || (pos
== 0 && n_children() == 0))
1697 m_xTreeView
->SelectAll(false);
1700 SvTreeListEntry
* pEntry
= m_xTreeView
->GetEntry(nullptr, 0);
1702 while (pEntry
&& pos
--)
1703 pEntry
= m_xTreeView
->Next(pEntry
);
1707 m_xTreeView
->Select(pEntry
, true);
1708 m_xTreeView
->MakeVisible(pEntry
);
1711 enable_notify_events();
1713 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1714 (*pMap
)[ACTION_TYPE
""_ostr
] = "select";
1715 (*pMap
)["position"_ostr
] = OUString::number(pos
);
1716 sendAction(std::move(pMap
));
1719 weld::TreeView
* JSTreeView::get_drag_source() const { return g_DragSource
; }
1721 void JSTreeView::drag_start() { g_DragSource
= this; }
1723 void JSTreeView::drag_end()
1725 css::datatransfer::dnd::XDropTarget
* xDropTarget
= m_xDropTarget
.get();
1728 css::datatransfer::dnd::DropTargetDropEvent aEvent
;
1729 aEvent
.Source
= xDropTarget
;
1730 aEvent
.Context
= new JSDropTargetDropContext();
1732 aEvent
.LocationX
= 50;
1733 aEvent
.LocationY
= 50;
1734 aEvent
.DropAction
= css::datatransfer::dnd::DNDConstants::ACTION_DEFAULT
;
1735 aEvent
.SourceActions
= css::datatransfer::dnd::DNDConstants::ACTION_DEFAULT
;
1737 m_xDropTarget
->fire_drop(aEvent
);
1741 g_DragSource
->sendUpdate();
1744 g_DragSource
= nullptr;
1747 void JSTreeView::insert(const weld::TreeIter
* pParent
, int pos
, const OUString
* pStr
,
1748 const OUString
* pId
, const OUString
* pIconName
,
1749 VirtualDevice
* pImageSurface
, bool bChildrenOnDemand
, weld::TreeIter
* pRet
)
1751 SalInstanceTreeView::insert(pParent
, pos
, pStr
, pId
, pIconName
, pImageSurface
,
1752 bChildrenOnDemand
, pRet
);
1757 void JSTreeView::set_text(int row
, const OUString
& rText
, int col
)
1759 SalInstanceTreeView::set_text(row
, rText
, col
);
1763 void JSTreeView::set_text(const weld::TreeIter
& rIter
, const OUString
& rStr
, int col
)
1765 SalInstanceTreeView::set_text(rIter
, rStr
, col
);
1769 void JSTreeView::remove(int pos
)
1771 SalInstanceTreeView::remove(pos
);
1775 void JSTreeView::remove(const weld::TreeIter
& rIter
)
1777 SalInstanceTreeView::remove(rIter
);
1781 void JSTreeView::clear()
1783 SalInstanceTreeView::clear();
1787 void JSTreeView::set_cursor_without_notify(const weld::TreeIter
& rIter
)
1789 SalInstanceTreeView::set_cursor(rIter
);
1792 void JSTreeView::set_cursor(const weld::TreeIter
& rIter
)
1794 SalInstanceTreeView::set_cursor(rIter
);
1798 void JSTreeView::set_cursor(int pos
)
1800 SalInstanceTreeView::set_cursor(pos
);
1804 void JSTreeView::expand_row(const weld::TreeIter
& rIter
)
1806 bool bNotify
= false;
1807 const SalInstanceTreeIter
& rVclIter
= static_cast<const SalInstanceTreeIter
&>(rIter
);
1808 if (!m_xTreeView
->IsExpanded(rVclIter
.iter
))
1811 SalInstanceTreeView::expand_row(rIter
);
1817 void JSTreeView::collapse_row(const weld::TreeIter
& rIter
)
1819 bool bNotify
= false;
1820 const SalInstanceTreeIter
& rVclIter
= static_cast<const SalInstanceTreeIter
&>(rIter
);
1821 if (m_xTreeView
->IsExpanded(rVclIter
.iter
))
1824 SalInstanceTreeView::collapse_row(rIter
);
1830 JSExpander::JSExpander(JSDialogSender
* pSender
, ::VclExpander
* pExpander
,
1831 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1832 : JSWidget
<SalInstanceExpander
, ::VclExpander
>(pSender
, pExpander
, pBuilder
, bTakeOwnership
)
1836 void JSExpander::set_expanded(bool bExpand
)
1838 SalInstanceExpander::set_expanded(bExpand
);
1842 JSIconView::JSIconView(JSDialogSender
* pSender
, ::IconView
* pIconView
, SalInstanceBuilder
* pBuilder
,
1843 bool bTakeOwnership
)
1844 : JSWidget
<SalInstanceIconView
, ::IconView
>(pSender
, pIconView
, pBuilder
, bTakeOwnership
)
1848 void JSIconView::insert(int pos
, const OUString
* pStr
, const OUString
* pId
,
1849 const OUString
* pIconName
, weld::TreeIter
* pRet
)
1851 SalInstanceIconView::insert(pos
, pStr
, pId
, pIconName
, pRet
);
1855 void JSIconView::insert(int pos
, const OUString
* pStr
, const OUString
* pId
,
1856 const VirtualDevice
* pIcon
, weld::TreeIter
* pRet
)
1858 SalInstanceIconView::insert(pos
, pStr
, pId
, pIcon
, pRet
);
1862 void JSIconView::insert_separator(int pos
, const OUString
* pId
)
1864 SalInstanceIconView::insert_separator(pos
, pId
);
1868 void JSIconView::clear()
1870 SalInstanceIconView::clear();
1874 void JSIconView::select(int pos
)
1876 SalInstanceIconView::select(pos
);
1878 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1879 (*pMap
)[ACTION_TYPE
""_ostr
] = "select";
1880 (*pMap
)["position"_ostr
] = OUString::number(pos
);
1881 sendAction(std::move(pMap
));
1884 void JSIconView::unselect(int pos
)
1886 SalInstanceIconView::unselect(pos
);
1890 void JSIconView::render_entry(int pos
, int dpix
, int dpiy
)
1892 OUString sImage
= m_xIconView
->renderEntry(pos
, dpix
, dpiy
);
1893 if (sImage
.isEmpty())
1896 std::unique_ptr
<jsdialog::ActionDataMap
> pMap
= std::make_unique
<jsdialog::ActionDataMap
>();
1897 (*pMap
)[ACTION_TYPE
""_ostr
] = "rendered_entry";
1898 (*pMap
)["pos"_ostr
] = OUString::number(pos
);
1899 (*pMap
)["image"_ostr
] = sImage
;
1900 sendAction(std::move(pMap
));
1903 JSRadioButton::JSRadioButton(JSDialogSender
* pSender
, ::RadioButton
* pRadioButton
,
1904 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1905 : JSWidget
<SalInstanceRadioButton
, ::RadioButton
>(pSender
, pRadioButton
, pBuilder
,
1910 void JSRadioButton::set_active(bool active
)
1912 SalInstanceRadioButton::set_active(active
);
1916 JSFrame::JSFrame(JSDialogSender
* pSender
, ::VclFrame
* pFrame
, SalInstanceBuilder
* pBuilder
,
1917 bool bTakeOwnership
)
1918 : JSWidget
<SalInstanceFrame
, ::VclFrame
>(pSender
, pFrame
, pBuilder
, bTakeOwnership
)
1922 JSMenuButton::JSMenuButton(JSDialogSender
* pSender
, ::MenuButton
* pMenuButton
,
1923 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1924 : JSWidget
<SalInstanceMenuButton
, ::MenuButton
>(pSender
, pMenuButton
, pBuilder
, bTakeOwnership
)
1928 void JSMenuButton::set_label(const OUString
& rText
)
1930 OUString aPreviousLabel
= get_label();
1931 SalInstanceMenuButton::set_label(rText
);
1932 if (aPreviousLabel
!= rText
)
1936 void JSMenuButton::set_image(VirtualDevice
* pDevice
)
1938 SalInstanceMenuButton::set_image(pDevice
);
1942 void JSMenuButton::set_image(const css::uno::Reference
<css::graphic::XGraphic
>& rImage
)
1944 SalInstanceMenuButton::set_image(rImage
);
1948 void JSMenuButton::set_active(bool bActive
)
1950 SalInstanceMenuButton::set_active(bActive
);
1952 VclPtr
<vcl::Window
> pPopup
= m_xMenuButton
->GetPopover();
1956 sendPopup(pPopup
->GetChild(0), m_xMenuButton
->get_id(), m_xMenuButton
->get_id());
1958 sendClosePopup(pPopup
->GetChild(0)->GetLOKWindowId());
1962 JSMenu::JSMenu(JSDialogSender
* pSender
, PopupMenu
* pPopupMenu
, SalInstanceBuilder
* /*pBuilder*/,
1963 bool bTakeOwnership
)
1964 : SalInstanceMenu(pPopupMenu
, bTakeOwnership
)
1965 , m_pPopupMenu(pPopupMenu
)
1966 , m_pSender(pSender
)
1970 OUString
JSMenu::popup_at_rect(weld::Widget
* pParent
, const tools::Rectangle
& rRect
,
1971 weld::Placement
/*ePlace*/)
1973 // Do not block with SalInstanceMenu::popup_at_rect(pParent, rRect, ePlace);
1975 // we find position based on parent widget id and row text inside TreeView for context menu
1977 weld::TreeView
* pTree
= dynamic_cast<weld::TreeView
*>(pParent
);
1980 std::unique_ptr
<weld::TreeIter
> itEntry(pTree
->make_iterator());
1981 if (pTree
->get_dest_row_at_pos(rRect
.Center(), itEntry
.get(), false, false))
1982 sCancelId
= pTree
->get_text(*itEntry
);
1985 m_pSender
->sendMenu(m_pPopupMenu
, pParent
? pParent
->get_buildable_name() : "", sCancelId
);
1987 // Don't return any action - simulate canceled menu
1991 JSPopover::JSPopover(JSDialogSender
* pSender
, DockingWindow
* pDockingWindow
,
1992 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
1993 : JSWidget
<SalInstancePopover
, DockingWindow
>(pSender
, pDockingWindow
, pBuilder
, bTakeOwnership
)
1998 void JSPopover::popup_at_rect(weld::Widget
* pParent
, const tools::Rectangle
& rRect
,
1999 weld::Placement ePlace
)
2001 SalInstancePopover::popup_at_rect(pParent
, rRect
, ePlace
);
2002 sendPopup(getWidget()->GetChild(0), u
"_POPOVER_"_ustr
, u
"_POPOVER_"_ustr
);
2005 void JSPopover::popdown()
2007 VclPtr
<vcl::Window
> pPopup
= JSInstanceBuilder::Popups().Find(OUString::number(mnWindowId
));
2011 sendClosePopup(mnWindowId
);
2012 vcl::Window::GetDockingManager()->EndPopupMode(pPopup
);
2015 if (getWidget() && getWidget()->GetChild(0))
2016 sendClosePopup(getWidget()->GetChild(0)->GetLOKWindowId());
2018 SalInstancePopover::popdown();
2021 JSBox::JSBox(JSDialogSender
* pSender
, VclBox
* pBox
, SalInstanceBuilder
* pBuilder
,
2022 bool bTakeOwnership
)
2023 : JSWidget
<SalInstanceBox
, VclBox
>(pSender
, pBox
, pBuilder
, bTakeOwnership
)
2027 void JSBox::reorder_child(weld::Widget
* pWidget
, int nNewPosition
)
2029 SalInstanceBox::reorder_child(pWidget
, nNewPosition
);
2033 JSImage::JSImage(JSDialogSender
* pSender
, FixedImage
* pImage
, SalInstanceBuilder
* pBuilder
,
2034 bool bTakeOwnership
)
2035 : JSWidget
<SalInstanceImage
, FixedImage
>(pSender
, pImage
, pBuilder
, bTakeOwnership
)
2039 void JSImage::set_image(VirtualDevice
* pDevice
)
2041 SalInstanceImage::set_image(pDevice
);
2045 void JSImage::set_image(const css::uno::Reference
<css::graphic::XGraphic
>& rImage
)
2047 SalInstanceImage::set_image(rImage
);
2051 JSLevelBar::JSLevelBar(JSDialogSender
* pSender
, ::ProgressBar
* pProgressBar
,
2052 SalInstanceBuilder
* pBuilder
, bool bTakeOwnership
)
2053 : JSWidget
<SalInstanceLevelBar
, ::ProgressBar
>(pSender
, pProgressBar
, pBuilder
, bTakeOwnership
)
2057 void JSLevelBar::set_percentage(double fPercentage
)
2059 SalInstanceLevelBar::set_percentage(fPercentage
);
2063 JSCalendar::JSCalendar(JSDialogSender
* pSender
, ::Calendar
* pCalendar
, SalInstanceBuilder
* pBuilder
,
2064 bool bTakeOwnership
)
2065 : JSWidget
<SalInstanceCalendar
, ::Calendar
>(pSender
, pCalendar
, pBuilder
, bTakeOwnership
)
2069 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */