diff options
author | Jakub Trzebiatowski <ubap.dev@gmail.com> | 2016-03-11 20:58:34 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-25 08:53:50 +0000 |
commit | 08da15cabdcef60191f4ed98ed694eba3e35b5e1 (patch) | |
tree | 50ca7ad892cbbfa171f948d831032f5ea4604dcc /sw/source/uibase/inc/bookmark.hxx | |
parent | d1b8dcd5d3fa545df4f4ed2714d4424b32286173 (diff) |
tdf#90855 Improve the 'Insert Bookmark' dialog
implemented:
- display page number
- displaying bookmark text
- goto (button and table doubleclick)
- help
- rename
- selecting multiple bookmarks in TableView or in EditField by ";"
- sorting by any column
Change-Id: I7523dc066380bc360bd484c88a6f4ba45e867320
Reviewed-on: https://gerrit.libreoffice.org/23156
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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; }; |