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 #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
24 #define DBAUI_TABLEWINDOWLISTBOX_HXX
25 
26 #include <svtools/svtreebx.hxx>
27 #include "callbacks.hxx"
28 
29 struct AcceptDropEvent;
30 struct ExecuteDropEvent;
31 namespace dbaui
32 {
33 	class OTableWindowListBox;
34 	struct OJoinExchangeData
35 	{
36 	public:
37 		OTableWindowListBox*	pListBox;		// die ListBox innerhalb desselben (daraus kann man sich das TabWin und daraus den WinName besorgen)
38 		SvLBoxEntry*			pEntry;			// der Eintrag, der gedraggt oder auf den gedroppt wurde
39 
40 		OJoinExchangeData(OTableWindowListBox* pBox);
OJoinExchangeDatadbaui::OJoinExchangeData41 		OJoinExchangeData() : pListBox(NULL), pEntry(NULL) { }
42 	};
43 	struct OJoinDropData
44 	{
45 		OJoinExchangeData aSource;
46 		OJoinExchangeData aDest;
47 	};
48 
49 	class OTableWindow;
50 	class OTableWindowListBox
51 			:public SvTreeListBox
52 			,public IDragTransferableListener
53 	{
54 		DECL_LINK( OnDoubleClick, SvTreeListBox* );
55 		DECL_LINK( ScrollUpHdl, SvTreeListBox* );
56 		DECL_LINK( ScrollDownHdl, SvTreeListBox* );
57 		DECL_LINK( DropHdl, void* );
58 		DECL_LINK( LookForUiHdl, void* );
59 
60 		Timer						m_aScrollTimer;
61 		Point						m_aMousePos;
62 
63 		OTableWindow*				m_pTabWin;
64 		sal_uLong						m_nDropEvent;
65 		sal_uLong						m_nUiEvent;
66 		OJoinDropData				m_aDropInfo;
67 
68 		sal_Bool						m_bReallyScrolled : 1;
69 		sal_Bool						m_bDragSource : 1;
70 
71 	protected:
72 		virtual void LoseFocus();
73 		virtual void GetFocus();
74 		virtual	void NotifyScrolled();
75 		virtual void NotifyEndScroll();
76 
77 		virtual long PreNotify(NotifyEvent& rNEvt);
78 
79 		virtual void dragFinished( );
80 
81 
82 
83 	public:
84 		OTableWindowListBox(OTableWindow* pParent);
85 		virtual ~OTableWindowListBox();
86 
87 		// DnD stuff
88 		virtual void		StartDrag( sal_Int8 nAction, const Point& rPosPixel );
89 		virtual sal_Int8	AcceptDrop( const AcceptDropEvent& rEvt );
90 		virtual sal_Int8	ExecuteDrop( const ExecuteDropEvent& rEvt );
91 
92 		// window
93 		virtual void Command(const CommandEvent& rEvt);
94 
GetTabWin()95 		OTableWindow* GetTabWin(){ return m_pTabWin; }
96 		SvLBoxEntry* GetEntryFromText( const String& rEntryText );
97 
98     private:
99         using SvTreeListBox::ExecuteDrop;
100 	};
101 }
102 #endif // DBAUI_TABLEWINDOWLISTBOX_HXX
103 
104 
105 
106