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 #ifndef _DBTREE_HXX 28 #define _DBTREE_HXX 29 30 #include <svtools/svtreebx.hxx> 31 #include <com/sun/star/uno/Reference.h> 32 33 namespace com{namespace sun{namespace star{namespace container{ 34 class XNameAccess; 35 }}}} 36 #include "swdllapi.h" 37 #include <swtypes.hxx> 38 #include <swunodef.hxx> 39 40 class SwDBTreeList_Impl; 41 class SwWrtShell; 42 43 class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox 44 { 45 ImageList aImageList; 46 ImageList aImageListHC; 47 Image aDBBMP; 48 Image aTableBMP; 49 Image aQueryBMP; 50 51 String sDefDBName; 52 sal_Bool bInitialized; 53 sal_Bool bShowColumns; 54 55 SwDBTreeList_Impl* pImpl; 56 57 SW_DLLPRIVATE DECL_LINK( DBCompare, SvSortData* ); 58 59 SW_DLLPRIVATE void InitTreeList(); 60 SW_DLLPRIVATE virtual void RequestingChilds( SvLBoxEntry* pParent ); 61 62 SW_DLLPRIVATE virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 63 SW_DLLPRIVATE virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); 64 65 using SvTreeListBox::Select; 66 67 public: 68 SwDBTreeList( Window* pParent, const ResId& rResId, 69 SwWrtShell* pSh, 70 const String& rDefDBName = aEmptyStr, 71 const sal_Bool bShowCol = sal_False ); 72 virtual ~SwDBTreeList(); 73 74 String GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0); 75 76 void Select( const String& rDBName, const String& rTableName, 77 const String& rColumnName ); 78 79 void ShowColumns(sal_Bool bShowCol); 80 void SetWrtShell(SwWrtShell& rSh); 81 82 void AddDataSource(const String& rSource); 83 }; 84 85 #endif 86 87