1*c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c4eee24dSAndrew Rist  * distributed with this work for additional information
6*c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9*c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c4eee24dSAndrew Rist  *
11*c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c4eee24dSAndrew Rist  *
13*c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15*c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18*c4eee24dSAndrew Rist  * under the License.
19*c4eee24dSAndrew Rist  *
20*c4eee24dSAndrew Rist  *************************************************************/
21*c4eee24dSAndrew Rist 
22*c4eee24dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_DOCLINKDIALOG_HXX_
25cdf0e10cSrcweir #define _SVX_DOCLINKDIALOG_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/dialog.hxx>
28cdf0e10cSrcweir #include <vcl/fixed.hxx>
29cdf0e10cSrcweir #include <vcl/edit.hxx>
30cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
31cdf0e10cSrcweir #include <vcl/button.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <svtools/inettbc.hxx>
34cdf0e10cSrcweir #include <svtools/urlcontrol.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //......................................................................
37cdf0e10cSrcweir namespace svx
38cdf0e10cSrcweir {
39cdf0e10cSrcweir //......................................................................
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 	//==================================================================
42cdf0e10cSrcweir 	//= ODocumentLinkDialog
43cdf0e10cSrcweir 	//==================================================================
44cdf0e10cSrcweir 	/** dialog for editing document links associated with data sources
45cdf0e10cSrcweir 	*/
46cdf0e10cSrcweir 	class ODocumentLinkDialog : public ModalDialog
47cdf0e10cSrcweir 	{
48cdf0e10cSrcweir 	protected:
49cdf0e10cSrcweir 		FixedText				m_aURLLabel;
50cdf0e10cSrcweir 		::svt::OFileURLControl	m_aURL;
51cdf0e10cSrcweir 		PushButton				m_aBrowseFile;
52cdf0e10cSrcweir 		FixedText				m_aNameLabel;
53cdf0e10cSrcweir 		Edit					m_aName;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 		FixedLine				m_aBottomLine;
56cdf0e10cSrcweir 		OKButton				m_aOK;
57cdf0e10cSrcweir 		CancelButton			m_aCancel;
58cdf0e10cSrcweir 		HelpButton				m_aHelp;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 		sal_Bool				m_bCreatingNew;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 		Link					m_aNameValidator;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	public:
65cdf0e10cSrcweir 		ODocumentLinkDialog( Window* _pParent, sal_Bool _bCreateNew );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 		// name validation has to be done by an external instance
68cdf0e10cSrcweir 		// the validator link gets a pointer to a String, and should return 0 if the string is not
69cdf0e10cSrcweir 		// acceptable
setNameValidator(const Link & _rValidator)70cdf0e10cSrcweir 		void	setNameValidator( const Link& _rValidator ) { m_aNameValidator = _rValidator; }
getNameValidator() const71cdf0e10cSrcweir 		Link	getNameValidator( ) const { return m_aNameValidator; }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		void	set( const	String& _rName, const	String& _rURL );
74cdf0e10cSrcweir 		void	get(		String& _rName,			String& _rURL ) const;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	protected:
77cdf0e10cSrcweir 		DECL_LINK( OnTextModified, Control* );
78cdf0e10cSrcweir 		DECL_LINK( OnBrowseFile, void* );
79cdf0e10cSrcweir 		DECL_LINK( OnOk, void* );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 		void validate( );
82cdf0e10cSrcweir 	};
83cdf0e10cSrcweir 
84cdf0e10cSrcweir //......................................................................
85cdf0e10cSrcweir }	// namespace svx
86cdf0e10cSrcweir //......................................................................
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif // _SVX_DOCLINKDIALOG_HXX_
89cdf0e10cSrcweir 
90