LibreOffice Module sw (master)  1
bookmark.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 <rtl/ustrbuf.hxx>
21 #include <sfx2/request.hxx>
22 #include <svl/stritem.hxx>
23 #include <vcl/weld.hxx>
24 #include <com/sun/star/frame/XModel.hpp>
25 #include <com/sun/star/text/XBookmarksSupplier.hpp>
26 
27 #include <swabstdlg.hxx>
28 #include <swuiexp.hxx>
29 #include <view.hxx>
30 #include <wrtsh.hxx>
31 #include <cmdid.h>
32 #include <bookmark.hxx>
33 #include <docsh.hxx>
34 #include <ndtxt.hxx>
35 #include <strings.hrc>
36 #include <svtools/miscopt.hxx>
38 
39 using namespace ::com::sun::star;
40 
41 const char BookmarkTable::cSeparator(';');
42 
43 // callback to modify EditBox
45 {
46  ValidateBookmarks();
47  m_xBookmarksBox->unselect_all();
48  // if a string has been pasted from the clipboard then
49  // there may be illegal characters in the box
50  // sanitization
51  OUString sTmp = m_xEditBox->get_text();
52  OUString sMsg;
53  const sal_Int32 nLen = sTmp.getLength();
54  for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++)
55  {
56  const sal_Int32 nTmpLen = sTmp.getLength();
57  sTmp = sTmp.replaceAll(OUStringChar(BookmarkTable::aForbiddenChars.getStr()[i]), "");
58  if (sTmp.getLength() != nTmpLen)
59  sMsg += OUStringChar(BookmarkTable::aForbiddenChars.getStr()[i]);
60  }
61  const bool bHasForbiddenChars = sTmp.getLength() != nLen;
62  m_xForbiddenChars->set_visible(bHasForbiddenChars);
63  if (bHasForbiddenChars)
64  m_xEditBox->set_message_type(weld::EntryMessageType::Error);
65  else
66  m_xEditBox->set_message_type(weld::EntryMessageType::Normal);
67 
68  sal_Int32 nSelectedEntries = 0;
69  sal_Int32 nEntries = 0;
70  sal_Int32 nTokenIndex = 0;
71  while (!sTmp.isEmpty() && nTokenIndex >= 0)
72  {
73  OUString aToken = sTmp.getToken(0, BookmarkTable::cSeparator, nTokenIndex);
74  if (m_xBookmarksBox->GetBookmarkByName(aToken))
75  {
76  m_xBookmarksBox->SelectByName(aToken);
77  nSelectedEntries++;
78  }
79  nEntries++;
80  }
81 
82  // allow to add new bookmark only if one name provided and it's not taken
83  m_xInsertBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 0 && !bHasForbiddenChars && !m_bAreProtected);
84 
85  // allow to delete only if all bookmarks are recognized
86  m_xDeleteBtn->set_sensitive(nEntries > 0 && nSelectedEntries == nEntries && !m_bAreProtected);
87  m_xGotoBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1);
88  m_xRenameBtn->set_sensitive(nEntries == 1 && nSelectedEntries == 1 && !m_bAreProtected);
89 }
90 
91 // callback to delete a text mark
93 {
94  if (!ValidateBookmarks())
95  return;
96 
97  int nSelectedRows(0);
98 
99  m_xBookmarksBox->selected_foreach([this, &nSelectedRows](weld::TreeIter& rEntry){
100  // remove from model
101  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry).toInt64());
102  OUString sRemoved = pBookmark->GetName();
103  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
104  pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved));
105  SfxRequest aReq(rSh.GetView().GetViewFrame(), FN_DELETE_BOOKMARK);
106  aReq.AppendItem(SfxStringItem(FN_DELETE_BOOKMARK, sRemoved));
107  aReq.Done();
108  aTableBookmarks.erase(std::remove(aTableBookmarks.begin(), aTableBookmarks.end(),
109  std::make_pair(pBookmark, sRemoved)), aTableBookmarks.end());
110 
111  ++nSelectedRows;
112 
113  return false;
114  });
115 
116  if (!nSelectedRows)
117  return;
118 
119  // remove from BookmarkTable
120  m_xBookmarksBox->remove_selection();
121 
122  ValidateBookmarks();
123 
124  m_xDeleteBtn->set_sensitive(false);
125  m_xGotoBtn->set_sensitive(false);
126  m_xRenameBtn->set_sensitive(false);
127  m_xInsertBtn->set_sensitive(false);
128 }
129 
130 // callback to a goto button
132 {
133  GotoSelectedBookmark();
134 }
135 
137 {
138  GotoSelectedBookmark();
139  return true;
140 }
141 
143 {
144  if (!ValidateBookmarks())
145  return;
146  // this event should fired only if we change selection by clicking on BookmarkTable entry
147  if (!m_xBookmarksBox->has_focus())
148  return;
149 
150  OUStringBuffer sEditBoxText;
151  int nSelectedRows = 0;
152  m_xBookmarksBox->selected_foreach([this, &sEditBoxText, &nSelectedRows](weld::TreeIter& rEntry){
153  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry).toInt64());
154  const OUString& sEntryName = pBookmark->GetName();
155  if (!sEditBoxText.isEmpty())
156  sEditBoxText.append(";");
157  sEditBoxText.append(sEntryName);
158  ++nSelectedRows;
159  return false;
160  });
161  if (nSelectedRows)
162  {
163  m_xInsertBtn->set_sensitive(false);
164  m_xGotoBtn->set_sensitive(nSelectedRows == 1);
165  m_xRenameBtn->set_sensitive(nSelectedRows == 1 && !m_bAreProtected);
166  m_xDeleteBtn->set_sensitive(!m_bAreProtected);
167  m_xEditBox->set_text(sEditBoxText.makeStringAndClear());
168  }
169  else
170  {
171  m_xInsertBtn->set_sensitive(!m_bAreProtected);
172  m_xGotoBtn->set_sensitive(false);
173  m_xRenameBtn->set_sensitive(false);
174  m_xDeleteBtn->set_sensitive(false);
175  }
176 }
177 
179 {
180  if (!ValidateBookmarks())
181  return;
182  auto xSelected = m_xBookmarksBox->get_selected();
183  if (!xSelected)
184  return;
185 
186  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
187  uno::Reference<frame::XModel> xModel = rSh.GetView().GetDocShell()->GetBaseModel();
188  uno::Reference<text::XBookmarksSupplier> xBkms(xModel, uno::UNO_QUERY);
189  uno::Reference<container::XNameAccess> xNameAccess = xBkms->getBookmarks();
190  uno::Any aObj = xNameAccess->getByName(pBookmark->GetName());
191  uno::Reference<uno::XInterface> xTmp;
192  aObj >>= xTmp;
193  uno::Reference<container::XNamed> xNamed(xTmp, uno::UNO_QUERY);
195  ScopedVclPtr<AbstractSwRenameXNamedDlg> pDlg(rFact.CreateSwRenameXNamedDlg(m_xDialog.get(), xNamed, xNameAccess));
197 
198  if (pDlg->Execute())
199  {
200  ValidateBookmarks();
201  m_xDeleteBtn->set_sensitive(false);
202  m_xGotoBtn->set_sensitive(false);
203  m_xRenameBtn->set_sensitive(false);
204  m_xInsertBtn->set_sensitive(false);
205  }
206 }
207 
208 // callback to an insert button. Inserts a new text mark to the current position.
210 {
211  OUString sBookmark = m_xEditBox->get_text();
212  rSh.SetBookmark2(vcl::KeyCode(), sBookmark, m_xHideCB->get_active(), m_xConditionED->get_text());
213 
214  m_xDialog->response(RET_OK);
215 }
216 
217 IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton&, rBox, void)
218 {
219  bool bHide = rBox.get_active();
220  m_xConditionED->set_sensitive(bHide);
221  m_xConditionFT->set_sensitive(bHide);
222 }
223 
225 {
226  if (!ValidateBookmarks())
227  return;
228  // if no entries selected we can't jump anywhere
229  // shouldn't be needed as we disable GoTo button when jump is not possible
230  auto xSelected = m_xBookmarksBox->get_selected();
231  if (!xSelected)
232  return;
233 
234  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(*xSelected).toInt64());
235 
236  rSh.EnterStdMode();
237  rSh.GotoMark(pBookmark);
238 }
239 
241 {
242  if (HaveBookmarksChanged())
243  {
244  PopulateTable();
245  m_xEditBox->set_text("");
246  return false;
247  }
248  return true;
249 }
250 
252 {
253  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
254  if (pMarkAccess->getBookmarksCount() != m_nLastBookmarksCount)
255  return true;
256 
257  std::vector<std::pair<sw::mark::IMark*, OUString>>::const_iterator aListIter = aTableBookmarks.begin();
258  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
259  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
260  {
262  {
263  // more bookmarks then expected
264  if (aListIter == aTableBookmarks.end())
265  return true;
266  if (aListIter->first != *ppBookmark ||
267  aListIter->second != (*ppBookmark)->GetName())
268  return true;
269  ++aListIter;
270  }
271  }
272  // less bookmarks then expected
273  return aListIter != aTableBookmarks.end();
274 }
275 
277 {
278  aTableBookmarks.clear();
279  m_xBookmarksBox->clear();
280 
281  IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
282  for (IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
283  ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark)
284  {
286  {
287  m_xBookmarksBox->InsertBookmark(*ppBookmark);
288  aTableBookmarks.emplace_back(*ppBookmark, (*ppBookmark)->GetName());
289  }
290  }
291  m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
292 }
293 
295  : SfxDialogController(pParent, "modules/swriter/ui/insertbookmark.ui", "InsertBookmarkDialog")
296  , rSh(rS)
297  , m_nLastBookmarksCount(0)
298  , m_bSorted(false)
299  , m_xEditBox(m_xBuilder->weld_entry("name"))
300  , m_xInsertBtn(m_xBuilder->weld_button("insert"))
301  , m_xDeleteBtn(m_xBuilder->weld_button("delete"))
302  , m_xGotoBtn(m_xBuilder->weld_button("goto"))
303  , m_xRenameBtn(m_xBuilder->weld_button("rename"))
304  , m_xHideCB(m_xBuilder->weld_check_button("hide"))
305  , m_xConditionFT(m_xBuilder->weld_label("condlabel"))
306  , m_xConditionED(new ConditionEdit(m_xBuilder->weld_entry("withcond")))
307  , m_xBookmarksBox(new BookmarkTable(m_xBuilder->weld_tree_view("bookmarks")))
308  , m_xForbiddenChars(m_xBuilder->weld_label("lbForbiddenChars"))
309 {
310  m_xBookmarksBox->connect_changed(LINK(this, SwInsertBookmarkDlg, SelectionChangedHdl));
311  m_xBookmarksBox->connect_row_activated(LINK(this, SwInsertBookmarkDlg, DoubleClickHdl));
312  m_xBookmarksBox->connect_column_clicked(LINK(this, SwInsertBookmarkDlg, HeaderBarClick));
313  m_xEditBox->connect_changed(LINK(this, SwInsertBookmarkDlg, ModifyHdl));
314  m_xInsertBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, InsertHdl));
315  m_xDeleteBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
316  m_xGotoBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, GotoHdl));
317  m_xRenameBtn->connect_clicked(LINK(this, SwInsertBookmarkDlg, RenameHdl));
318  m_xHideCB->connect_toggled(LINK(this, SwInsertBookmarkDlg, ChangeHideHdl));
319 
320  m_xDeleteBtn->set_sensitive(false);
321  m_xGotoBtn->set_sensitive(false);
322  m_xRenameBtn->set_sensitive(false);
323 
324  PopulateTable();
325 
326  m_xEditBox->set_text(m_xBookmarksBox->GetNameProposal());
327  m_xEditBox->set_position(-1);
328 
329  m_xForbiddenChars->set_label(SwResId(STR_BOOKMARK_FORBIDDENCHARS) + " " + BookmarkTable::aForbiddenChars);
330  m_xForbiddenChars->set_visible(false);
331 
332  SvtMiscOptions aMiscOpt;
333  if ( !aMiscOpt.IsExperimentalMode() )
334  {
335  m_xHideCB->set_visible( false );
336  m_xConditionFT->set_visible( false );
337  m_xConditionED->set_visible( false );
338  }
339 
341 
342  // disabled until "Hide" flag is not checked
343  m_xConditionED->set_sensitive(false);
344  m_xConditionFT->set_sensitive(false);
345 }
346 
347 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
348 {
349  if (!m_bSorted)
350  {
351  m_xBookmarksBox->make_sorted();
352  m_bSorted = true;
353  }
354 
355  bool bSortAtoZ = m_xBookmarksBox->get_sort_order();
356 
357  //set new arrow positions in headerbar
358  if (nColumn == m_xBookmarksBox->get_sort_column())
359  {
360  bSortAtoZ = !bSortAtoZ;
361  m_xBookmarksBox->set_sort_order(bSortAtoZ);
362  }
363  else
364  {
365  int nOldSortColumn = m_xBookmarksBox->get_sort_column();
366  if (nOldSortColumn != -1)
367  m_xBookmarksBox->set_sort_indicator(TRISTATE_INDET, nOldSortColumn);
368  m_xBookmarksBox->set_sort_column(nColumn);
369  }
370 
371  if (nColumn != -1)
372  {
373  //sort lists
374  m_xBookmarksBox->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn);
375  }
376 }
377 
379 {
380 }
381 
382 BookmarkTable::BookmarkTable(std::unique_ptr<weld::TreeView> xControl)
383  : m_xControl(std::move(xControl))
384 {
385  m_xControl->set_size_request(450, 250);
386  std::vector<int> aWidths;
387  aWidths.push_back(40);
388  aWidths.push_back(110);
389  aWidths.push_back(150);
390  aWidths.push_back(60);
391  m_xControl->set_column_fixed_widths(aWidths);
392  m_xControl->set_selection_mode(SelectionMode::Multiple);
393 }
394 
395 std::unique_ptr<weld::TreeIter> BookmarkTable::get_selected() const
396 {
397  std::unique_ptr<weld::TreeIter> xIter(m_xControl->make_iterator());
398  if (!m_xControl->get_selected(xIter.get()))
399  xIter.reset();
400  return xIter;
401 }
402 
404 {
405  sw::mark::IBookmark* pBookmark = dynamic_cast<sw::mark::IBookmark*>(pMark);
406  assert(pBookmark);
407 
408  OUString sBookmarkNodeText = pBookmark->GetMarkStart().nNode.GetNode().GetTextNode()->GetText();
409  sal_Int32 nBookmarkNodeTextPos = pBookmark->GetMarkStart().nContent.GetIndex();
410  sal_Int32 nBookmarkTextLen = 0;
411  bool bPulledAll = false;
412  bool bPulling = false;
413  static const sal_Int32 nMaxTextLen = 50;
414 
415  if (pBookmark->IsExpanded())
416  {
417  nBookmarkTextLen = pBookmark->GetMarkEnd().nContent.GetIndex() - nBookmarkNodeTextPos;
418  }
419  else
420  {
421  if (nBookmarkNodeTextPos == sBookmarkNodeText.getLength()) // no text after bookmark
422  {
423  nBookmarkNodeTextPos = std::max<sal_Int32>(0, nBookmarkNodeTextPos - nMaxTextLen);
424  bPulling = true;
425  if (nBookmarkNodeTextPos == 0)
426  bPulledAll = true;
427  }
428  nBookmarkTextLen = sBookmarkNodeText.getLength() - nBookmarkNodeTextPos;
429  }
430  bool bExceedsLength = nBookmarkTextLen > nMaxTextLen;
431  nBookmarkTextLen = std::min<sal_Int32>(nMaxTextLen, nBookmarkTextLen);
432  sBookmarkNodeText = sBookmarkNodeText.copy(nBookmarkNodeTextPos, nBookmarkTextLen).trim();
433  if (bExceedsLength)
434  sBookmarkNodeText += "...";
435  else if (bPulling && !bPulledAll)
436  sBookmarkNodeText = "..." + sBookmarkNodeText;
437 
438  OUString sHidden = SwResId(STR_BOOKMARK_NO);
439  if (pBookmark->IsHidden())
440  sHidden = SwResId(STR_BOOKMARK_YES);
441  const OUString& sHideCondition = pBookmark->GetHideCondition();
442  OUString sPageNum = OUString::number(SwPaM(pMark->GetMarkStart()).GetPageNum());
443  int nRow = m_xControl->n_children();
444  m_xControl->append(OUString::number(reinterpret_cast<sal_Int64>(pMark)), sPageNum);
445  m_xControl->set_text(nRow, pBookmark->GetName(), 1);
446  m_xControl->set_text(nRow, sBookmarkNodeText, 2);
447  m_xControl->set_text(nRow, sHidden, 3);
448  m_xControl->set_text(nRow, sHideCondition, 4);
449 }
450 
451 std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const OUString& sName)
452 {
453  std::unique_ptr<weld::TreeIter> xRet;
454  m_xControl->all_foreach([this, &sName, &xRet](weld::TreeIter& rEntry){
455  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(rEntry).toInt64());
456  if (pBookmark->GetName() == sName)
457  {
458  xRet = m_xControl->make_iterator(&rEntry);
459  return true;
460  }
461  return false;
462  });
463  return xRet;
464 }
465 
467 {
468  auto xEntry = GetRowByBookmarkName(sName);
469  if (!xEntry)
470  return nullptr;
471 
472  return reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(*xEntry).toInt64());
473 }
474 
475 void BookmarkTable::SelectByName(const OUString& sName)
476 {
477  auto xEntry = GetRowByBookmarkName(sName);
478  if (!xEntry)
479  return;
480  select(*xEntry);
481 }
482 
484 {
485  OUString sDefaultBookmarkName = SwResId(STR_BOOKMARK_DEF_NAME);
486  sal_Int32 nHighestBookmarkId = 0;
487  for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
488  {
489  sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xControl->get_id(i).toInt64());
490  const OUString& sName = pBookmark->GetName();
491  sal_Int32 nIndex = 0;
492  if (sName.getToken(0, ' ', nIndex) == sDefaultBookmarkName)
493  {
494  sal_Int32 nCurrBookmarkId = sName.getToken(0, ' ', nIndex).toInt32();
495  nHighestBookmarkId = std::max<sal_Int32>(nHighestBookmarkId, nCurrBookmarkId);
496  }
497  }
498  return sDefaultBookmarkName + " " + OUString::number(nHighestBookmarkId + 1);
499 }
500 
501 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsExperimentalMode() const
virtual void SetForbiddenChars(const OUString &rSet)=0
static constexpr OUStringLiteral aForbiddenChars
Definition: bookmark.hxx:60
virtual ~SwInsertBookmarkDlg() override
Definition: bookmark.cxx:378
sal_Int32 nIndex
virtual const OUString & GetName() const =0
SwWrtShell & rSh
Definition: bookmark.hxx:66
std::unique_ptr< weld::TreeView > m_xControl
Definition: bookmark.hxx:32
const OUString & GetText() const
Definition: ndtxt.hxx:211
Reference< XControl > m_xControl
SwNodeIndex nNode
Definition: pam.hxx:37
virtual sal_Int32 getBookmarksCount() const =0
returns the number of IBookmarks.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
std::unique_ptr< weld::Button > m_xInsertBtn
Definition: bookmark.hxx:73
std::unique_ptr< weld::Label > m_xConditionFT
Definition: bookmark.hxx:78
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
Definition: docbm.cxx:474
Provides access to the marks of a document.
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
Definition: viewsh.cxx:2602
SwNode & GetNode() const
Definition: ndindex.hxx:119
void EnterStdMode()
Definition: select.cxx:550
virtual short Execute()=0
TRISTATE_TRUE
bool HaveBookmarksChanged()
Definition: bookmark.cxx:251
std::unique_ptr< weld::Label > m_xForbiddenChars
Definition: bookmark.hxx:81
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual const OUString & GetHideCondition() const =0
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
SwIndex nContent
Definition: pam.hxx:38
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
int nCount
std::unique_ptr< weld::Button > m_xRenameBtn
Definition: bookmark.hxx:76
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
Definition: viewsh.cxx:2606
std::unique_ptr< weld::CheckButton > m_xHideCB
Definition: bookmark.hxx:77
std::unique_ptr< weld::TreeIter > GetRowByBookmarkName(const OUString &sName)
Definition: bookmark.cxx:451
sal_Int32 m_nLastBookmarksCount
Definition: bookmark.hxx:68
TRISTATE_INDET
const char * sName
std::unique_ptr< ConditionEdit > m_xConditionED
Definition: bookmark.hxx:79
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=0
Deletes a mark.
char const sHidden[]
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
SwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh)
Definition: bookmark.cxx:294
int i
SwAbstractDialogFactory & GetFactory()
Definition: swuiexp.cxx:26
std::unique_ptr< weld::Button > m_xDeleteBtn
Definition: bookmark.hxx:74
std::unique_ptr< BookmarkTable > m_xBookmarksBox
Definition: bookmark.hxx:80
TRISTATE_FALSE
static const char cSeparator
Definition: bookmark.hxx:61
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
OUString GetNameProposal() const
Definition: bookmark.cxx:483
IMPL_LINK_NOARG(SwInsertBookmarkDlg, ModifyHdl, weld::Entry &, void)
Definition: bookmark.cxx:44
void select(const weld::TreeIter &rIter)
Definition: bookmark.hxx:45
void SelectByName(const OUString &sName)
Definition: bookmark.cxx:475
std::vector< std::pair< sw::mark::IMark *, OUString > > aTableBookmarks
Definition: bookmark.hxx:67
void GotoMark(const ::sw::mark::IMark *const pMark)
Definition: wrtsh3.cxx:133
BookmarkTable(std::unique_ptr< weld::TreeView > xControl)
Definition: bookmark.cxx:382
bool ValidateBookmarks()
Check if displayed bookmarks are up-to date, if not update them.
Definition: bookmark.cxx:240
std::unique_ptr< weld::TreeIter > get_selected() const
Definition: bookmark.cxx:395
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
sal_Int32 GetIndex() const
Definition: index.hxx:91
RET_OK
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Entry > m_xEditBox
Definition: bookmark.hxx:72
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual const SwPosition & GetMarkEnd() const =0
std::unique_ptr< weld::Button > m_xGotoBtn
Definition: bookmark.hxx:75
void AppendItem(const SfxPoolItem &)
Reference< XModel > xModel
sw::mark::IMark * GetBookmarkByName(const OUString &sName)
Definition: bookmark.cxx:466
virtual const SwPosition & GetMarkStart() const =0
void GotoSelectedBookmark()
Definition: bookmark.cxx:224
void InsertBookmark(sw::mark::IMark *pMark)
Definition: bookmark.cxx:403
virtual bool IsExpanded() const =0
virtual VclPtr< AbstractSwRenameXNamedDlg > CreateSwRenameXNamedDlg(weld::Window *pParent, css::uno::Reference< css::container::XNamed > &xNamed, css::uno::Reference< css::container::XNameAccess > &xNameAccess)=0
virtual bool IsHidden() const =0
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:844
IMPL_LINK(SwInsertBookmarkDlg, ChangeHideHdl, weld::ToggleButton &, rBox, void)
Definition: bookmark.cxx:217