merge the formfield patch from ooo-build
[ooovba.git] / svx / source / cui / doclinkdialog.hxx
blob04e341c6142797d93ecc22558edb289e142c5c63
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doclinkdialog.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_DOCLINKDIALOG_HXX_
32 #define _SVX_DOCLINKDIALOG_HXX_
34 #include <vcl/dialog.hxx>
35 #include <vcl/fixed.hxx>
36 #include <vcl/edit.hxx>
37 #ifndef _SV_BUTTON_HXX
38 #include <vcl/button.hxx>
39 #endif
40 #include <svtools/inettbc.hxx>
41 #include <svtools/urlcontrol.hxx>
43 //......................................................................
44 namespace svx
46 //......................................................................
48 //==================================================================
49 //= ODocumentLinkDialog
50 //==================================================================
51 /** dialog for editing document links associated with data sources
53 class ODocumentLinkDialog : public ModalDialog
55 protected:
56 FixedText m_aURLLabel;
57 ::svt::OFileURLControl m_aURL;
58 PushButton m_aBrowseFile;
59 FixedText m_aNameLabel;
60 Edit m_aName;
62 FixedLine m_aBottomLine;
63 OKButton m_aOK;
64 CancelButton m_aCancel;
65 HelpButton m_aHelp;
67 sal_Bool m_bCreatingNew;
69 Link m_aNameValidator;
71 public:
72 ODocumentLinkDialog( Window* _pParent, sal_Bool _bCreateNew );
74 // name validation has to be done by an external instance
75 // the validator link gets a pointer to a String, and should return 0 if the string is not
76 // acceptable
77 void setNameValidator( const Link& _rValidator ) { m_aNameValidator = _rValidator; }
78 Link getNameValidator( ) const { return m_aNameValidator; }
80 void set( const String& _rName, const String& _rURL );
81 void get( String& _rName, String& _rURL ) const;
83 protected:
84 DECL_LINK( OnTextModified, Control* );
85 DECL_LINK( OnBrowseFile, void* );
86 DECL_LINK( OnOk, void* );
88 void validate( );
91 //......................................................................
92 } // namespace svx
93 //......................................................................
95 #endif // _SVX_DOCLINKDIALOG_HXX_