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