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

« back to all changes in this revision

Viewing changes to src/backend/keys/cswordversekey.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:
10
10
#ifndef CSWORDVERSEKEY_H
11
11
#define CSWORDVERSEKEY_H
12
12
 
13
 
#include "cswordkey.h"
14
 
class CSwordModuleInfo;
 
13
#include "backend/keys/cswordkey.h"
15
14
 
16
 
//Qt
17
15
#include <QString>
18
16
 
19
 
//Sword
 
17
// Sword includes:
20
18
#include <versekey.h>
21
19
 
 
20
 
 
21
class CSwordModuleInfo;
 
22
 
22
23
/**
23
24
 * The CSwordKey implementation for verse based modules (Bibles and Commentaries)
24
25
 *
44
45
 
45
46
class CSwordVerseKey : public CSwordKey, public sword::VerseKey {
46
47
 
47
 
public:
48
 
        enum JumpType {
49
 
                UseBook,
50
 
                UseChapter,
51
 
                UseVerse
52
 
        };
53
 
 
54
 
        /**
55
 
        * Constructor of this class.
56
 
        *
57
 
        * This function will construct a versekey with the current module position
58
 
        * and it will setup the m_module members.
59
 
        *
60
 
        */
61
 
        CSwordVerseKey( CSwordModuleInfo* const module );
62
 
        /**
63
 
        * Copy constructor.
64
 
        */
65
 
        CSwordVerseKey( const CSwordVerseKey& k );
66
 
        /**
67
 
        * VerseKey based constructor.
68
 
        */
69
 
        CSwordVerseKey( const sword::VerseKey* const k, CSwordModuleInfo* const module );
70
 
        /**
71
 
        * Clones this object.
72
 
        */
73
 
        virtual CSwordKey* copy() const;
74
 
        /**
75
 
        * Set/get the key. If the parameter is not set (means equal to QString::null)
76
 
        * the used key is returned. Otherwise the key is set and the new on ei returned.
77
 
        */
78
 
        virtual QString key() const;
79
 
        /**
80
 
        * Set the current key.
81
 
        */
82
 
        virtual bool key( const QString& );
83
 
        /**
84
 
        * Set/get the key. If the parameter is not set (means equal to QString::null)
85
 
        * the used key is returned. Otherwise the key is set and the new on ei returned.
86
 
        */
87
 
        virtual bool key( const char* key );
88
 
 
89
 
        /**
90
 
        * Jumps to the next entry of the given type
91
 
        */
92
 
        bool next( const JumpType type );
93
 
        /**
94
 
        * Jumps to the previous entry of the given type
95
 
        */
96
 
        bool previous ( const JumpType type );
97
 
        /**
98
 
        * This functions returns the current book as localised text, not as book numer.
99
 
        *
100
 
        * Use "char Book()" to retrieve the book number of the current book.
101
 
        * @return The name of the current book
102
 
        */
103
 
        QString book(const QString& newBook = QString::null);
104
 
        /**
105
 
        * Sets the module for this key
106
 
        */
107
 
        virtual CSwordModuleInfo* module( CSwordModuleInfo* const newModule = 0 );
108
 
 
109
 
protected:
110
 
        /**
111
 
         * Returns the raw key appropriate for use directly with Sword.
112
 
         */
113
 
        virtual const char * rawKey() const;
114
 
 
115
 
private:
116
 
        /** Disable assignment operator */
117
 
        CSwordVerseKey& operator= (const CSwordVerseKey&);
118
 
        /** Disable from base class to prevent compiler warnings */
119
 
        inline virtual CSwordVerseKey& operator= (const sword::VerseKey&) { return (*this); };
 
48
    public:
 
49
        enum JumpType {
 
50
            UseBook,
 
51
            UseChapter,
 
52
            UseVerse
 
53
        };
 
54
 
 
55
        /**
 
56
        * Constructor of this class.
 
57
        *
 
58
        * This function will construct a versekey with the current module position
 
59
        * and it will setup the m_module members.
 
60
        *
 
61
        */
 
62
        CSwordVerseKey( CSwordModuleInfo* const module );
 
63
        /**
 
64
        * Copy constructor.
 
65
        */
 
66
        CSwordVerseKey( const CSwordVerseKey& k );
 
67
        /**
 
68
        * VerseKey based constructor.
 
69
        */
 
70
        CSwordVerseKey( const sword::VerseKey* const k, CSwordModuleInfo* const module );
 
71
        /**
 
72
        * Clones this object.
 
73
        */
 
74
        virtual CSwordKey* copy() const;
 
75
        /**
 
76
        * Set/get the key. If the parameter is not set (means equal to QString::null)
 
77
        * the used key is returned. Otherwise the key is set and the new on ei returned.
 
78
        */
 
79
        virtual QString key() const;
 
80
        /**
 
81
        * Set the current key.
 
82
        */
 
83
        virtual bool key( const QString& );
 
84
        /**
 
85
        * Set/get the key. If the parameter is not set (means equal to QString::null)
 
86
        * the used key is returned. Otherwise the key is set and the new on ei returned.
 
87
        */
 
88
        virtual bool key( const char* key );
 
89
 
 
90
        /**
 
91
        * Jumps to the next entry of the given type
 
92
        */
 
93
        bool next( const JumpType type );
 
94
        /**
 
95
        * Jumps to the previous entry of the given type
 
96
        */
 
97
        bool previous ( const JumpType type );
 
98
        /**
 
99
        * This functions returns the current book as localised text, not as book numer.
 
100
        *
 
101
        * Use "char Book()" to retrieve the book number of the current book.
 
102
        * @return The name of the current book
 
103
        */
 
104
        QString book(const QString& newBook = QString::null);
 
105
        /**
 
106
        * Sets the module for this key
 
107
        */
 
108
        virtual CSwordModuleInfo* module( CSwordModuleInfo* const newModule = 0 );
 
109
 
 
110
    protected:
 
111
        /**
 
112
         * Returns the raw key appropriate for use directly with Sword.
 
113
         */
 
114
        virtual const char * rawKey() const;
 
115
 
 
116
    private:
 
117
        /** Disable assignment operator */
 
118
        CSwordVerseKey& operator= (const CSwordVerseKey&);
 
119
        /** Disable from base class to prevent compiler warnings */
 
120
        inline virtual CSwordVerseKey& operator= (const sword::VerseKey&) {
 
121
            return (*this);
 
122
        };
120
123
};
121
124
 
122
125
#endif