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