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