1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX 24cdf0e10cSrcweir #define DBAUI_TABLEWINDOWLISTBOX_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <svtools/svtreebx.hxx> 27cdf0e10cSrcweir #include "callbacks.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir struct AcceptDropEvent; 30cdf0e10cSrcweir struct ExecuteDropEvent; 31cdf0e10cSrcweir namespace dbaui 32cdf0e10cSrcweir { 33cdf0e10cSrcweir class OTableWindowListBox; 34cdf0e10cSrcweir struct OJoinExchangeData 35cdf0e10cSrcweir { 36cdf0e10cSrcweir public: 37cdf0e10cSrcweir OTableWindowListBox* pListBox; // die ListBox innerhalb desselben (daraus kann man sich das TabWin und daraus den WinName besorgen) 38cdf0e10cSrcweir SvLBoxEntry* pEntry; // der Eintrag, der gedraggt oder auf den gedroppt wurde 39cdf0e10cSrcweir 40cdf0e10cSrcweir OJoinExchangeData(OTableWindowListBox* pBox); OJoinExchangeDatadbaui::OJoinExchangeData41cdf0e10cSrcweir OJoinExchangeData() : pListBox(NULL), pEntry(NULL) { } 42cdf0e10cSrcweir }; 43cdf0e10cSrcweir struct OJoinDropData 44cdf0e10cSrcweir { 45cdf0e10cSrcweir OJoinExchangeData aSource; 46cdf0e10cSrcweir OJoinExchangeData aDest; 47cdf0e10cSrcweir }; 48cdf0e10cSrcweir 49cdf0e10cSrcweir class OTableWindow; 50cdf0e10cSrcweir class OTableWindowListBox 51cdf0e10cSrcweir :public SvTreeListBox 52cdf0e10cSrcweir ,public IDragTransferableListener 53cdf0e10cSrcweir { 54cdf0e10cSrcweir DECL_LINK( OnDoubleClick, SvTreeListBox* ); 55cdf0e10cSrcweir DECL_LINK( ScrollUpHdl, SvTreeListBox* ); 56cdf0e10cSrcweir DECL_LINK( ScrollDownHdl, SvTreeListBox* ); 57cdf0e10cSrcweir DECL_LINK( DropHdl, void* ); 58cdf0e10cSrcweir DECL_LINK( LookForUiHdl, void* ); 59cdf0e10cSrcweir 60cdf0e10cSrcweir Timer m_aScrollTimer; 61cdf0e10cSrcweir Point m_aMousePos; 62cdf0e10cSrcweir 63cdf0e10cSrcweir OTableWindow* m_pTabWin; 64cdf0e10cSrcweir sal_uLong m_nDropEvent; 65cdf0e10cSrcweir sal_uLong m_nUiEvent; 66cdf0e10cSrcweir OJoinDropData m_aDropInfo; 67cdf0e10cSrcweir 68cdf0e10cSrcweir sal_Bool m_bReallyScrolled : 1; 69cdf0e10cSrcweir sal_Bool m_bDragSource : 1; 70cdf0e10cSrcweir 71cdf0e10cSrcweir protected: 72cdf0e10cSrcweir virtual void LoseFocus(); 73cdf0e10cSrcweir virtual void GetFocus(); 74cdf0e10cSrcweir virtual void NotifyScrolled(); 75cdf0e10cSrcweir virtual void NotifyEndScroll(); 76cdf0e10cSrcweir 77cdf0e10cSrcweir virtual long PreNotify(NotifyEvent& rNEvt); 78cdf0e10cSrcweir 79cdf0e10cSrcweir virtual void dragFinished( ); 80cdf0e10cSrcweir 81cdf0e10cSrcweir 82cdf0e10cSrcweir 83cdf0e10cSrcweir public: 84cdf0e10cSrcweir OTableWindowListBox(OTableWindow* pParent); 85cdf0e10cSrcweir virtual ~OTableWindowListBox(); 86cdf0e10cSrcweir 87cdf0e10cSrcweir // DnD stuff 88cdf0e10cSrcweir virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); 89cdf0e10cSrcweir virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 90cdf0e10cSrcweir virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 91cdf0e10cSrcweir 92cdf0e10cSrcweir // window 93cdf0e10cSrcweir virtual void Command(const CommandEvent& rEvt); 94cdf0e10cSrcweir GetTabWin()95cdf0e10cSrcweir OTableWindow* GetTabWin(){ return m_pTabWin; } 96cdf0e10cSrcweir SvLBoxEntry* GetEntryFromText( const String& rEntryText ); 97cdf0e10cSrcweir 98cdf0e10cSrcweir private: 99cdf0e10cSrcweir using SvTreeListBox::ExecuteDrop; 100cdf0e10cSrcweir }; 101cdf0e10cSrcweir } 102cdf0e10cSrcweir #endif // DBAUI_TABLEWINDOWLISTBOX_HXX 103cdf0e10cSrcweir 104cdf0e10cSrcweir 105cdf0e10cSrcweir 106