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 _CREATEADDRESSLISTDIALOG_HXX
24 #define _CREATEADDRESSLISTDIALOG_HXX
25 
26 #include <sfx2/basedlgs.hxx>
27 
28 #ifndef _SV_BUTTON_HXX
29 #include <vcl/button.hxx>
30 #endif
31 #include <svtools/stdctrl.hxx>
32 #include <vcl/field.hxx>
33 #include <vcl/lstbox.hxx>
34 #include <vector>
35 
36 class SwAddressControl_Impl;
37 class SwMailMergeConfigItem;
38 /*-- 19.04.2004 12:09:46---------------------------------------------------
39     container of the created database
40   -----------------------------------------------------------------------*/
41 struct SwCSVData
42 {
43     ::std::vector< ::rtl::OUString >                    aDBColumnHeaders;
44     ::std::vector< ::std::vector< ::rtl::OUString> >     aDBData;
45 };
46 /*-- 08.04.2004 14:04:39---------------------------------------------------
47 
48   -----------------------------------------------------------------------*/
49 class SwFindEntryDialog;
50 class SwCreateAddressListDialog : public SfxModalDialog
51 {
52     FixedInfo               m_aAddressInformation;
53     SwAddressControl_Impl*  m_pAddressControl;
54 
55     PushButton              m_aNewPB;
56     PushButton              m_aDeletePB;
57     PushButton              m_aFindPB;
58     PushButton              m_aCustomizePB;
59 
60     FixedInfo               m_aViewEntriesFI;
61     PushButton              m_aStartPB;
62     PushButton              m_aPrevPB;
63     NumericField            m_aSetNoNF;
64     PushButton              m_aNextPB;
65     PushButton              m_aEndPB;
66 
67     FixedLine               m_aSeparatorFL;
68 
69     OKButton                m_aOK;
70     CancelButton            m_aCancel;
71     HelpButton              m_aHelp;
72 
73     String                  m_sAddressListFilterName;
74     String                  m_sURL;
75 
76     SwCSVData*              m_pCSVData;
77     SwFindEntryDialog*      m_pFindDlg;
78 
79     DECL_LINK(NewHdl_Impl, PushButton*);
80     DECL_LINK(DeleteHdl_Impl, PushButton*);
81     DECL_LINK(FindHdl_Impl, PushButton*);
82     DECL_LINK(CustomizeHdl_Impl, PushButton*);
83     DECL_LINK(OkHdl_Impl, PushButton*);
84     DECL_LINK(DBCursorHdl_Impl, PushButton*);
85     DECL_LINK(DBNumCursorHdl_Impl, NumericField*);
86 
87     void UpdateButtons();
88 
89 public:
90     SwCreateAddressListDialog(
91             Window* pParent, const String& rURL, SwMailMergeConfigItem& rConfig);
92     ~SwCreateAddressListDialog();
93 
GetURL() const94     const String&           GetURL() const {    return m_sURL;    }
95     void                    Find( const String& rSearch, sal_Int32 nColumn);
96 };
97 /*-- 13.04.2004 13:30:21---------------------------------------------------
98 
99   -----------------------------------------------------------------------*/
100 class SwFindEntryDialog : public ModelessDialog
101 {
102     FixedText               m_aFindFT;
103     Edit                    m_aFindED;
104     CheckBox                m_aFindOnlyCB;
105     ListBox                 m_aFindOnlyLB;
106 
107     PushButton              m_aFindPB;
108     CancelButton            m_aCancel;
109     HelpButton              m_aHelp;
110 
111     SwCreateAddressListDialog*  m_pParent;
112 
113     DECL_LINK(FindHdl_Impl, PushButton*);
114     DECL_LINK(FindEnableHdl_Impl, Edit*);
115     DECL_LINK(CloseHdl_Impl, PushButton*);
116 
117 public:
118     SwFindEntryDialog(SwCreateAddressListDialog* pParent);
119     ~SwFindEntryDialog();
120 
GetFieldsListBox()121     ListBox&                GetFieldsListBox(){return m_aFindOnlyLB;}
GetFindString() const122     String                  GetFindString() const {return m_aFindED.GetText();}
123 };
124 
125 #endif
126 
127