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