1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dbtree.hxx,v $
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 ************************************************************************/
33 #include <svtools/svtreebx.hxx>
34 #include <com/sun/star/uno/Reference.h>
36 namespace com
{namespace sun
{namespace star
{namespace container
{
40 #include <swtypes.hxx>
41 #include <swunodef.hxx>
43 class SwDBTreeList_Impl
;
46 class SW_DLLPUBLIC SwDBTreeList
: public SvTreeListBox
49 ImageList aImageListHC
;
58 SwDBTreeList_Impl
* pImpl
;
60 SW_DLLPRIVATE
DECL_LINK( DBCompare
, SvSortData
* );
62 SW_DLLPRIVATE
void InitTreeList();
63 SW_DLLPRIVATE
virtual void RequestingChilds( SvLBoxEntry
* pParent
);
65 SW_DLLPRIVATE
virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
66 SW_DLLPRIVATE
virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
);
68 using SvTreeListBox::Select
;
71 SwDBTreeList( Window
* pParent
, const ResId
& rResId
,
73 const String
& rDefDBName
= aEmptyStr
,
74 const BOOL bShowCol
= FALSE
);
75 virtual ~SwDBTreeList();
77 String
GetDBName( String
& rTableName
, String
& rColumnName
, BOOL
* pbIsTable
= 0);
79 void Select( const String
& rDBName
, const String
& rTableName
,
80 const String
& rColumnName
);
82 void ShowColumns(BOOL bShowCol
);
83 void SetWrtShell(SwWrtShell
& rSh
);
85 void AddDataSource(const String
& rSource
);