update dev300-m58
[ooovba.git] / dbaccess / source / ui / inc / TableWindowListBox.hxx
blob3d053cae12c8354c4a224a165361165f08af5ad9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableWindowListBox.hxx,v $
10 * $Revision: 1.11.68.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
31 #define DBAUI_TABLEWINDOWLISTBOX_HXX
33 #include <svtools/svtreebx.hxx>
34 #include "callbacks.hxx"
36 struct AcceptDropEvent;
37 struct ExecuteDropEvent;
38 namespace dbaui
40 class OTableWindowListBox;
41 struct OJoinExchangeData
43 public:
44 OTableWindowListBox* pListBox; // die ListBox innerhalb desselben (daraus kann man sich das TabWin und daraus den WinName besorgen)
45 SvLBoxEntry* pEntry; // der Eintrag, der gedraggt oder auf den gedroppt wurde
47 OJoinExchangeData(OTableWindowListBox* pBox);
48 OJoinExchangeData() : pListBox(NULL), pEntry(NULL) { }
50 struct OJoinDropData
52 OJoinExchangeData aSource;
53 OJoinExchangeData aDest;
56 class OTableWindow;
57 class OTableWindowListBox
58 :public SvTreeListBox
59 ,public IDragTransferableListener
61 DECL_LINK( OnDoubleClick, SvTreeListBox* );
62 DECL_LINK( ScrollUpHdl, SvTreeListBox* );
63 DECL_LINK( ScrollDownHdl, SvTreeListBox* );
64 DECL_LINK( DropHdl, void* );
65 DECL_LINK( LookForUiHdl, void* );
67 Timer m_aScrollTimer;
68 Point m_aMousePos;
70 OTableWindow* m_pTabWin;
71 ULONG m_nDropEvent;
72 ULONG m_nUiEvent;
73 OJoinDropData m_aDropInfo;
75 BOOL m_bReallyScrolled : 1;
76 BOOL m_bDragSource : 1;
78 protected:
79 virtual void LoseFocus();
80 virtual void GetFocus();
81 virtual void NotifyScrolled();
82 virtual void NotifyEndScroll();
84 virtual long PreNotify(NotifyEvent& rNEvt);
86 virtual void dragFinished( );
90 public:
91 OTableWindowListBox(OTableWindow* pParent);
92 virtual ~OTableWindowListBox();
94 // DnD stuff
95 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
96 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
97 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
99 // window
100 virtual void Command(const CommandEvent& rEvt);
102 OTableWindow* GetTabWin(){ return m_pTabWin; }
103 SvLBoxEntry* GetEntryFromText( const String& rEntryText );
105 private:
106 using SvTreeListBox::ExecuteDrop;
109 #endif // DBAUI_TABLEWINDOWLISTBOX_HXX