xref: /aoo42x/main/cui/source/inc/insdlg.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _SVX_INSDLG_HXX
28*cdf0e10cSrcweir #define _SVX_INSDLG_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
31*cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/embed/XStorage.hpp>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <svtools/insdlg.hxx>
36*cdf0e10cSrcweir #include <vcl/dialog.hxx>
37*cdf0e10cSrcweir #include <vcl/fixed.hxx>
38*cdf0e10cSrcweir #include <vcl/button.hxx>
39*cdf0e10cSrcweir #include <vcl/field.hxx>
40*cdf0e10cSrcweir #include <vcl/edit.hxx>
41*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
42*cdf0e10cSrcweir #include <svtools/svmedit.hxx>	// MultiLineEdit
43*cdf0e10cSrcweir #include <comphelper/embeddedobjectcontainer.hxx>
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir class INetURLObject;
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir class InsertObjectDialog_Impl : public ModalDialog
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir protected:
50*cdf0e10cSrcweir     com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > m_xObj;
51*cdf0e10cSrcweir     const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& m_xStorage;
52*cdf0e10cSrcweir     comphelper::EmbeddedObjectContainer aCnt;
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir     InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
55*cdf0e10cSrcweir public:
56*cdf0e10cSrcweir     com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
57*cdf0e10cSrcweir                         { return m_xObj; }
58*cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
59*cdf0e10cSrcweir     virtual sal_Bool IsCreateNew() const;
60*cdf0e10cSrcweir };
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir class SvInsertOleDlg : public InsertObjectDialog_Impl
63*cdf0e10cSrcweir {
64*cdf0e10cSrcweir     RadioButton aRbNewObject;
65*cdf0e10cSrcweir     RadioButton aRbObjectFromfile;
66*cdf0e10cSrcweir 	FixedLine aGbObject;
67*cdf0e10cSrcweir     ListBox aLbObjecttype;
68*cdf0e10cSrcweir     Edit aEdFilepath;
69*cdf0e10cSrcweir     PushButton aBtnFilepath;
70*cdf0e10cSrcweir     CheckBox aCbFilelink;
71*cdf0e10cSrcweir     OKButton aOKButton1;
72*cdf0e10cSrcweir     CancelButton aCancelButton1;
73*cdf0e10cSrcweir     HelpButton aHelpButton1;
74*cdf0e10cSrcweir     String aStrFile;
75*cdf0e10cSrcweir 	String      _aOldStr;
76*cdf0e10cSrcweir     const SvObjectServerList* m_pServers;
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
79*cdf0e10cSrcweir 	::rtl::OUString m_aIconMediaType;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir     DECL_LINK(          DoubleClickHdl, ListBox* );
82*cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton* );
83*cdf0e10cSrcweir     DECL_LINK(          RadioHdl, RadioButton* );
84*cdf0e10cSrcweir     void                SelectDefault();
85*cdf0e10cSrcweir     ListBox&            GetObjectTypes()
86*cdf0e10cSrcweir                         { return aLbObjecttype; }
87*cdf0e10cSrcweir     String              GetFilePath() const { return aEdFilepath.GetText(); }
88*cdf0e10cSrcweir     sal_Bool                IsLinked() const    { return aCbFilelink.IsChecked(); }
89*cdf0e10cSrcweir     sal_Bool                IsCreateNew() const { return aRbNewObject.IsChecked(); }
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir public:
92*cdf0e10cSrcweir                         SvInsertOleDlg( Window* pParent,
93*cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
94*cdf0e10cSrcweir                             const SvObjectServerList* pServers = NULL );
95*cdf0e10cSrcweir     virtual short       Execute();
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir 	// get replacement for the iconified embedded object and the mediatype of the replacement
98*cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
99*cdf0e10cSrcweir };
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir // class SvInsertPlugInDialog --------------------------------------------
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir class SvInsertPlugInDialog : public InsertObjectDialog_Impl
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir private:
106*cdf0e10cSrcweir 	FixedLine aGbFileurl;
107*cdf0e10cSrcweir     Edit aEdFileurl;
108*cdf0e10cSrcweir     PushButton aBtnFileurl;
109*cdf0e10cSrcweir     FixedLine aGbPluginsOptions;
110*cdf0e10cSrcweir     MultiLineEdit aEdPluginsOptions;
111*cdf0e10cSrcweir     OKButton aOKButton1;
112*cdf0e10cSrcweir     CancelButton aCancelButton1;
113*cdf0e10cSrcweir     HelpButton aHelpButton1;
114*cdf0e10cSrcweir     INetURLObject*      m_pURL;
115*cdf0e10cSrcweir     String              m_aCommands;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton * );
118*cdf0e10cSrcweir     String              GetPlugInFile() const { return aEdFileurl.GetText(); }
119*cdf0e10cSrcweir     String              GetPlugInOptions() const { return aEdPluginsOptions.GetText(); }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir public:
122*cdf0e10cSrcweir                         SvInsertPlugInDialog( Window* pParent,
123*cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 						~SvInsertPlugInDialog();
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     virtual short       Execute();
128*cdf0e10cSrcweir };
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir // class SvInsertAppletDialog --------------------------------------------
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir class SvInsertAppletDialog : public InsertObjectDialog_Impl
133*cdf0e10cSrcweir {
134*cdf0e10cSrcweir private:
135*cdf0e10cSrcweir     FixedText aFtClassfile;
136*cdf0e10cSrcweir     Edit aEdClassfile;
137*cdf0e10cSrcweir     FixedText aFtClasslocation;
138*cdf0e10cSrcweir     Edit aEdClasslocation;
139*cdf0e10cSrcweir     PushButton aBtnClass;
140*cdf0e10cSrcweir     FixedLine aGbClass;
141*cdf0e10cSrcweir     MultiLineEdit aEdAppletOptions;
142*cdf0e10cSrcweir     FixedLine aGbAppletOptions;
143*cdf0e10cSrcweir     OKButton aOKButton1;
144*cdf0e10cSrcweir     CancelButton aCancelButton1;
145*cdf0e10cSrcweir     HelpButton aHelpButton1;
146*cdf0e10cSrcweir     INetURLObject*      m_pURL;
147*cdf0e10cSrcweir     String              m_aClass;
148*cdf0e10cSrcweir     String              m_aCommands;
149*cdf0e10cSrcweir     String              GetClass() const { return aEdClassfile.GetText(); }
150*cdf0e10cSrcweir     String              GetClassLocation() const { return aEdClasslocation.GetText(); }
151*cdf0e10cSrcweir     String              GetAppletOptions() const { return aEdAppletOptions.GetText(); }
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir     void                SetClass( const String &rClass ) { aEdClassfile.SetText(rClass); }
154*cdf0e10cSrcweir     void                SetClassLocation( const String &rLocation ) { aEdClasslocation.SetText(rLocation); }
155*cdf0e10cSrcweir     void                SetAppletOptions( const String &rOptions ) { aEdAppletOptions.SetText(rOptions); }
156*cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton * );
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir public:
159*cdf0e10cSrcweir                         SvInsertAppletDialog( Window* pParent,
160*cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
161*cdf0e10cSrcweir                         SvInsertAppletDialog( Window* pParent,
162*cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
163*cdf0e10cSrcweir 						~SvInsertAppletDialog();
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir     virtual short       Execute();
166*cdf0e10cSrcweir };
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir private:
171*cdf0e10cSrcweir 	FixedText           	aFTName;
172*cdf0e10cSrcweir 	Edit		        	aEDName;
173*cdf0e10cSrcweir 	FixedText	        	aFTURL;
174*cdf0e10cSrcweir 	Edit		        	aEDURL;
175*cdf0e10cSrcweir 	PushButton				aBTOpen;
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 	FixedLine               aFLScrolling;
178*cdf0e10cSrcweir 	RadioButton		    	aRBScrollingOn;
179*cdf0e10cSrcweir 	RadioButton		    	aRBScrollingOff;
180*cdf0e10cSrcweir 	RadioButton		    	aRBScrollingAuto;
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir     FixedLine               aFLSepLeft;
184*cdf0e10cSrcweir 	FixedLine               aFLFrameBorder;
185*cdf0e10cSrcweir     RadioButton             aRBFrameBorderOn;
186*cdf0e10cSrcweir 	RadioButton 	    	aRBFrameBorderOff;
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     FixedLine               aFLSepRight;
189*cdf0e10cSrcweir 	FixedLine               aFLMargin;
190*cdf0e10cSrcweir     FixedText               aFTMarginWidth;
191*cdf0e10cSrcweir 	NumericField	    	aNMMarginWidth;
192*cdf0e10cSrcweir 	CheckBox				aCBMarginWidthDefault;
193*cdf0e10cSrcweir 	FixedText		    	aFTMarginHeight;
194*cdf0e10cSrcweir 	NumericField	    	aNMMarginHeight;
195*cdf0e10cSrcweir 	CheckBox				aCBMarginHeightDefault;
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir     OKButton aOKButton1;
198*cdf0e10cSrcweir     CancelButton aCancelButton1;
199*cdf0e10cSrcweir     HelpButton aHelpButton1;
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir     DECL_STATIC_LINK(       SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
202*cdf0e10cSrcweir     DECL_STATIC_LINK(       SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir public:
205*cdf0e10cSrcweir                             SfxInsertFloatingFrameDialog( Window *pParent,
206*cdf0e10cSrcweir                                 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
207*cdf0e10cSrcweir                             SfxInsertFloatingFrameDialog( Window* pParent,
208*cdf0e10cSrcweir                                 const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
209*cdf0e10cSrcweir     virtual short           Execute();
210*cdf0e10cSrcweir };
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir #endif // _SVX_INSDLG_HXX
213*cdf0e10cSrcweir 
214