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