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