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 _ADDRESSLISTDIALOG_HXX
24 #define _ADDRESSLISTDIALOG_HXX
25 
26 #include <sfx2/basedlgs.hxx>
27 #include <svtools/stdctrl.hxx>
28 #ifndef _SV_BUTTON_HXX
29 #include <vcl/button.hxx>
30 #endif
31 #include <svtools/svtabbx.hxx>
32 #include <svtools/headbar.hxx>
33 #include <swdbdata.hxx>
34 #include "sharedconnection.hxx"
35 
36 
37 namespace com{namespace sun{namespace star{
38     namespace container{
39         class XNameAccess;
40     }
41     namespace sdbc{
42         class XDataSource;
43         class XConnection;
44     }
45     namespace sdbcx{
46         class XColumnsSupplier;
47     }
48 }}}
49 class SwMailMergeAddressBlockPage;
50 /*-- 08.04.2004 14:04:29---------------------------------------------------
51 
52   -----------------------------------------------------------------------*/
53 class SwAddressListDialog : public SfxModalDialog
54 {
55     FixedInfo       m_aDescriptionFI;
56 
57     FixedInfo       m_aListFT;
58     HeaderBar       m_aListHB;
59     SvTabListBox    m_aListLB;
60 
61     PushButton      m_aLoadListPB;
62     PushButton      m_aCreateListPB;
63     PushButton      m_aFilterPB;
64     PushButton      m_aEditPB;
65     PushButton      m_aTablePB;
66 
67     FixedLine       m_aSeparatorFL;
68 
69     OKButton        m_aOK;
70     CancelButton    m_aCancel;
71     HelpButton      m_aHelp;
72 
73     String          m_sName;
74     String          m_sTable;
75     String          m_sConnecting;
76 
77     String          m_sCreatedURL;
78     SvLBoxEntry*    m_pCreatedDataSource;
79 
80     bool            m_bInSelectHdl;
81 
82     SwMailMergeAddressBlockPage* m_pAddressPage;
83 
84     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>     m_xDBContext;
85 //    ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>          m_xSource;
86 //    ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>          m_xConnection;
87 //    ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier>    m_xColumnsSupplier;
88     SwDBData                                                                        m_aDBData;
89 
90     void DetectTablesAndQueries(SvLBoxEntry* pSelect, bool bWidthDialog);
91 
92     DECL_LINK(FilterHdl_Impl, PushButton*);
93     DECL_LINK(LoadHdl_Impl,   PushButton*);
94     DECL_LINK(CreateHdl_Impl, PushButton*);
95     DECL_LINK(ListBoxSelectHdl_Impl, SvTabListBox*);
96     DECL_LINK(EditHdl_Impl, PushButton*);
97     DECL_LINK(TableSelectHdl_Impl, PushButton*);
98     DECL_LINK(OKHdl_Impl, PushButton*);
99 
100     DECL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*);
101 
102 public:
103     SwAddressListDialog(SwMailMergeAddressBlockPage* pParent);
104     ~SwAddressListDialog();
105 
106     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>
107                         GetSource();
108 
109     SharedConnection    GetConnection();
110 
111     ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier>
112                         GetColumnsSupplier();
113 
GetDBData() const114     const SwDBData&     GetDBData() const       {return m_aDBData;}
115     ::rtl::OUString     GetFilter();
116 };
117 #endif
118 
119