1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: backingwindow.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef FRAMEWORK_BACKINGWINDOW_HXX
32 #define FRAMEWORK_BACKINGWINDOW_HXX
34 #include "rtl/ustring.hxx"
36 #include "vcl/button.hxx"
37 #include "vcl/fixed.hxx"
38 #include "vcl/bitmapex.hxx"
39 #include "vcl/toolbox.hxx"
41 #include "svtools/moduleoptions.hxx"
42 #include "svtools/acceleratorexecute.hxx"
44 #include "com/sun/star/frame/XDispatchProvider.hpp"
45 #include "com/sun/star/frame/XDesktop.hpp"
46 #include "com/sun/star/frame/XFrame.hpp"
47 #include "com/sun/star/frame/XTerminateListener.hpp"
48 #include "com/sun/star/document/XEventListener.hpp"
49 #include "com/sun/star/document/XEventBroadcaster.hpp"
50 #include "com/sun/star/util/XURLTransformer.hpp"
51 #include "com/sun/star/ui/dialogs/XFilePicker.hpp"
52 #include "com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp"
53 #include "com/sun/star/ui/dialogs/XFilterManager.hpp"
54 #include "com/sun/star/ui/dialogs/XFolderPicker.hpp"
55 #include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
56 #include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp"
60 class MnemonicGenerator
;
64 // To get the transparent mouse-over look, the closer is actually a toolbox
65 // overload DataChange to handle style changes correctly
66 class DecoToolBox
: public ToolBox
70 using Window::ImplInit
;
72 DecoToolBox( Window
* pParent
, WinBits nStyle
= 0 );
73 DecoToolBox( Window
* pParent
, const ResId
& rResId
);
75 void DataChanged( const DataChangedEvent
& rDCEvt
);
81 class BackingWindow
: public Window
83 com::sun::star::uno::Reference
<com::sun::star::frame::XDesktop
> mxDesktop
;
84 com::sun::star::uno::Reference
<com::sun::star::frame::XDispatchProvider
> mxDesktopDispatchProvider
;
85 com::sun::star::uno::Reference
<com::sun::star::frame::XFrame
> mxFrame
;
86 com::sun::star::uno::Reference
<com::sun::star::document::XEventBroadcaster
> mxBroadcaster
;
92 FixedText maCreateText
;
94 FixedText maWriterText
;
95 ImageButton maWriterButton
;
97 ImageButton maCalcButton
;
98 FixedText maImpressText
;
99 ImageButton maImpressButton
;
100 FixedText maDrawText
;
101 ImageButton maDrawButton
;
103 ImageButton maDBButton
;
104 FixedText maMathText
;
105 ImageButton maMathButton
;
106 FixedText maTemplateText
;
107 ImageButton maTemplateButton
;
108 FixedText maOpenText
;
109 ImageButton maOpenButton
;
111 DecoToolBox maToolbox
;
113 BitmapEx maBackgroundLeft
;
114 BitmapEx maBackgroundMiddle
;
115 BitmapEx maBackgroundRight
;
117 String maWelcomeString
;
118 String maProductString
;
119 String maCreateString
;
121 String maTemplateString
;
124 Rectangle maControlRect
;
126 long mnColumnWidth
[2];
127 Color maLabelTextColor
;
128 Color maWelcomeTextColor
;
130 Size maButtonImageSize
;
133 svt::AcceleratorExecute
* mpAccExec
;
136 static const long nBtnPos
= 240;
137 static const int nItemId_Extensions
= 1;
138 static const int nItemId_Reg
= 2;
139 static const int nItemId_Info
= 3;
140 static const int nItemId_TplRep
= 4;
141 static const int nShadowTop
= 32;
142 static const int nShadowLeft
= 35;
143 static const int nShadowRight
= 45;
144 static const int nShadowBottom
= 50;
146 void loadImage( const ResId
& i_rId
, ImageButton
& i_rButton
);
148 void layoutButtonAndText( const char* i_pURL
, int nColumn
, const std::set
<rtl::OUString
>& i_rURLS
,
149 SvtModuleOptions
& i_rOpt
, SvtModuleOptions::EModule i_eMod
,
150 ImageButton
& i_rBtn
, FixedText
& i_rText
,
151 MnemonicGenerator
& i_rMnemonicGen
,
152 const String
& i_rStr
= String()
155 void dispatchURL( const rtl::OUString
& i_rURL
,
156 const rtl::OUString
& i_rTarget
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ),
157 const com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchProvider
>& i_xProv
= com::sun::star::uno::Reference
< com::sun::star::frame::XDispatchProvider
>(),
158 const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& = com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>()
161 DECL_LINK( ClickHdl
, Button
* );
162 DECL_LINK( ToolboxHdl
, void* );
165 void initBackground();
167 BackingWindow( Window
* pParent
);
170 virtual void Paint( const Rectangle
& rRect
);
171 virtual void Resize();
172 virtual long Notify( NotifyEvent
& rNEvt
);
173 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
174 virtual Window
* GetParentLabelFor( const Window
* pLabel
) const;
175 virtual Window
* GetParentLabeledBy( const Window
* pLabeled
) const;
177 void setOwningFrame( const com::sun::star::uno::Reference
< com::sun::star::frame::XFrame
>& xFrame
);