xref: /aoo42x/main/cui/source/inc/insdlg.hxx (revision c4eee24d)
1*c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c4eee24dSAndrew Rist  * distributed with this work for additional information
6*c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9*c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c4eee24dSAndrew Rist  *
11*c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c4eee24dSAndrew Rist  *
13*c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15*c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18*c4eee24dSAndrew Rist  * under the License.
19*c4eee24dSAndrew Rist  *
20*c4eee24dSAndrew Rist  *************************************************************/
21*c4eee24dSAndrew Rist 
22*c4eee24dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_INSDLG_HXX
24cdf0e10cSrcweir #define _SVX_INSDLG_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
27cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
28cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
29cdf0e10cSrcweir #include <com/sun/star/embed/XStorage.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <svtools/insdlg.hxx>
32cdf0e10cSrcweir #include <vcl/dialog.hxx>
33cdf0e10cSrcweir #include <vcl/fixed.hxx>
34cdf0e10cSrcweir #include <vcl/button.hxx>
35cdf0e10cSrcweir #include <vcl/field.hxx>
36cdf0e10cSrcweir #include <vcl/edit.hxx>
37cdf0e10cSrcweir #include <vcl/lstbox.hxx>
38cdf0e10cSrcweir #include <svtools/svmedit.hxx>	// MultiLineEdit
39cdf0e10cSrcweir #include <comphelper/embeddedobjectcontainer.hxx>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class INetURLObject;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class InsertObjectDialog_Impl : public ModalDialog
44cdf0e10cSrcweir {
45cdf0e10cSrcweir protected:
46cdf0e10cSrcweir     com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > m_xObj;
47cdf0e10cSrcweir     const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& m_xStorage;
48cdf0e10cSrcweir     comphelper::EmbeddedObjectContainer aCnt;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
51cdf0e10cSrcweir public:
GetObject()52cdf0e10cSrcweir     com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
53cdf0e10cSrcweir                         { return m_xObj; }
54cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
55cdf0e10cSrcweir     virtual sal_Bool IsCreateNew() const;
56cdf0e10cSrcweir };
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class SvInsertOleDlg : public InsertObjectDialog_Impl
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     RadioButton aRbNewObject;
61cdf0e10cSrcweir     RadioButton aRbObjectFromfile;
62cdf0e10cSrcweir 	FixedLine aGbObject;
63cdf0e10cSrcweir     ListBox aLbObjecttype;
64cdf0e10cSrcweir     Edit aEdFilepath;
65cdf0e10cSrcweir     PushButton aBtnFilepath;
66cdf0e10cSrcweir     CheckBox aCbFilelink;
67cdf0e10cSrcweir     OKButton aOKButton1;
68cdf0e10cSrcweir     CancelButton aCancelButton1;
69cdf0e10cSrcweir     HelpButton aHelpButton1;
70cdf0e10cSrcweir     String aStrFile;
71cdf0e10cSrcweir 	String      _aOldStr;
72cdf0e10cSrcweir     const SvObjectServerList* m_pServers;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
75cdf0e10cSrcweir 	::rtl::OUString m_aIconMediaType;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     DECL_LINK(          DoubleClickHdl, ListBox* );
78cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton* );
79cdf0e10cSrcweir     DECL_LINK(          RadioHdl, RadioButton* );
80cdf0e10cSrcweir     void                SelectDefault();
GetObjectTypes()81cdf0e10cSrcweir     ListBox&            GetObjectTypes()
82cdf0e10cSrcweir                         { return aLbObjecttype; }
GetFilePath() const83cdf0e10cSrcweir     String              GetFilePath() const { return aEdFilepath.GetText(); }
IsLinked() const84cdf0e10cSrcweir     sal_Bool                IsLinked() const    { return aCbFilelink.IsChecked(); }
IsCreateNew() const85cdf0e10cSrcweir     sal_Bool                IsCreateNew() const { return aRbNewObject.IsChecked(); }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir public:
88cdf0e10cSrcweir                         SvInsertOleDlg( Window* pParent,
89cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
90cdf0e10cSrcweir                             const SvObjectServerList* pServers = NULL );
91cdf0e10cSrcweir     virtual short       Execute();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	// get replacement for the iconified embedded object and the mediatype of the replacement
94cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
95cdf0e10cSrcweir };
96cdf0e10cSrcweir 
97cdf0e10cSrcweir // class SvInsertPlugInDialog --------------------------------------------
98cdf0e10cSrcweir 
99cdf0e10cSrcweir class SvInsertPlugInDialog : public InsertObjectDialog_Impl
100cdf0e10cSrcweir {
101cdf0e10cSrcweir private:
102cdf0e10cSrcweir 	FixedLine aGbFileurl;
103cdf0e10cSrcweir     Edit aEdFileurl;
104cdf0e10cSrcweir     PushButton aBtnFileurl;
105cdf0e10cSrcweir     FixedLine aGbPluginsOptions;
106cdf0e10cSrcweir     MultiLineEdit aEdPluginsOptions;
107cdf0e10cSrcweir     OKButton aOKButton1;
108cdf0e10cSrcweir     CancelButton aCancelButton1;
109cdf0e10cSrcweir     HelpButton aHelpButton1;
110cdf0e10cSrcweir     INetURLObject*      m_pURL;
111cdf0e10cSrcweir     String              m_aCommands;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton * );
GetPlugInFile() const114cdf0e10cSrcweir     String              GetPlugInFile() const { return aEdFileurl.GetText(); }
GetPlugInOptions() const115cdf0e10cSrcweir     String              GetPlugInOptions() const { return aEdPluginsOptions.GetText(); }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir public:
118cdf0e10cSrcweir                         SvInsertPlugInDialog( Window* pParent,
119cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 						~SvInsertPlugInDialog();
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     virtual short       Execute();
124cdf0e10cSrcweir };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir // class SvInsertAppletDialog --------------------------------------------
127cdf0e10cSrcweir 
128cdf0e10cSrcweir class SvInsertAppletDialog : public InsertObjectDialog_Impl
129cdf0e10cSrcweir {
130cdf0e10cSrcweir private:
131cdf0e10cSrcweir     FixedText aFtClassfile;
132cdf0e10cSrcweir     Edit aEdClassfile;
133cdf0e10cSrcweir     FixedText aFtClasslocation;
134cdf0e10cSrcweir     Edit aEdClasslocation;
135cdf0e10cSrcweir     PushButton aBtnClass;
136cdf0e10cSrcweir     FixedLine aGbClass;
137cdf0e10cSrcweir     MultiLineEdit aEdAppletOptions;
138cdf0e10cSrcweir     FixedLine aGbAppletOptions;
139cdf0e10cSrcweir     OKButton aOKButton1;
140cdf0e10cSrcweir     CancelButton aCancelButton1;
141cdf0e10cSrcweir     HelpButton aHelpButton1;
142cdf0e10cSrcweir     INetURLObject*      m_pURL;
143cdf0e10cSrcweir     String              m_aClass;
144cdf0e10cSrcweir     String              m_aCommands;
GetClass() const145cdf0e10cSrcweir     String              GetClass() const { return aEdClassfile.GetText(); }
GetClassLocation() const146cdf0e10cSrcweir     String              GetClassLocation() const { return aEdClasslocation.GetText(); }
GetAppletOptions() const147cdf0e10cSrcweir     String              GetAppletOptions() const { return aEdAppletOptions.GetText(); }
148cdf0e10cSrcweir 
SetClass(const String & rClass)149cdf0e10cSrcweir     void                SetClass( const String &rClass ) { aEdClassfile.SetText(rClass); }
SetClassLocation(const String & rLocation)150cdf0e10cSrcweir     void                SetClassLocation( const String &rLocation ) { aEdClasslocation.SetText(rLocation); }
SetAppletOptions(const String & rOptions)151cdf0e10cSrcweir     void                SetAppletOptions( const String &rOptions ) { aEdAppletOptions.SetText(rOptions); }
152cdf0e10cSrcweir     DECL_LINK(          BrowseHdl, PushButton * );
153cdf0e10cSrcweir 
154cdf0e10cSrcweir public:
155cdf0e10cSrcweir                         SvInsertAppletDialog( Window* pParent,
156cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
157cdf0e10cSrcweir                         SvInsertAppletDialog( Window* pParent,
158cdf0e10cSrcweir                             const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
159cdf0e10cSrcweir 						~SvInsertAppletDialog();
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     virtual short       Execute();
162cdf0e10cSrcweir };
163cdf0e10cSrcweir 
164cdf0e10cSrcweir class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
165cdf0e10cSrcweir {
166cdf0e10cSrcweir private:
167cdf0e10cSrcweir 	FixedText           	aFTName;
168cdf0e10cSrcweir 	Edit		        	aEDName;
169cdf0e10cSrcweir 	FixedText	        	aFTURL;
170cdf0e10cSrcweir 	Edit		        	aEDURL;
171cdf0e10cSrcweir 	PushButton				aBTOpen;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	FixedLine               aFLScrolling;
174cdf0e10cSrcweir 	RadioButton		    	aRBScrollingOn;
175cdf0e10cSrcweir 	RadioButton		    	aRBScrollingOff;
176cdf0e10cSrcweir 	RadioButton		    	aRBScrollingAuto;
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 
179cdf0e10cSrcweir     FixedLine               aFLSepLeft;
180cdf0e10cSrcweir 	FixedLine               aFLFrameBorder;
181cdf0e10cSrcweir     RadioButton             aRBFrameBorderOn;
182cdf0e10cSrcweir 	RadioButton 	    	aRBFrameBorderOff;
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     FixedLine               aFLSepRight;
185cdf0e10cSrcweir 	FixedLine               aFLMargin;
186cdf0e10cSrcweir     FixedText               aFTMarginWidth;
187cdf0e10cSrcweir 	NumericField	    	aNMMarginWidth;
188cdf0e10cSrcweir 	CheckBox				aCBMarginWidthDefault;
189cdf0e10cSrcweir 	FixedText		    	aFTMarginHeight;
190cdf0e10cSrcweir 	NumericField	    	aNMMarginHeight;
191cdf0e10cSrcweir 	CheckBox				aCBMarginHeightDefault;
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     OKButton aOKButton1;
194cdf0e10cSrcweir     CancelButton aCancelButton1;
195cdf0e10cSrcweir     HelpButton aHelpButton1;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     DECL_STATIC_LINK(       SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
198cdf0e10cSrcweir     DECL_STATIC_LINK(       SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
199cdf0e10cSrcweir 
200cdf0e10cSrcweir public:
201cdf0e10cSrcweir                             SfxInsertFloatingFrameDialog( Window *pParent,
202cdf0e10cSrcweir                                 const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
203cdf0e10cSrcweir                             SfxInsertFloatingFrameDialog( Window* pParent,
204cdf0e10cSrcweir                                 const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
205cdf0e10cSrcweir     virtual short           Execute();
206cdf0e10cSrcweir };
207cdf0e10cSrcweir 
208cdf0e10cSrcweir #endif // _SVX_INSDLG_HXX
209cdf0e10cSrcweir 
210