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::MenuToggleButton
> mxRecentButton
;
52 std::unique_ptr
<weld::Button
> mxRemoteButton
;
53 std::unique_ptr
<weld::MenuToggleButton
> mxTemplateButton
;
55 std::unique_ptr
<weld::Label
> mxCreateLabel
;
56 std::unique_ptr
<weld::Label
> mxAltHelpLabel
;
58 std::unique_ptr
<weld::Button
> mxWriterAllButton
;
59 std::unique_ptr
<weld::Button
> mxCalcAllButton
;
60 std::unique_ptr
<weld::Button
> mxImpressAllButton
;
61 std::unique_ptr
<weld::Button
> mxDrawAllButton
;
62 std::unique_ptr
<weld::Button
> mxDBAllButton
;
63 std::unique_ptr
<weld::Button
> mxMathAllButton
;
64 std::unique_ptr
<BrandImage
> mxBrandImage
;
65 std::unique_ptr
<weld::CustomWeld
> mxBrandImageWeld
;
67 std::unique_ptr
<weld::Button
> mxHelpButton
;
68 std::unique_ptr
<weld::Button
> mxExtensionsButton
;
70 std::unique_ptr
<weld::Container
> mxAllButtonsBox
;
71 std::unique_ptr
<weld::Container
> mxButtonsBox
;
72 std::unique_ptr
<weld::Container
> mxSmallButtonsBox
;
74 std::unique_ptr
<sfx2::RecentDocsView
> mxAllRecentThumbnails
;
75 std::unique_ptr
<weld::CustomWeld
> mxAllRecentThumbnailsWin
;
76 std::unique_ptr
<TemplateDefaultView
> mxLocalView
;
77 std::unique_ptr
<weld::CustomWeld
> mxLocalViewWin
;
78 bool mbLocalViewInitialized
;
80 css::uno::Reference
<css::datatransfer::dnd::XDropTarget
> mxDropTarget
;
83 std::unique_ptr
<svt::AcceleratorExecute
> mpAccExec
;
85 void dispatchURL(const OUString
& i_rURL
, const OUString
& i_rTarget
= OUString("_default"),
86 const css::uno::Reference
<css::frame::XDispatchProvider
>& i_xProv
87 = css::uno::Reference
<css::frame::XDispatchProvider
>(),
88 const css::uno::Sequence
<css::beans::PropertyValue
>& = css::uno::Sequence
<
89 css::beans::PropertyValue
>());
91 DECL_LINK(ClickHdl
, weld::Button
&, void);
92 DECL_LINK(ClickHelpHdl
, weld::Button
&, void);
93 DECL_LINK(MenuSelectHdl
, const OString
&, void);
94 DECL_LINK(ExtLinkClickHdl
, weld::Button
&, void);
95 DECL_LINK(CreateContextMenuHdl
, ThumbnailViewItem
*, void);
96 DECL_LINK(OpenTemplateHdl
, ThumbnailViewItem
*, void);
97 DECL_LINK(EditTemplateHdl
, ThumbnailViewItem
*, void);
101 void initializeLocalView();
103 void checkInstalledModules();
105 void DataChanged(const DataChangedEvent
&) override
;
107 template <typename WidgetClass
> void setLargerFont(WidgetClass
&, const vcl::Font
&);
108 void ApplyStyleSettings();
111 explicit BackingWindow(vcl::Window
* pParent
);
112 virtual ~BackingWindow() override
;
113 virtual void dispose() override
;
115 virtual bool PreNotify(NotifyEvent
& rNEvt
) override
;
116 virtual void GetFocus() override
;
118 void setOwningFrame(const css::uno::Reference
<css::frame::XFrame
>& xFrame
);
120 void clearRecentFileList();
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */