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: insdlg.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 ************************************************************************/
30 #ifndef _SVX_INSDLG_HXX
31 #define _SVX_INSDLG_HXX
33 #include <com/sun/star/uno/Reference.h>
34 #include <com/sun/star/embed/XEmbeddedObject.hpp>
35 #include <com/sun/star/embed/XEmbeddedObject.hpp>
36 #include <com/sun/star/embed/XStorage.hpp>
38 #include <svtools/insdlg.hxx>
39 #include <vcl/dialog.hxx>
40 #include <vcl/fixed.hxx>
41 #include <vcl/button.hxx>
42 #include <vcl/field.hxx>
43 #include <vcl/edit.hxx>
44 #include <vcl/lstbox.hxx>
45 #include <svtools/svmedit.hxx> // MultiLineEdit
46 #include <comphelper/embeddedobjectcontainer.hxx>
50 class InsertObjectDialog_Impl
: public ModalDialog
53 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> m_xObj
;
54 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& m_xStorage
;
55 comphelper::EmbeddedObjectContainer aCnt
;
57 InsertObjectDialog_Impl( Window
* pParent
, const ResId
& rResId
, const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
59 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> GetObject()
61 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> GetIconIfIconified( ::rtl::OUString
* pGraphicMediaType
);
62 virtual BOOL
IsCreateNew() const;
65 class SvInsertOleDlg
: public InsertObjectDialog_Impl
67 RadioButton aRbNewObject
;
68 RadioButton aRbObjectFromfile
;
69 ListBox aLbObjecttype
;
71 PushButton aBtnFilepath
;
75 CancelButton aCancelButton1
;
76 HelpButton aHelpButton1
;
79 const SvObjectServerList
* m_pServers
;
81 ::com::sun::star::uno::Sequence
< sal_Int8
> m_aIconMetaFile
;
82 ::rtl::OUString m_aIconMediaType
;
84 DECL_LINK( DoubleClickHdl
, ListBox
* );
85 DECL_LINK( BrowseHdl
, PushButton
* );
86 DECL_LINK( RadioHdl
, RadioButton
* );
88 ListBox
& GetObjectTypes()
89 { return aLbObjecttype
; }
90 String
GetFilePath() const { return aEdFilepath
.GetText(); }
91 BOOL
IsLinked() const { return aCbFilelink
.IsChecked(); }
92 BOOL
IsCreateNew() const { return aRbNewObject
.IsChecked(); }
95 static void FillObjectServerList( SvObjectServerList
* );
97 SvInsertOleDlg( Window
* pParent
,
98 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
,
99 const SvObjectServerList
* pServers
= NULL
);
100 virtual short Execute();
102 // get replacement for the iconified embedded object and the mediatype of the replacement
103 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XInputStream
> GetIconIfIconified( ::rtl::OUString
* pGraphicMediaType
);
106 // class SvInsertPlugInDialog --------------------------------------------
108 class SvInsertPlugInDialog
: public InsertObjectDialog_Impl
112 PushButton aBtnFileurl
;
113 FixedLine aGbFileurl
;
114 MultiLineEdit aEdPluginsOptions
;
115 FixedLine aGbPluginsOptions
;
117 CancelButton aCancelButton1
;
118 HelpButton aHelpButton1
;
119 INetURLObject
* m_pURL
;
122 DECL_LINK( BrowseHdl
, PushButton
* );
123 String
GetPlugInFile() const { return aEdFileurl
.GetText(); }
124 String
GetPlugInOptions() const { return aEdPluginsOptions
.GetText(); }
127 SvInsertPlugInDialog( Window
* pParent
,
128 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
130 ~SvInsertPlugInDialog();
132 virtual short Execute();
135 // class SvInsertAppletDialog --------------------------------------------
137 class SvInsertAppletDialog
: public InsertObjectDialog_Impl
140 FixedText aFtClassfile
;
142 FixedText aFtClasslocation
;
143 Edit aEdClasslocation
;
144 PushButton aBtnClass
;
146 MultiLineEdit aEdAppletOptions
;
147 FixedLine aGbAppletOptions
;
149 CancelButton aCancelButton1
;
150 HelpButton aHelpButton1
;
151 INetURLObject
* m_pURL
;
154 String
GetClass() const { return aEdClassfile
.GetText(); }
155 String
GetClassLocation() const { return aEdClasslocation
.GetText(); }
156 String
GetAppletOptions() const { return aEdAppletOptions
.GetText(); }
158 void SetClass( const String
&rClass
) { aEdClassfile
.SetText(rClass
); }
159 void SetClassLocation( const String
&rLocation
) { aEdClasslocation
.SetText(rLocation
); }
160 void SetAppletOptions( const String
&rOptions
) { aEdAppletOptions
.SetText(rOptions
); }
161 DECL_LINK( BrowseHdl
, PushButton
* );
164 SvInsertAppletDialog( Window
* pParent
,
165 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
166 SvInsertAppletDialog( Window
* pParent
,
167 const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
>& xObj
);
168 ~SvInsertAppletDialog();
170 virtual short Execute();
173 class SfxInsertFloatingFrameDialog
: public InsertObjectDialog_Impl
182 RadioButton aRBScrollingOn
;
183 RadioButton aRBScrollingOff
;
184 RadioButton aRBScrollingAuto
;
185 FixedLine aFLScrolling
;
187 FixedLine aFLSepLeft
;
188 RadioButton aRBFrameBorderOn
;
189 RadioButton aRBFrameBorderOff
;
190 FixedLine aFLFrameBorder
;
192 FixedLine aFLSepRight
;
193 FixedText aFTMarginWidth
;
194 NumericField aNMMarginWidth
;
195 CheckBox aCBMarginWidthDefault
;
196 FixedText aFTMarginHeight
;
197 NumericField aNMMarginHeight
;
198 CheckBox aCBMarginHeightDefault
;
202 CancelButton aCancelButton1
;
203 HelpButton aHelpButton1
;
205 DECL_STATIC_LINK( SfxInsertFloatingFrameDialog
, OpenHdl
, PushButton
* );
206 DECL_STATIC_LINK( SfxInsertFloatingFrameDialog
, CheckHdl
, CheckBox
* );
209 SfxInsertFloatingFrameDialog( Window
*pParent
,
210 const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& xStorage
);
211 SfxInsertFloatingFrameDialog( Window
* pParent
,
212 const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
>& xObj
);
213 virtual short Execute();
216 #endif // _SVX_INSDLG_HXX