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