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 28 #ifndef _SVX_DOCLINKDIALOG_HXX_ 29 #define _SVX_DOCLINKDIALOG_HXX_ 30 31 #include <vcl/dialog.hxx> 32 #include <vcl/fixed.hxx> 33 #include <vcl/edit.hxx> 34 #ifndef _SV_BUTTON_HXX 35 #include <vcl/button.hxx> 36 #endif 37 #include <svtools/inettbc.hxx> 38 #include <svtools/urlcontrol.hxx> 39 40 //...................................................................... 41 namespace svx 42 { 43 //...................................................................... 44 45 //================================================================== 46 //= ODocumentLinkDialog 47 //================================================================== 48 /** dialog for editing document links associated with data sources 49 */ 50 class ODocumentLinkDialog : public ModalDialog 51 { 52 protected: 53 FixedText m_aURLLabel; 54 ::svt::OFileURLControl m_aURL; 55 PushButton m_aBrowseFile; 56 FixedText m_aNameLabel; 57 Edit m_aName; 58 59 FixedLine m_aBottomLine; 60 OKButton m_aOK; 61 CancelButton m_aCancel; 62 HelpButton m_aHelp; 63 64 sal_Bool m_bCreatingNew; 65 66 Link m_aNameValidator; 67 68 public: 69 ODocumentLinkDialog( Window* _pParent, sal_Bool _bCreateNew ); 70 71 // name validation has to be done by an external instance 72 // the validator link gets a pointer to a String, and should return 0 if the string is not 73 // acceptable 74 void setNameValidator( const Link& _rValidator ) { m_aNameValidator = _rValidator; } 75 Link getNameValidator( ) const { return m_aNameValidator; } 76 77 void set( const String& _rName, const String& _rURL ); 78 void get( String& _rName, String& _rURL ) const; 79 80 protected: 81 DECL_LINK( OnTextModified, Control* ); 82 DECL_LINK( OnBrowseFile, void* ); 83 DECL_LINK( OnOk, void* ); 84 85 void validate( ); 86 }; 87 88 //...................................................................... 89 } // namespace svx 90 //...................................................................... 91 92 #endif // _SVX_DOCLINKDIALOG_HXX_ 93 94