Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_UI_DBUI_CREATEADDRESSLISTDIALOG_HXX
20 : #define INCLUDED_SW_SOURCE_UI_DBUI_CREATEADDRESSLISTDIALOG_HXX
21 :
22 : #include <sfx2/basedlgs.hxx>
23 :
24 : #include <vcl/button.hxx>
25 : #include <svtools/stdctrl.hxx>
26 : #include <vcl/field.hxx>
27 : #include <vcl/lstbox.hxx>
28 : #include <vector>
29 :
30 : class SwAddressControl_Impl;
31 : class SwMailMergeConfigItem;
32 :
33 : // container of the created database
34 0 : struct SwCSVData
35 : {
36 : ::std::vector< OUString > aDBColumnHeaders;
37 : ::std::vector< ::std::vector< OUString> > aDBData;
38 : };
39 :
40 : class SwFindEntryDialog;
41 : class SwCreateAddressListDialog : public SfxModalDialog
42 : {
43 : VclPtr<SwAddressControl_Impl> m_pAddressControl;
44 :
45 : VclPtr<PushButton> m_pNewPB;
46 : VclPtr<PushButton> m_pDeletePB;
47 : VclPtr<PushButton> m_pFindPB;
48 : VclPtr<PushButton> m_pCustomizePB;
49 :
50 : VclPtr<PushButton> m_pStartPB;
51 : VclPtr<PushButton> m_pPrevPB;
52 : VclPtr<NumericField> m_pSetNoNF;
53 : VclPtr<PushButton> m_pNextPB;
54 : VclPtr<PushButton> m_pEndPB;
55 :
56 :
57 : VclPtr<OKButton> m_pOK;
58 :
59 : OUString m_sAddressListFilterName;
60 : OUString m_sURL;
61 :
62 : SwCSVData* m_pCSVData;
63 : VclPtr<SwFindEntryDialog> m_pFindDlg;
64 :
65 : DECL_LINK(NewHdl_Impl, void *);
66 : DECL_LINK(DeleteHdl_Impl, void *);
67 : DECL_LINK(FindHdl_Impl, void *);
68 : DECL_LINK(CustomizeHdl_Impl, PushButton*);
69 : DECL_LINK(OkHdl_Impl, void *);
70 : DECL_LINK(DBCursorHdl_Impl, PushButton*);
71 : DECL_LINK(DBNumCursorHdl_Impl, void *);
72 :
73 : void UpdateButtons();
74 :
75 : public:
76 : SwCreateAddressListDialog(
77 : vcl::Window* pParent, const OUString& rURL, SwMailMergeConfigItem& rConfig);
78 : virtual ~SwCreateAddressListDialog();
79 : virtual void dispose() SAL_OVERRIDE;
80 :
81 0 : const OUString& GetURL() const { return m_sURL; }
82 : void Find( const OUString& rSearch, sal_Int32 nColumn);
83 : };
84 :
85 : class SwFindEntryDialog : public ModelessDialog
86 : {
87 : VclPtr<Edit> m_pFindED;
88 : VclPtr<CheckBox> m_pFindOnlyCB;
89 : VclPtr<ListBox> m_pFindOnlyLB;
90 :
91 : VclPtr<PushButton> m_pFindPB;
92 : VclPtr<CancelButton> m_pCancel;
93 :
94 : VclPtr<SwCreateAddressListDialog> m_pParent;
95 :
96 : DECL_LINK(FindHdl_Impl, void *);
97 : DECL_LINK(FindEnableHdl_Impl, void *);
98 : DECL_LINK(CloseHdl_Impl, void *);
99 :
100 : public:
101 : SwFindEntryDialog(SwCreateAddressListDialog* pParent);
102 : virtual ~SwFindEntryDialog();
103 : virtual void dispose() SAL_OVERRIDE;
104 :
105 0 : ListBox& GetFieldsListBox()
106 : {
107 0 : return *m_pFindOnlyLB;
108 : }
109 : OUString GetFindString() const
110 : {
111 : return m_pFindED->GetText();
112 : }
113 : };
114 :
115 : #endif
116 :
117 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|