summaryrefslogtreecommitdiff
path: root/src/frontend/btbookshelfdockwidget.h
blob: 988bb3c76c2e4ff90ab156396eabd9e5cb3511f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*********
*
* In the name of the Father, and of the Son, and of the Holy Spirit.
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2009 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License
* version 2.0.
*
**********/

#ifndef BTBOOKSHELFDOCKWIDGET_H
#define BTBOOKSHELFDOCKWIDGET_H

#include <QDockWidget>

class CSwordModuleInfo;
class BtBookshelfView;
class BtBookshelfTreeModel;
class BtCheckStateFilterProxyModel;
class BtModuleNameFilterProxyModel;
class QAction;
class QActionGroup;
class QLabel;
class QLineEdit;
class QMenu;
class QToolBar;
class QToolButton;

class BtBookshelfDockWidget: public QDockWidget {
        Q_OBJECT
    public:
        BtBookshelfDockWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);

    signals:
        void moduleOpenTriggered(CSwordModuleInfo *module);
        void moduleSearchTriggered(CSwordModuleInfo *module);
        void moduleEditPlainTriggered(CSwordModuleInfo *module);
        void moduleEditHtmlTriggered(CSwordModuleInfo *module);
        void moduleUnlockTriggered(CSwordModuleInfo *module);
        void moduleAboutTriggered(CSwordModuleInfo *module);

    protected:
        bool eventFilter(QObject *object, QEvent *event);
        void initMenus();
        void retranslateInterface();

    protected slots:
        void showContextMenu(QPoint pos);
        void groupingActionTriggered(QAction *action);
        void showHideEnabled(bool enable);
        void showItemContextMenu(CSwordModuleInfo *module, QPoint pos);
        void itemActionTriggered(QAction *action);

    protected:
        // Models:
        BtBookshelfTreeModel         *m_bookshelfTreeModel;
        BtCheckStateFilterProxyModel *m_filterProxyModel;
        BtModuleNameFilterProxyModel *m_nameFilterProxyModel;

        // Widgets:
        QWidget *m_widget;
        BtBookshelfView *m_view;
        QLabel          *m_nameFilterLabel;
        QLineEdit       *m_nameFilterEdit;
        QToolButton     *m_groupingButton;
        QToolButton     *m_showHideButton;

        // Popup menus:
        QMenu *m_contextMenu;
        QMenu *m_groupingMenu;
        QActionGroup *m_groupingActionGroup;
        QAction *m_groupingCatLangAction;
        QAction *m_groupingCatAction;
        QAction *m_groupingLangCatAction;
        QAction *m_groupingLangAction;
        QAction *m_groupingNoneAction;
        QAction *m_showHideAction;
        QMenu *m_itemContextMenu;
        QActionGroup *m_itemActionGroup;
        QAction *m_itemOpenAction;
        QAction *m_itemSearchAction;
        QMenu   *m_itemEditMenu;
        QAction *m_itemEditPlainAction;
        QAction *m_itemEditHtmlAction;
        QAction *m_itemUnlockAction;
        QAction *m_itemAboutAction;
};

#endif // BTBOOKSHELFDOCKWIDGET_H