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 FRAMEWORK_BACKINGWINDOW_HXX
21 #define FRAMEWORK_BACKINGWINDOW_HXX
23 #include "rtl/ustring.hxx"
25 #include "vcl/button.hxx"
26 #include "vcl/menubtn.hxx"
27 #include "vcl/fixed.hxx"
28 #include "vcl/bitmapex.hxx"
29 #include "vcl/toolbox.hxx"
31 #include "unotools/moduleoptions.hxx"
32 #include "svtools/acceleratorexecute.hxx"
34 #include "com/sun/star/frame/XDispatchProvider.hpp"
35 #include "com/sun/star/frame/XDesktop.hpp"
36 #include "com/sun/star/frame/XFrame.hpp"
37 #include "com/sun/star/frame/XTerminateListener.hpp"
38 #include "com/sun/star/document/XEventListener.hpp"
39 #include "com/sun/star/document/XEventBroadcaster.hpp"
40 #include "com/sun/star/util/XURLTransformer.hpp"
41 #include "com/sun/star/ui/dialogs/XFilePicker.hpp"
42 #include "com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp"
43 #include "com/sun/star/ui/dialogs/XFilterManager.hpp"
44 #include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
45 #include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp"
49 class MnemonicGenerator
;
53 // To get the transparent mouse-over look, the closer is actually a toolbox
54 // overload DataChange to handle style changes correctly
55 class DecoToolBox
: public ToolBox
59 using Window::ImplInit
;
61 DecoToolBox( Window
* pParent
, WinBits nStyle
= 0 );
62 DecoToolBox( Window
* pParent
, const ResId
& rResId
);
64 void DataChanged( const DataChangedEvent
& rDCEvt
);
70 class BackingWindow
: public Window
75 com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> aArgSeq
;
78 com::sun::star::uno::Reference
<com::sun::star::frame::XDispatchProvider
> mxDesktopDispatchProvider
;
79 com::sun::star::uno::Reference
<com::sun::star::frame::XFrame
> mxFrame
;
80 com::sun::star::uno::Reference
<com::sun::star::document::XEventBroadcaster
> mxBroadcaster
;
82 ImageButton maWriterButton
;
83 ImageButton maCalcButton
;
84 ImageButton maImpressButton
;
85 MenuButton maOpenButton
;
86 ImageButton maDrawButton
;
87 ImageButton maDBButton
;
88 ImageButton maMathButton
;
89 ImageButton maTemplateButton
;
91 DecoToolBox maToolbox
;
93 BitmapEx maBackgroundLeft
;
94 BitmapEx maBackgroundMiddle
;
95 BitmapEx maBackgroundRight
;
97 String maCreateString
;
99 String maTemplateString
;
102 Rectangle maControlRect
;
104 long mnColumnWidth
[2];
105 long mnTextColumnWidth
[2];
106 Color maLabelTextColor
;
108 Size maButtonImageSize
;
111 sal_Int32 mnHideExternalLinks
;
112 svt::AcceleratorExecute
* mpAccExec
;
116 PopupMenu
* mpRecentMenu
;
117 std::vector
< LoadRecentFile
> maRecentFiles
;
119 static const int nItemId_Extensions
= 1;
120 static const int nItemId_Info
= 3;
121 static const int nItemId_TplRep
= 4;
122 static const int nShadowTop
= 30;
123 static const int nShadowLeft
= 30;
124 static const int nShadowRight
= 30;
125 static const int nShadowBottom
= 30;
127 void loadImage( const ResId
& i_rId
, PushButton
& i_rButton
);
129 void layoutButton( const char* i_pURL
, int nColumn
, int i_nExtraWidth
, const std::set
<OUString
>& i_rURLS
,
130 SvtModuleOptions
& i_rOpt
, SvtModuleOptions::EModule i_eMod
,
132 MnemonicGenerator
& i_rMnemonicGen
,
133 const String
& i_rStr
= String()
136 void dispatchURL( const OUString
& i_rURL
,
137 const OUString
& i_rTarget
= OUString( "_default" ),
138 const com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchProvider
>& i_xProv
= com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchProvider
>(),
139 const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& = com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>()
142 DECL_LINK( ClickHdl
, Button
* );
143 DECL_LINK( SelectHdl
, Button
* );
144 DECL_LINK( ActivateHdl
, Button
* );
145 DECL_LINK( ToolboxHdl
, void* );
146 DECL_LINK( WindowEventListener
, VclSimpleEvent
* );
149 void initBackground();
150 void prepareRecentFileMenu();
152 BackingWindow( Window
* pParent
);
155 virtual void Paint( const Rectangle
& rRect
);
156 virtual void Resize();
157 virtual long Notify( NotifyEvent
& rNEvt
);
158 virtual void GetFocus();
160 void setOwningFrame( const com::sun::star::uno::Reference
< com::sun::star::frame::XFrame
>& xFrame
);
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */