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