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