LibreOffice Module sw (master)  1
createaddresslistdialog.cxx
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 
20 #include <sal/config.h>
21 
22 #include <cstddef>
23 
24 #include <osl/diagnose.h>
25 #include <swtypes.hxx>
28 #include <mmconfigitem.hxx>
29 #include <vcl/event.hxx>
30 #include <vcl/commandevent.hxx>
31 #include <vcl/svapp.hxx>
32 #include <svtools/controldims.hxx>
33 #include <unotools/pathoptions.hxx>
34 #include <sfx2/filedlghelper.hxx>
35 #include <sfx2/docfilt.hxx>
36 #include <sfx2/fcontnr.hxx>
37 #include <sfx2/docfac.hxx>
38 #include <sfx2/docfile.hxx>
39 #include <rtl/textenc.h>
40 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
41 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
42 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
43 #include <tools/urlobj.hxx>
44 #include <dbui.hrc>
45 #include <strings.hrc>
46 #include <unomid.h>
47 #include <map>
48 
49 using namespace ::com::sun::star;
50 using namespace ::com::sun::star::ui::dialogs;
51 
52 namespace {
53 
54 struct SwAddressFragment
55 {
56  std::unique_ptr<weld::Builder> m_xBuilder;
57  std::unique_ptr<weld::Label> m_xLabel;
58  std::unique_ptr<weld::Entry> m_xEntry;
59 
60  SwAddressFragment(weld::Container* pGrid, int nLine)
61  : m_xBuilder(Application::CreateBuilder(pGrid, "modules/swriter/ui/addressfragment.ui"))
62  , m_xLabel(m_xBuilder->weld_label("label"))
63  , m_xEntry(m_xBuilder->weld_entry("entry"))
64  {
65  m_xLabel->set_grid_left_attach(0);
66  m_xLabel->set_grid_top_attach(nLine);
67 
68  m_xEntry->set_grid_left_attach(1);
69  m_xEntry->set_grid_top_attach(nLine);
70  }
71 };
72 
73 }
74 
76 {
77  std::map<weld::Entry*, sal_Int32> m_aEditLines;
78 
80  sal_uInt32 m_nCurrentDataSet;
81 
83 
84  std::unique_ptr<weld::ScrolledWindow> m_xScrollBar;
85  std::unique_ptr<weld::Container> m_xWindow;
86  std::vector<std::unique_ptr<SwAddressFragment>> m_aLines;
87 
88  DECL_LINK(GotFocusHdl_Impl, weld::Widget&, void);
89  DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void);
90 
91  void MakeVisible(const tools::Rectangle& aRect);
92 
93 public:
95 
96  void SetData(SwCSVData& rDBData);
97 
98  void SetCurrentDataSet(sal_uInt32 nSet);
99  void CurrentDataSetInvalidated() { m_nCurrentDataSet = std::numeric_limits<sal_uInt32>::max(); }
100  sal_uInt32 GetCurrentDataSet() const { return m_nCurrentDataSet; }
101  void SetCursorTo(std::size_t nElement);
102 };
103 
105  : m_pData(nullptr)
106  , m_nCurrentDataSet(0)
107  , m_bNoDataSet(true)
108  , m_xScrollBar(rBuilder.weld_scrolled_window("scrollwin"))
109  , m_xWindow(rBuilder.weld_container("CONTAINER"))
110 {
111 }
112 
114 {
115  m_pData = &rDBData;
116  //when the address data is updated then remove the controls and build again
117  if (!m_aLines.empty())
118  {
119  m_aLines.clear();
120  m_bNoDataSet = true;
121  }
122 
123  Link<weld::Widget&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
124  Link<weld::Entry&,void> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl);
125  sal_Int32 nLines = 0;
126  for (const auto& rHeader : m_pData->aDBColumnHeaders)
127  {
128  m_aLines.emplace_back(new SwAddressFragment(m_xWindow.get(), nLines));
129 
130  // when we have one line, measure it to get the line height to use as
131  // the basis for overall size request
132  if (nLines == 0)
133  {
134  auto nLineHeight = m_xWindow->get_preferred_size().Height();
135  m_xScrollBar->set_size_request(m_xScrollBar->get_approximate_digit_width() * 65,
136  nLineHeight * 10);
137  }
138 
139  weld::Label* pNewFT = m_aLines.back()->m_xLabel.get();
140  weld::Entry* pNewED = m_aLines.back()->m_xEntry.get();
141  //set nLines a position identifier - used in the ModifyHdl
142  m_aEditLines[pNewED] = nLines;
143  pNewED->connect_focus_in(aFocusLink);
144  pNewED->connect_changed(aEditModifyLink);
145 
146  pNewFT->set_label(rHeader);
147 
148  nLines++;
149  }
150 }
151 
153 {
154  if(m_bNoDataSet || m_nCurrentDataSet != nSet)
155  {
156  m_bNoDataSet = false;
157  m_nCurrentDataSet = nSet;
158  OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index");
159  if(m_pData->aDBData.size() > m_nCurrentDataSet)
160  {
161  sal_uInt32 nIndex = 0;
162  for(auto& rLine : m_aLines)
163  {
164  OSL_ENSURE(nIndex < m_pData->aDBData[m_nCurrentDataSet].size(),
165  "number of columns doesn't match number of Edits");
166  rLine->m_xEntry->set_text(m_pData->aDBData[m_nCurrentDataSet][nIndex]);
167  ++nIndex;
168  }
169  }
170  }
171 }
172 
173 IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, weld::Widget&, rEdit, void)
174 {
175  int x, y, width, height;
176  rEdit.get_extents_relative_to(*m_xWindow, x, y, width, height);
177  // the container has a border of 3 in the .ui
178  tools::Rectangle aRect(Point(x - 3, y - 3), Size(width + 6, height + 6));
179  MakeVisible(aRect);
180 }
181 
183 {
184  //determine range of visible positions
185  auto nMinVisiblePos = m_xScrollBar->vadjustment_get_value();
186  auto nMaxVisiblePos = nMinVisiblePos + m_xScrollBar->vadjustment_get_page_size();
187  if (rRect.Top() < nMinVisiblePos || rRect.Bottom() > nMaxVisiblePos)
188  m_xScrollBar->vadjustment_set_value(rRect.Top());
189 }
190 
191 // copy data changes into database
192 IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, weld::Entry&, rEdit, void)
193 {
194  //get the data element number of the current set
195  sal_Int32 nIndex = m_aEditLines[&rEdit];
196  //get the index of the set
197  OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" );
198  if (m_pData->aDBData.size() > m_nCurrentDataSet)
199  {
200  m_pData->aDBData[m_nCurrentDataSet][nIndex] = rEdit.get_text();
201  }
202 }
203 
204 void SwAddressControl_Impl::SetCursorTo(std::size_t nElement)
205 {
206  if (nElement < m_aLines.size())
207  {
208  weld::Entry* pEdit = m_aLines[nElement]->m_xEntry.get();
209  pEdit->grab_focus();
210  GotFocusHdl_Impl(*pEdit);
211  }
212 
213 }
214 
216  weld::Window* pParent, const OUString& rURL, SwMailMergeConfigItem const & rConfig)
217  : SfxDialogController(pParent, "modules/swriter/ui/createaddresslist.ui", "CreateAddressList")
218  , m_sAddressListFilterName(SwResId(ST_FILTERNAME))
219  , m_sURL(rURL)
220  , m_pCSVData(new SwCSVData)
221  , m_xAddressControl(new SwAddressControl_Impl(*m_xBuilder))
222  , m_xNewPB(m_xBuilder->weld_button("NEW"))
223  , m_xDeletePB(m_xBuilder->weld_button("DELETE"))
224  , m_xFindPB(m_xBuilder->weld_button("FIND"))
225  , m_xCustomizePB(m_xBuilder->weld_button("CUSTOMIZE"))
226  , m_xStartPB(m_xBuilder->weld_button("START"))
227  , m_xPrevPB(m_xBuilder->weld_button("PREV"))
228  , m_xSetNoED(m_xBuilder->weld_entry("SETNO-nospin"))
229  , m_xSetNoNF(m_xBuilder->weld_spin_button("SETNO"))
230  , m_xNextPB(m_xBuilder->weld_button("NEXT"))
231  , m_xEndPB(m_xBuilder->weld_button("END"))
232  , m_xOK(m_xBuilder->weld_button("ok"))
233 {
234  m_xSetNoNF->set_min(1);
235 
236  m_xNewPB->connect_clicked(LINK(this, SwCreateAddressListDialog, NewHdl_Impl));
237  m_xDeletePB->connect_clicked(LINK(this, SwCreateAddressListDialog, DeleteHdl_Impl));
238  m_xFindPB->connect_clicked(LINK(this, SwCreateAddressListDialog, FindHdl_Impl));
239  m_xCustomizePB->connect_clicked(LINK(this, SwCreateAddressListDialog, CustomizeHdl_Impl));
240  m_xOK->connect_clicked(LINK(this, SwCreateAddressListDialog, OkHdl_Impl));
241 
242  Link<weld::Button&,void> aLk = LINK(this, SwCreateAddressListDialog, DBCursorHdl_Impl);
243  m_xStartPB->connect_clicked(aLk);
244  m_xPrevPB->connect_clicked(aLk);
245  m_xSetNoED->connect_changed(LINK(this, SwCreateAddressListDialog, DBNumCursorHdl_Impl));
246  m_xSetNoED->connect_focus_out(LINK(this, SwCreateAddressListDialog, RefreshNum_Impl));
247  m_xNextPB->connect_clicked(aLk);
248  m_xEndPB->connect_clicked(aLk);
249 
250  if (!m_sURL.isEmpty())
251  {
252  //file exists, has to be loaded here
253  SfxMedium aMedium( m_sURL, StreamMode::READ );
254  SvStream* pStream = aMedium.GetInStream();
255  if(pStream)
256  {
257  pStream->SetLineDelimiter( LINEEND_LF );
258  pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
259 
260  OUString sLine;
261  bool bRead = pStream->ReadByteStringLine( sLine, RTL_TEXTENCODING_UTF8 );
262 
263  if(bRead && !sLine.isEmpty())
264  {
265  sal_Int32 nIndex = 0;
266  do
267  {
268  const OUString sHeader = sLine.getToken( 0, '\t', nIndex );
269  OSL_ENSURE(sHeader.getLength() > 2 &&
270  sHeader.startsWith("\"") && sHeader.endsWith("\""),
271  "Wrong format of header");
272  if(sHeader.getLength() > 2)
273  {
274  m_pCSVData->aDBColumnHeaders.push_back( sHeader.copy(1, sHeader.getLength() -2));
275  }
276  }
277  while (nIndex > 0);
278  }
279  while(pStream->ReadByteStringLine( sLine, RTL_TEXTENCODING_UTF8 ))
280  {
281  std::vector<OUString> aNewData;
282  //analyze data line
283  sal_Int32 nIndex = { sLine.isEmpty() ? -1 : 0 };
284  while (nIndex >= 0)
285  {
286  const OUString sData = sLine.getToken( 0, '\t', nIndex );
287  OSL_ENSURE( sData.startsWith("\"") && sData.endsWith("\""),
288  "Wrong format of line");
289  if(sData.getLength() >= 2)
290  aNewData.push_back(sData.copy(1, sData.getLength() - 2));
291  else
292  aNewData.push_back(sData);
293  }
294  m_pCSVData->aDBData.push_back( aNewData );
295  }
296  }
297  }
298  else
299  {
300  //database has to be created
301  const std::vector<std::pair<OUString, int>>& rAddressHeader = rConfig.GetDefaultAddressHeaders();
302  const sal_uInt32 nCount = rAddressHeader.size();
303  for(sal_uInt32 nHeader = 0; nHeader < nCount; ++nHeader)
304  m_pCSVData->aDBColumnHeaders.push_back(rAddressHeader[nHeader].first);
305  std::vector<OUString> aNewData;
306  aNewData.insert(aNewData.begin(), nCount, OUString());
307  m_pCSVData->aDBData.push_back(aNewData);
308  }
309  //now fill the address control
310  m_xAddressControl->SetData(*m_pCSVData);
311  m_xAddressControl->SetCurrentDataSet(0);
312  m_xSetNoNF->set_max(m_pCSVData->aDBData.size());
313 
314  m_xSetNoNF->set_value(1);
315  RefreshNum_Impl(*m_xSetNoED);
316 
317  UpdateButtons();
318 }
319 
321 {
322 }
323 
325 {
326  sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet();
327  std::vector<OUString> aNewData;
328  aNewData.insert(aNewData.begin(), m_pCSVData->aDBColumnHeaders.size(), OUString());
329  m_pCSVData->aDBData.insert(m_pCSVData->aDBData.begin() + ++nCurrent, aNewData);
330  m_xSetNoNF->set_max(m_pCSVData->aDBData.size());
331  //the NumericField start at 1
332  m_xSetNoNF->set_value(nCurrent + 1);
333  RefreshNum_Impl(*m_xSetNoED);
334  //the address control starts at 0
335  m_xAddressControl->SetCurrentDataSet(nCurrent);
336  UpdateButtons();
337 }
338 
340 {
341  sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet();
342  if (m_pCSVData->aDBData.size() > 1)
343  {
344  m_pCSVData->aDBData.erase(m_pCSVData->aDBData.begin() + nCurrent);
345  if (nCurrent)
346  --nCurrent;
347  }
348  else
349  {
350  // if only one set is available then clear the data
351  m_pCSVData->aDBData[0].assign(m_pCSVData->aDBData[0].size(), OUString());
352  m_xDeletePB->set_sensitive(false);
353  }
354  m_xAddressControl->CurrentDataSetInvalidated();
355  m_xAddressControl->SetCurrentDataSet(nCurrent);
356  m_xSetNoNF->set_max(m_pCSVData->aDBData.size());
357  UpdateButtons();
358 }
359 
361 {
362  if (!m_xFindDlg)
363  {
364  m_xFindDlg.reset(new SwFindEntryDialog(this));
365  weld::ComboBox& rColumnBox = m_xFindDlg->GetFieldsListBox();
366  for(const auto& rHeader : m_pCSVData->aDBColumnHeaders)
367  rColumnBox.append_text(rHeader);
368  rColumnBox.set_active(0);
369  m_xFindDlg->show();
370  }
371  else
372  m_xFindDlg->set_visible(!m_xFindDlg->get_visible());
373 }
374 
376 {
377  SwCustomizeAddressListDialog aDlg(m_xDialog.get(), *m_pCSVData);
378  if (aDlg.run() == RET_OK)
379  {
380  m_pCSVData = aDlg.ReleaseNewData();
381  m_xAddressControl->SetData(*m_pCSVData);
382  m_xAddressControl->SetCurrentDataSet(m_xAddressControl->GetCurrentDataSet());
383  }
384 
385  //update find dialog
386  if (m_xFindDlg)
387  {
388  weld::ComboBox& rColumnBox = m_xFindDlg->GetFieldsListBox();
389  rColumnBox.clear();
390  for(const auto& rHeader : m_pCSVData->aDBColumnHeaders)
391  rColumnBox.append_text(rHeader);
392  }
393 }
394 
395 namespace
396 {
397 
398 void lcl_WriteValues(const std::vector<OUString> *pFields, SvStream* pStream)
399 {
400  OUStringBuffer sLine;
401  const std::vector< OUString >::const_iterator aBegin = pFields->begin();
402  const std::vector< OUString >::const_iterator aEnd = pFields->end();
403  for(std::vector< OUString >::const_iterator aIter = aBegin; aIter != aEnd; ++aIter)
404  {
405  if (aIter==aBegin)
406  {
407  sLine.append("\"").append(*aIter).append("\"");
408  }
409  else
410  {
411  sLine.append("\t\"").append(*aIter).append("\"");
412  }
413  }
414  pStream->WriteByteStringLine( sLine.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
415 }
416 
417 }
418 
420 {
421  if(m_sURL.isEmpty())
422  {
423  sfx2::FileDialogHelper aDlgHelper(TemplateDescription::FILESAVE_SIMPLE,
424  FileDialogFlags::NONE, m_xDialog.get());
425  uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker();
426 
427  const OUString sPath( SvtPathOptions().SubstituteVariable("$(userurl)/database") );
428  aDlgHelper.SetDisplayDirectory( sPath );
429  xFP->appendFilter( m_sAddressListFilterName, "*.csv" );
430  xFP->setCurrentFilter( m_sAddressListFilterName ) ;
431 
432  if( ERRCODE_NONE == aDlgHelper.Execute() )
433  {
434  m_sURL = xFP->getSelectedFiles().getConstArray()[0];
435  INetURLObject aResult( m_sURL );
436  aResult.setExtension("csv");
438  }
439  }
440  if(!m_sURL.isEmpty())
441  {
442  SfxMedium aMedium( m_sURL, StreamMode::READWRITE|StreamMode::TRUNC );
443  SvStream* pStream = aMedium.GetOutStream();
444  pStream->SetLineDelimiter( LINEEND_LF );
445  pStream->SetStreamCharSet(RTL_TEXTENCODING_UTF8);
446 
447  lcl_WriteValues(&(m_pCSVData->aDBColumnHeaders), pStream);
448 
449  for(const auto& rData : m_pCSVData->aDBData)
450  {
451  lcl_WriteValues(&rData, pStream);
452  }
453  aMedium.Commit();
454  m_xDialog->response(RET_OK);
455  }
456 }
457 
458 IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, weld::Button&, rButton, void)
459 {
460  int nValue = m_xSetNoNF->get_value();
461 
462  if (&rButton == m_xStartPB.get())
463  nValue = 1;
464  else if (&rButton == m_xPrevPB.get())
465  {
466  if (nValue > 1)
467  --nValue;
468  }
469  else if (&rButton == m_xNextPB.get())
470  {
471  if (nValue < m_xSetNoNF->get_max())
472  ++nValue;
473  }
474  else //m_aEndPB
475  nValue = m_xSetNoNF->get_max();
476  if (nValue != m_xSetNoNF->get_value())
477  {
478  m_xSetNoNF->set_value(nValue);
479  RefreshNum_Impl(*m_xSetNoED);
480  DBNumCursor();
481  }
482 }
483 
485 {
486  m_xSetNoNF->set_text(m_xSetNoED->get_text());
487  DBNumCursor();
488 }
489 
491 {
492  m_xSetNoED->set_text(OUString::number(m_xSetNoNF->get_value()));
493 }
494 
496 {
497  m_xAddressControl->SetCurrentDataSet(m_xSetNoNF->get_value() - 1);
498  UpdateButtons();
499 }
500 
502 {
503  sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_xSetNoNF->get_value() );
504  sal_uInt32 nSize = static_cast<sal_uInt32>(m_pCSVData->aDBData.size());
505  m_xStartPB->set_sensitive(nCurrent != 1);
506  m_xPrevPB->set_sensitive(nCurrent != 1);
507  m_xNextPB->set_sensitive(nCurrent != nSize);
508  m_xEndPB->set_sensitive(nCurrent != nSize);
509  m_xDeletePB->set_sensitive(nSize > 0);
510 }
511 
512 void SwCreateAddressListDialog::Find(const OUString& rSearch, sal_Int32 nColumn)
513 {
514  const OUString sSearch = rSearch.toAsciiLowerCase();
515  sal_uInt32 nCurrent = m_xAddressControl->GetCurrentDataSet();
516  //search forward
517  bool bFound = false;
518  sal_uInt32 nStart = nCurrent + 1;
519  sal_uInt32 nEnd = m_pCSVData->aDBData.size();
520  std::size_t nElement = 0;
521  sal_uInt32 nPos = 0;
522  for(short nTemp = 0; nTemp < 2 && !bFound; nTemp++)
523  {
524  for(nPos = nStart; nPos < nEnd; ++nPos)
525  {
526  std::vector< OUString> const & aData = m_pCSVData->aDBData[nPos];
527  if(nColumn >=0)
528  bFound = -1 != aData[static_cast<sal_uInt32>(nColumn)].toAsciiLowerCase().indexOf(sSearch);
529  else
530  {
531  for( nElement = 0; nElement < aData.size(); ++nElement)
532  {
533  bFound = -1 != aData[nElement].toAsciiLowerCase().indexOf(sSearch);
534  if(bFound)
535  {
536  nColumn = nElement; //TODO: std::size_t -> sal_Int32!
537  break;
538  }
539  }
540  }
541  if(bFound)
542  break;
543  }
544  nStart = 0;
545  nEnd = nCurrent + 1;
546  }
547  if(bFound)
548  {
549  m_xAddressControl->SetCurrentDataSet(nPos);
550  m_xSetNoNF->set_value( nPos + 1 );
551  RefreshNum_Impl(*m_xSetNoED);
552  UpdateButtons();
553  m_xAddressControl->SetCursorTo(nElement);
554  }
555 }
556 
558  : GenericDialogController(pParent->getDialog(), "modules/swriter/ui/findentrydialog.ui", "FindEntryDialog")
559  , m_pParent(pParent)
560  , m_xFindED(m_xBuilder->weld_entry("entry"))
561  , m_xFindOnlyCB(m_xBuilder->weld_check_button("findin"))
562  , m_xFindOnlyLB(m_xBuilder->weld_combo_box("area"))
563  , m_xFindPB(m_xBuilder->weld_button("find"))
564  , m_xCancel(m_xBuilder->weld_button("cancel"))
565 {
566  m_xFindPB->connect_clicked(LINK(this, SwFindEntryDialog, FindHdl_Impl));
567  m_xFindED->connect_changed(LINK(this, SwFindEntryDialog, FindEnableHdl_Impl));
568  m_xCancel->connect_clicked(LINK(this, SwFindEntryDialog, CloseHdl_Impl));
569 }
570 
572 {
573 }
574 
576 {
577  sal_Int32 nColumn = -1;
578  if (m_xFindOnlyCB->get_active())
579  nColumn = m_xFindOnlyLB->get_active();
580  m_pParent->Find(m_xFindED->get_text(), nColumn);
581 }
582 
583 IMPL_LINK_NOARG(SwFindEntryDialog, FindEnableHdl_Impl, weld::Entry&, void)
584 {
585  m_xFindPB->set_sensitive(!m_xFindED->get_text().isEmpty());
586 }
587 
589 {
590  m_xDialog->hide();
591 }
592 
593 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xStartPB
virtual bool get_extents_relative_to(Widget &rRelative, int &x, int &y, int &width, int &height)=0
std::unique_ptr< SwCSVData > ReleaseNewData()
virtual ~SwCreateAddressListDialog() override
sal_Int32 nIndex
const char aData[]
Definition: ww8scan.hxx:47
void SetData(SwCSVData &rDBData)
sal_uInt32 GetCurrentDataSet() const
std::unique_ptr< weld::Button > m_xPrevPB
std::vector< OUString > aDBColumnHeaders
IMPL_LINK_NOARG(SwCreateAddressListDialog, NewHdl_Impl, weld::Button &, void)
bool Commit()
const ContentProperties & rData
std::unique_ptr< weld::Button > m_xFindPB
DECL_LINK(GotFocusHdl_Impl, weld::Widget &, void)
float x
void connect_changed(const Link< Entry &, void > &rLink)
bool setExtension(OUString const &rTheExtension, sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool ReadByteStringLine(OUString &rStr, rtl_TextEncoding eSrcCharSet, sal_Int32 nMaxBytesToRead=0xFFFE)
int nCount
sal_Int16 const nValue
SvStream * GetOutStream()
std::vector< std::unique_ptr< SwAddressFragment > > m_aLines
long Top() const
OUString m_sURL
std::unique_ptr< weld::Container > m_xWindow
std::unique_ptr< weld::ScrolledWindow > m_xScrollBar
std::unique_ptr< weld::Entry > m_xFindED
float y
virtual ~SwFindEntryDialog() override
IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, weld::Widget &, rEdit, void)
std::unique_ptr< weld::Button > m_xNextPB
const std::vector< std::pair< OUString, int > > & GetDefaultAddressHeaders() const
LINEEND_LF
std::unique_ptr< SwCSVData > m_pCSVData
std::unique_ptr< weld::Button > m_xNewPB
void MakeVisible(const tools::Rectangle &aRect)
void SetCursorTo(std::size_t nElement)
long Bottom() const
size
virtual void connect_focus_in(const Link< Widget &, void > &rLink)
virtual void set_active(int pos)=0
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
virtual void clear()=0
FmFilterData *const m_pData
virtual OUString get_text() const =0
virtual void set_label(const OUString &rText)=0
std::unique_ptr< weld::SpinButton > m_xSetNoNF
std::unique_ptr< weld::Entry > m_xSetNoED
std::unique_ptr< weld::Button > m_xFindPB
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SvStream * GetInStream()
std::unique_ptr< SwAddressControl_Impl > m_xAddressControl
SwCreateAddressListDialog(weld::Window *pParent, const OUString &rURL, SwMailMergeConfigItem const &rConfig)
weld::Entry & rEdit
SwFindEntryDialog(SwCreateAddressListDialog *pParent)
#define ERRCODE_NONE
void SetCurrentDataSet(sal_uInt32 nSet)
virtual void grab_focus()=0
std::unique_ptr< weld::Button > m_xCustomizePB
RET_OK
void SetStreamCharSet(rtl_TextEncoding eCharSet)
std::unique_ptr< weld::Button > m_xEndPB
Reference< XExecutableDialog > m_xDialog
std::map< weld::Entry *, sal_Int32 > m_aEditLines
std::unique_ptr< weld::Button > m_xDeletePB
void append_text(const OUString &rStr)
std::unique_ptr< weld::Button > m_xOK
const css::uno::Reference< css::ui::dialogs::XFilePicker3 > & GetFilePicker() const
std::vector< std::vector< OUString > > aDBData
std::unique_ptr< weld::Button > m_xCancel
SwAddressControl_Impl(weld::Builder &rBuilder)
void SetLineDelimiter(LineEnd eLineEnd)
sal_uInt16 nPos
bool WriteByteStringLine(const OUString &rStr, rtl_TextEncoding eDestCharSet)
void Find(const OUString &rSearch, sal_Int32 nColumn)