summaryrefslogtreecommitdiff
path: root/src/backend/drivers/cswordmoduleinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/drivers/cswordmoduleinfo.h')
-rw-r--r--src/backend/drivers/cswordmoduleinfo.h49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/backend/drivers/cswordmoduleinfo.h b/src/backend/drivers/cswordmoduleinfo.h
index ba4b8f6..9f32b12 100644
--- a/src/backend/drivers/cswordmoduleinfo.h
+++ b/src/backend/drivers/cswordmoduleinfo.h
@@ -12,16 +12,17 @@
#include "backend/managers/clanguagemgr.h"
-//Qt
-#include <QString>
#include <QList>
+#include <QMetaType>
+#include <QString>
-//Sword
+// Sword includes:
#include <listkey.h>
-#include <swsearchable.h>
+#include <swdisp.h>
#include <swmodule.h>
+#include <swsearchable.h>
#include <swversion.h>
-#include <swdisp.h>
+
class CSwordBackend;
class CSwordKey;
@@ -125,16 +126,19 @@ class CSwordModuleInfo: public QObject {
featureMax = HebrewParse
};
enum Category {
- Bibles,
- Commentaries,
- Books,
- Lexicons,
- Glossary,
- DailyDevotional,
- Images,
- Cult, /**< The module is a cult / sect / questionable module */
- UnknownCategory /**< The category wasn't set or has an unknown value */
+ UnknownCategory = 0x0, /**< Unknown or unset category. */
+ NoCategory = 0x0,
+ Bibles = 0x01,
+ Commentaries = 0x02,
+ Books = 0x04,
+ Lexicons = 0x08,
+ Glossary = 0x10,
+ DailyDevotional = 0x20,
+ Images = 0x40,
+ Cult = 0x80, /**< Cult / sect / questionable module. */
+ AllCategories = 0xff
};
+ Q_DECLARE_FLAGS(Categories, Category);
/**
* Returns the base directory for search indices
@@ -258,7 +262,7 @@ class CSwordModuleInfo: public QObject {
*/
virtual bool snap() {
return false;
- };
+ }
bool has( const CSwordModuleInfo::Feature ) const;
bool has( const CSwordModuleInfo::FilterTypes ) const;
@@ -285,9 +289,14 @@ class CSwordModuleInfo: public QObject {
/**
* Returns true if this module is hidden (not to be shown with other modules in certain views).
*/
- bool isHidden() const;
+ inline bool isHidden() const { return m_hidden; }
- void setHidden(bool hidden);
+ /**
+ Shows or hides the module.
+ \param hide Whether the module should be hidden.
+ \returns whether the hidden state was changed.
+ */
+ bool setHidden(bool hide);
/**
* Returns the category of this module. See CSwordModuleInfo::Category for possible values.
@@ -308,7 +317,7 @@ class CSwordModuleInfo: public QObject {
public slots:
inline void cancelIndexing() {
m_cancelIndexing = true;
- };
+ }
protected:
friend class CSwordBackend;
@@ -327,6 +336,7 @@ class CSwordModuleInfo: public QObject {
QString getFormattedConfigEntry(const QString& name) const;
signals:
+ void hiddenChanged(bool);
void indexingFinished();
void indexingProgress(int);
@@ -355,6 +365,9 @@ class CSwordModuleInfo: public QObject {
bool m_cancelIndexing;
};
+Q_DECLARE_METATYPE(CSwordModuleInfo::Category);
+Q_DECLARE_OPERATORS_FOR_FLAGS(CSwordModuleInfo::Categories)
+
inline CSwordModuleInfo::ModuleType CSwordModuleInfo::type() const {
return CSwordModuleInfo::Unknown;
}