1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SFX2_SOURCE_DIALOG_BACKINGWINDOW_HXX
21 #define INCLUDED_SFX2_SOURCE_DIALOG_BACKINGWINDOW_HXX
23 #include <rtl/ustring.hxx>
25 #include <vcl/InterimItemWindow.hxx>
27 #include <recentdocsview.hxx>
28 #include <templatedefaultview.hxx>
30 #include <svtools/acceleratorexecute.hxx>
32 #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/frame/XDispatchProvider.hpp>
35 #include <com/sun/star/frame/XFrame.hpp>
41 class BackingWindow
: public InterimItemWindow
43 css::uno::Reference
<css::uno::XComponentContext
> mxContext
;
44 css::uno::Reference
<css::frame::XDispatchProvider
> mxDesktopDispatchProvider
;
45 css::uno::Reference
<css::frame::XFrame
> mxFrame
;
47 /** helper for drag&drop. */
48 css::uno::Reference
<css::datatransfer::dnd::XDropTargetListener
> mxDropTargetListener
;
50 std::unique_ptr
<weld::Button
> mxOpenButton
;
51 std::unique_ptr
<weld::ToggleButton
> mxRecentButton
;
52 std::unique_ptr
<weld::Button
> mxRemoteButton
;
53 std::unique_ptr
<weld::ToggleButton
> mxTemplateButton
;
55 std::unique_ptr
<weld::Label
> mxCreateLabel
;
56 std::unique_ptr
<weld::Label
> mxAltHelpLabel
;
57 std::unique_ptr
<weld::ComboBox
> mxFilter
;
58 std::unique_ptr
<weld::MenuButton
> mxActions
;
60 std::unique_ptr
<weld::Button
> mxWriterAllButton
;
61 std::unique_ptr
<weld::Button
> mxCalcAllButton
;
62 std::unique_ptr
<weld::Button
> mxImpressAllButton
;
63 std::unique_ptr
<weld::Button
> mxDrawAllButton
;
64 std::unique_ptr
<weld::Button
> mxDBAllButton
;
65 std::unique_ptr
<weld::Button
> mxMathAllButton
;
66 std::unique_ptr
<BrandImage
> mxBrandImage
;
67 std::unique_ptr
<weld::CustomWeld
> mxBrandImageWeld
;
69 std::unique_ptr
<weld::Button
> mxHelpButton
;
70 std::unique_ptr
<weld::Button
> mxExtensionsButton
;
71 std::unique_ptr
<weld::Button
> mxDonateButton
;
73 std::unique_ptr
<weld::Container
> mxAllButtonsBox
;
74 std::unique_ptr
<weld::Container
> mxButtonsBox
;
75 std::unique_ptr
<weld::Container
> mxSmallButtonsBox
;
77 std::unique_ptr
<sfx2::RecentDocsView
> mxAllRecentThumbnails
;
78 std::unique_ptr
<weld::CustomWeld
> mxAllRecentThumbnailsWin
;
79 std::unique_ptr
<TemplateDefaultView
> mxLocalView
;
80 std::unique_ptr
<weld::CustomWeld
> mxLocalViewWin
;
81 bool mbLocalViewInitialized
;
83 css::uno::Reference
<css::datatransfer::dnd::XDropTarget
> mxDropTarget
;
86 std::unique_ptr
<svt::AcceleratorExecute
> mpAccExec
;
88 void dispatchURL(const OUString
& i_rURL
, const OUString
& i_rTarget
= u
"_default"_ustr
,
89 const css::uno::Reference
<css::frame::XDispatchProvider
>& i_xProv
90 = css::uno::Reference
<css::frame::XDispatchProvider
>(),
91 const css::uno::Sequence
<css::beans::PropertyValue
>& = css::uno::Sequence
<
92 css::beans::PropertyValue
>());
94 DECL_LINK(ToggleHdl
, weld::Toggleable
&, void);
95 DECL_LINK(FilterHdl
, weld::ComboBox
&, void);
96 DECL_LINK(ClickHdl
, weld::Button
&, void);
97 DECL_LINK(ClickHelpHdl
, weld::Button
&, void);
98 DECL_LINK(MenuSelectHdl
, const OUString
&, void);
99 DECL_STATIC_LINK(BackingWindow
, ExtLinkClickHdl
, weld::Button
&, void);
100 DECL_LINK(CreateContextMenuHdl
, ThumbnailViewItem
*, void);
101 DECL_LINK(OpenTemplateHdl
, ThumbnailViewItem
*, void);
102 DECL_LINK(EditTemplateHdl
, ThumbnailViewItem
*, void);
106 void initializeLocalView();
108 void checkInstalledModules();
110 void DataChanged(const DataChangedEvent
&) override
;
112 template <typename WidgetClass
> void setLargerFont(WidgetClass
&, const vcl::Font
&);
113 void ApplyStyleSettings();
119 explicit BackingWindow(vcl::Window
* pParent
);
120 virtual ~BackingWindow() override
;
121 virtual void dispose() override
;
123 virtual bool PreNotify(NotifyEvent
& rNEvt
) override
;
124 virtual void GetFocus() override
;
126 void setOwningFrame(const css::uno::Reference
<css::frame::XFrame
>& xFrame
);
128 void clearRecentFileList();
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */