1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_NAVMGR_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_NAVMGR_HXX
14 #include <unocrsr.hxx>
20 class SwNavigationMgr final
: public SfxListener
24 * List of entries in the navigation history
25 * Entries are SwUnoCursor because these gets corrected automatically
26 * when nodes are deleted.
28 * The navigation history behaves as a stack, to which items are added when we jump to a new position
29 * (e.g. click a link, or double click an entry from the navigator).
30 * Every use of the back/forward buttons results in moving the stack pointer within the navigation history
32 typedef std::vector
< sw::UnoCursorPointer
> Stack_t
;
34 Stack_t::size_type m_nCurrent
; /* Current position within the navigation history */
35 SwWrtShell
& m_rMyShell
; /* The active shell within which the navigation occurs */
37 void GotoSwPosition(const SwPosition
&rPos
);
40 /* Constructor that initializes the shell to the current shell */
41 SwNavigationMgr( SwWrtShell
& rShell
);
42 ~SwNavigationMgr() override
;
43 /* Can we go back in the history ? */
45 /* Can we go forward in the history ? */
46 bool forwardEnabled();
47 /* The method that is called when we click the back button */
49 /* The method that is called when we click the forward button */
51 /* The method that adds the position pPos to the navigation history */
52 bool addEntry(const SwPosition
& rPos
);
53 /* to get notified if our cursors self-destruct */
54 virtual void Notify(SfxBroadcaster
& rBC
, const SfxHint
& rHint
) override
;
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */