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