diff options
Diffstat (limited to 'sw/source/uibase/inc/bookmark.hxx')
-rw-r--r-- | sw/source/uibase/inc/bookmark.hxx | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx index 7a94dc3473eb..0754f6988bac 100644 --- a/sw/source/uibase/inc/bookmark.hxx +++ b/sw/source/uibase/inc/bookmark.hxx @@ -21,47 +21,68 @@ #include <svx/stddlg.hxx> #include <vcl/fixed.hxx> +#include <ndtxt.hxx> #include <vcl/button.hxx> +#include <svtools/simptabl.hxx> +#include <pam.hxx> #include "swlbox.hxx" +#include "IMark.hxx" class SwWrtShell; class SfxRequest; -class BookmarkCombo : public SwComboBox +class BookmarkTable : public SvSimpleTable { - sal_Int32 GetFirstSelEntryPos() const; - sal_Int32 GetNextSelEntryPos(sal_Int32 nPos) const; - sal_Int32 GetSelEntryPos(sal_Int32 nPos) const; - - virtual bool PreNotify(NotifyEvent& rNEvt) override; + SvTreeListEntry* GetRowByBookmarkName(const OUString& sName); public: - BookmarkCombo(vcl::Window* pWin, WinBits nStyle); - - sal_Int32 GetSelectEntryCount() const; - sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const; + BookmarkTable(SvSimpleTableContainer& rParent); + void InsertBookmark(sw::mark::IMark* pMark); + void SelectByName(const OUString& sName); + sw::mark::IMark* GetBookmarkByName(const OUString& sName); + OUString GetNameProposal(); static const OUString aForbiddenChars; + static const OUString sDefaultBookmarkName; + static const char cSeparator; }; class SwInsertBookmarkDlg: public SvxStandardDialog { - VclPtr<BookmarkCombo> m_pBookmarkBox; - VclPtr<OKButton> m_pOkBtn; - VclPtr<PushButton> m_pDeleteBtn; - - OUString sRemoveWarning; - SwWrtShell &rSh; - SfxRequest& rReq; + VclPtr<SvSimpleTableContainer> m_pBookmarksContainer; + VclPtr<BookmarkTable> m_pBookmarksBox; + VclPtr<Edit> m_pEditBox; + VclPtr<PushButton> m_pInsertBtn; + VclPtr<PushButton> m_pDeleteBtn; + VclPtr<PushButton> m_pGotoBtn; + VclPtr<PushButton> m_pRenameBtn; + OUString sRemoveWarning; + SwWrtShell& rSh; + SfxRequest& rReq; + std::vector<std::pair<sw::mark::IMark*, OUString>> aTableBookmarks; DECL_LINK_TYPED(ModifyHdl, Edit&, void); + DECL_LINK_TYPED(InsertHdl, Button*, void); DECL_LINK_TYPED(DeleteHdl, Button*, void); + DECL_LINK_TYPED(RenameHdl, Button*, void); + DECL_LINK_TYPED(GotoHdl, Button*, void); + DECL_LINK_TYPED(SelectionChangedHdl, SvTreeListBox*, void); + DECL_LINK_TYPED(DoubleClickHdl, SvTreeListBox*, bool); + // Fill table with bookmarks + void PopulateTable(); + /** + * Check if displayed bookmarks are up-to date, if not update them. + * @return True if no update was needed. + */ + bool ValidateBookmarks(); + bool HaveBookmarksChanged(); + void GotoSelectedBookmark(); virtual void Apply() override; public: - SwInsertBookmarkDlg(vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq); + SwInsertBookmarkDlg(vcl::Window* pParent, SwWrtShell& rSh, SfxRequest& rReq); virtual ~SwInsertBookmarkDlg(); virtual void dispose() override; }; |