xref: /aoo41x/main/cui/source/inc/hlmarkwn.hxx (revision cdf0e10c)
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_BKWND_HYPERLINK_HXX
29 #define _SVX_BKWND_HYPERLINK_HXX
30 
31 #include <com/sun/star/container/XNameAccess.hpp>
32 #include <vcl/dialog.hxx>
33 #ifndef _SV_BUTTON_HXX
34 #include <vcl/button.hxx>
35 #endif
36 #include <svtools/svtreebx.hxx>
37 
38 #include "hlmarkwn_def.hxx" //ADD CHINA001
39 class SvxHyperlinkTabPageBase;
40 
41 //########################################################################
42 //#                                                                      #
43 //# Tree-Window 														 #
44 //#                                                                      #
45 //########################################################################
46 
47 class SvxHlinkDlgMarkWnd;
48 
49 class SvxHlmarkTreeLBox : public SvTreeListBox
50 {
51 private:
52 	SvxHlinkDlgMarkWnd* mpParentWnd;
53 
54 public:
55 	SvxHlmarkTreeLBox( Window* pParent, const ResId& rResId );
56 
57 	virtual void Paint( const Rectangle& rRect );
58 };
59 
60 //########################################################################
61 //#                                                                      #
62 //# Window-Class														 #
63 //#                                                                      #
64 //########################################################################
65 
66 class SvxHlinkDlgMarkWnd : public ModalDialog //FloatingWindow
67 {
68 private:
69 	friend class SvxHlmarkTreeLBox;
70 
71 	PushButton		maBtApply;
72 	PushButton		maBtClose;
73 	//SvTreeListBox	maLbTree;
74 	SvxHlmarkTreeLBox maLbTree;
75 
76 	sal_Bool			mbUserMoved;
77 	sal_Bool			mbFirst;
78 
79 	SvxHyperlinkTabPageBase* mpParent;
80 
81 	String			maStrLastURL;
82 
83 	sal_uInt16			mnError;
84 
85 protected:
86 	sal_Bool RefreshFromDoc( ::rtl::OUString aURL );
87 
88 	SvLBoxEntry* FindEntry ( String aStrName );
89 	void ClearTree();
90 	int FillTree( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xLinks, SvLBoxEntry* pParentEntry =NULL );
91 
92 	virtual void Move ();
93 
94 	DECL_LINK (ClickApplyHdl_Impl, void * );
95 	DECL_LINK (ClickCloseHdl_Impl, void * );
96 
97 public:
98 	SvxHlinkDlgMarkWnd (SvxHyperlinkTabPageBase *pParent);
99 	~SvxHlinkDlgMarkWnd();
100 
101 	sal_Bool MoveTo ( Point aNewPos );
102 	void RefreshTree ( String aStrURL );
103 	void SelectEntry ( String aStrMark );
104 
105 	sal_Bool ConnectToDialog( sal_Bool bDoit = sal_True );
106 
107 	sal_uInt16 SetError( sal_uInt16 nError);
108 };
109 
110 
111 #endif	// _SVX_BKWND_HYPERLINK_HXX
112