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