BibleTime
src
frontend
keychooser
bthistory.h
Go to the documentation of this file.
1
/*********
2
*
3
* In the name of the Father, and of the Son, and of the Holy Spirit.
4
*
5
* This file is part of BibleTime's source code, https://bibletime.info/
6
*
7
* Copyright 1999-2021 by the BibleTime developers.
8
* The BibleTime source code is licensed under the GNU General Public License
9
* version 2.0.
10
*
11
**********/
12
13
#pragma once
14
15
#include <QObject>
16
17
#include <QList>
18
#include <QString>
19
20
21
class
CSwordKey
;
22
class
QAction
;
23
24
class
BTHistory
:
public
QObject
{
25
Q_OBJECT
26
public
:
27
BTHistory
(
QObject
* parent);
28
29
/**
30
* Return a list of Actions behind the current point, the first of the history list will be the
31
* last in the returned list and vice versa.
32
*/
33
QList<QAction*>
getBackList
();
34
/**
35
* Return a list of Actions after the current point.
36
*/
37
QList<QAction*>
getFwList
();
38
39
public
Q_SLOTS:
40
/**
41
* Add a new key to the history.
42
*/
43
void
add
(
CSwordKey
* newKey);
44
/**
45
* Move the current point in history list.
46
*/
47
void
move
(
QAction
*);
48
/**
49
* Go back one step in history.
50
*/
51
void
back
();
52
/**
53
* Go forward one step in history.
54
*/
55
void
fw
();
56
57
Q_SIGNALS:
58
/**
59
* Signal will be sent when the history has been changed (added, moved)
60
*/
61
void
historyChanged
(
bool
backEnabled,
bool
fwEnabled);
62
/**
63
* Signal will be sent when the current point in history has moved
64
*/
65
void
historyMoved
(QString newKey);
66
67
private
:
68
69
void
sendChangedSignal
();
70
bool
class_invariant
();
71
72
QList<QAction*>
m_historyList
;
73
int
m_index
= -1;
//pointer to the current item; -1==empty, 0==first etc.
74
bool
m_inHistoryFunction
=
false
;
//to prevent recursive behaviour
75
};
BTHistory
Definition:
bthistory.h:24
BTHistory::m_historyList
QList< QAction * > m_historyList
Definition:
bthistory.h:72
BTHistory::move
void move(QAction *)
Definition:
bthistory.cpp:45
BTHistory::BTHistory
BTHistory(QObject *parent)
Definition:
bthistory.cpp:25
BTHistory::historyMoved
void historyMoved(QString newKey)
BTHistory::fw
void fw()
Definition:
bthistory.cpp:67
BTHistory::getFwList
QList< QAction * > getFwList()
Definition:
bthistory.cpp:85
BTHistory::class_invariant
bool class_invariant()
Definition:
bthistory.cpp:102
BTHistory::sendChangedSignal
void sendChangedSignal()
Definition:
bthistory.cpp:95
BTHistory::getBackList
QList< QAction * > getBackList()
Definition:
bthistory.cpp:74
BTHistory::back
void back()
Definition:
bthistory.cpp:60
BTHistory::m_inHistoryFunction
bool m_inHistoryFunction
Definition:
bthistory.h:74
BTHistory::add
void add(CSwordKey *newKey)
Definition:
bthistory.cpp:29
BTHistory::historyChanged
void historyChanged(bool backEnabled, bool fwEnabled)
BTHistory::m_index
int m_index
Definition:
bthistory.h:73
CSwordKey
Definition:
cswordkey.h:22
QAction
QList
QObject
Generated by
1.9.1