~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

Viewing changes to src/backend/bookshelfmodel/btmodulecategoryfilterproxymodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden
  • Date: 2009-11-18 17:30:00 UTC
  • mfrom: (1.3.4 upstream) (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091118173000-endkhjz5qai88tvr
Tags: 2.4-1
* New upstream version 2.4
* debian/control: 
  - Replace incorrect bibletime-data Depends on lib4qt-gui
    with bibletime Depends on libqtgui4 (>= 4.4.0). (Closes: #556209).
  - Add Build-depends: on zlib1g-dev and libcurl4-gnutls-dev 
    (Closes: #556805).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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, http://www.bibletime.info/.
 
6
*
 
7
* Copyright 1999-2009 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
#ifndef BTMODULECATEGORYFILTERPROXYMODEL_H
 
14
#define BTMODULECATEGORYFILTERPROXYMODEL_H
 
15
 
 
16
#include <QSortFilterProxyModel>
 
17
 
 
18
#include "backend/drivers/cswordmoduleinfo.h"
 
19
 
 
20
 
 
21
class BtModuleCategoryFilterProxyModel: public QSortFilterProxyModel {
 
22
    Q_OBJECT
 
23
    public:
 
24
        BtModuleCategoryFilterProxyModel(QObject *parent = 0);
 
25
        virtual ~BtModuleCategoryFilterProxyModel();
 
26
 
 
27
        inline bool enabled() const {
 
28
            return m_enabled;
 
29
        }
 
30
        void setEnabled(bool enable);
 
31
 
 
32
        inline CSwordModuleInfo::Categories shownCategories() const {
 
33
            return m_filter;
 
34
        }
 
35
 
 
36
        inline CSwordModuleInfo::Categories hiddenCategories() const {
 
37
            return ~m_filter & CSwordModuleInfo::AllCategories;
 
38
        }
 
39
        void setShownCategories(CSwordModuleInfo::Categories cs);
 
40
        void setHiddenCategories(CSwordModuleInfo::Categories cs);
 
41
 
 
42
        virtual bool filterAcceptsRow(int row, const QModelIndex &parent) const;
 
43
 
 
44
    protected:
 
45
        CSwordModuleInfo::Categories m_filter;
 
46
        bool                         m_enabled;
 
47
};
 
48
 
 
49
#endif // BTMODULECATEGORYFILTERPROXYMODEL_H