Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / navmgr.hxx
blob858b990fd11d46ef1559161f183161ce806fcde3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_NAVMGR_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_NAVMGR_HXX
12 #include <vector>
14 #include <unocrsr.hxx>
16 class SwWrtShell;
17 struct SwPosition;
18 class SwUnoCursor;
20 class SwNavigationMgr final : public SfxListener
22 private:
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;
33 Stack_t m_entries;
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);
39 public:
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 ? */
44 bool backEnabled() ;
45 /* Can we go forward in the history ? */
46 bool forwardEnabled();
47 /* The method that is called when we click the back button */
48 void goBack() ;
49 /* The method that is called when we click the forward button */
50 void goForward() ;
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;
56 #endif
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */