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