LibreOffice Module sw (master)  1
createaddresslistdialog.hxx
Go to the documentation of this file.
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 #include <vcl/button.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/weld.hxx>
26 #include <vector>
27 
30 
31 // container of the created database
32 struct SwCSVData
33 {
34  std::vector< OUString > aDBColumnHeaders;
35  std::vector< std::vector< OUString> > aDBData;
36 };
37 
38 class SwFindEntryDialog;
40 {
41  OUString const m_sAddressListFilterName;
42  OUString m_sURL;
43 
44  std::unique_ptr<SwCSVData> m_pCSVData;
45  std::unique_ptr<SwFindEntryDialog> m_xFindDlg;
46 
47  std::unique_ptr<SwAddressControl_Impl> m_xAddressControl;
48  std::unique_ptr<weld::Button> m_xNewPB;
49  std::unique_ptr<weld::Button> m_xDeletePB;
50  std::unique_ptr<weld::Button> m_xFindPB;
51  std::unique_ptr<weld::Button> m_xCustomizePB;
52  std::unique_ptr<weld::Button> m_xStartPB;
53  std::unique_ptr<weld::Button> m_xPrevPB;
54  std::unique_ptr<weld::Entry> m_xSetNoED;
55  std::unique_ptr<weld::SpinButton> m_xSetNoNF;
56  std::unique_ptr<weld::Button> m_xNextPB;
57  std::unique_ptr<weld::Button> m_xEndPB;
58  std::unique_ptr<weld::Button> m_xOK;
59 
60  DECL_LINK(NewHdl_Impl, weld::Button&, void);
61  DECL_LINK(DeleteHdl_Impl, weld::Button&, void);
62  DECL_LINK(FindHdl_Impl, weld::Button&, void);
63  DECL_LINK(CustomizeHdl_Impl, weld::Button&, void);
64  DECL_LINK(OkHdl_Impl, weld::Button&, void);
65  DECL_LINK(DBCursorHdl_Impl, weld::Button&, void);
66  DECL_LINK(DBNumCursorHdl_Impl, weld::Entry&, void);
67  DECL_LINK(RefreshNum_Impl, weld::Widget&, void);
68  void DBNumCursor();
69 
70  void UpdateButtons();
71 
72 public:
73  SwCreateAddressListDialog(weld::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig);
74  virtual ~SwCreateAddressListDialog() override;
75 
76  const OUString& GetURL() const { return m_sURL; }
77  void Find( const OUString& rSearch, sal_Int32 nColumn);
78 };
79 
81 {
83 
84  std::unique_ptr<weld::Entry> m_xFindED;
85  std::unique_ptr<weld::CheckButton> m_xFindOnlyCB;
86  std::unique_ptr<weld::ComboBox> m_xFindOnlyLB;
87  std::unique_ptr<weld::Button> m_xFindPB;
88  std::unique_ptr<weld::Button> m_xCancel;
89 
90  DECL_LINK(FindHdl_Impl, weld::Button&, void);
91  DECL_LINK(FindEnableHdl_Impl, weld::Entry&, void);
92  DECL_LINK(CloseHdl_Impl, weld::Button&, void);
93 
94 public:
96  virtual ~SwFindEntryDialog() override;
97 
98  void show() { m_xDialog->show(); }
99  void set_visible(bool bVisible) { m_xDialog->set_visible(bVisible); }
100  void hide() { m_xDialog->hide(); }
101  bool get_visible() const { return m_xDialog->get_visible(); }
102 
104  {
105  return *m_xFindOnlyLB;
106  }
107 };
108 
109 #endif
110 
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xStartPB
std::shared_ptr< weld::Dialog > m_xDialog
const OUString & GetURL() const
virtual ~SwCreateAddressListDialog() override
weld::ComboBox & GetFieldsListBox()
SwCreateAddressListDialog * m_pParent
std::unique_ptr< weld::Button > m_xPrevPB
std::vector< OUString > aDBColumnHeaders
void set_visible(bool bVisible)
std::unique_ptr< weld::Button > m_xFindPB
std::unique_ptr< SwFindEntryDialog > m_xFindDlg
std::unique_ptr< weld::CheckButton > m_xFindOnlyCB
std::unique_ptr< weld::ComboBox > m_xFindOnlyLB
std::unique_ptr< weld::Entry > m_xFindED
virtual ~SwFindEntryDialog() override
std::unique_ptr< weld::Button > m_xNextPB
std::unique_ptr< SwCSVData > m_pCSVData
std::unique_ptr< weld::Button > m_xNewPB
std::unique_ptr< weld::SpinButton > m_xSetNoNF
std::unique_ptr< weld::Entry > m_xSetNoED
std::unique_ptr< weld::Button > m_xFindPB
std::unique_ptr< SwAddressControl_Impl > m_xAddressControl
SwCreateAddressListDialog(weld::Window *pParent, const OUString &rURL, SwMailMergeConfigItem const &rConfig)
SwFindEntryDialog(SwCreateAddressListDialog *pParent)
std::unique_ptr< weld::Button > m_xCustomizePB
std::unique_ptr< weld::Button > m_xEndPB
std::unique_ptr< weld::Button > m_xDeletePB
DECL_LINK(NewHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xOK
std::vector< std::vector< OUString > > aDBData
DECL_LINK(FindHdl_Impl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xCancel
void Find(const OUString &rSearch, sal_Int32 nColumn)