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

« back to all changes in this revision

Viewing changes to src/frontend/displaywindow/cbuttons.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:
7
7
*
8
8
**********/
9
9
 
10
 
 
11
 
 
12
10
#ifndef CBUTTONS_H
13
11
#define CBUTTONS_H
14
12
 
15
 
//BibleTime includes
 
13
#include <QToolButton>
 
14
 
 
15
#include <QHash>
16
16
#include "backend/managers/cswordbackend.h"
 
17
 
 
18
 
17
19
class CSwordModuleInfo;
18
 
 
19
 
//QT includes
20
 
#include <QHash>
21
 
#include <QToolButton>
22
 
 
23
20
class QMenu;
24
21
 
25
22
/** This class manages the display options of the selected modules.
26
23
  * @author The BibleTime team
27
24
  */
28
25
class CDisplaySettingsButton : public QToolButton  {
29
 
        Q_OBJECT
30
 
public:
31
 
 
32
 
        CDisplaySettingsButton(CSwordBackend::DisplayOptions *displaySettings, CSwordBackend::FilterOptions *settings, const QList<CSwordModuleInfo*>& useModules, QWidget *parent=0);
33
 
        void reset(const QList<CSwordModuleInfo*>& useModules);
34
 
        /**
35
 
        * Sets the item at position pos to the satet given as 2nd paramter.
36
 
        */
37
 
        void setItemStatus( const int pos, const bool checked );
38
 
        /**
39
 
        * Returns the number of usable menu items in the setttings menu.
40
 
        */
41
 
        int menuItemCount();
42
 
        /**
43
 
        * Returns the status of the item at position "index"
44
 
        */
45
 
        bool itemStatus( const int index );
46
 
        /**
47
 
        * Sets the status to changed. The signal changed will be emitted.
48
 
        */
49
 
        void setChanged();
50
 
 
51
 
signals:
52
 
        void sigChanged(void);
53
 
 
54
 
protected slots:
55
 
        void optionToggled(QAction* action);
56
 
 
57
 
protected:
58
 
 
59
 
        /** This enum marks the option types for a display. Used internally.*/
60
 
        enum OptionType {Linebreak, Versenum, Headings, WordsofJ, Vowel, Cantillation, Accents,
61
 
                                        Variant, Xref, Morphseg};
62
 
 
63
 
        CSwordBackend::FilterOptions*  m_moduleSettings;
64
 
        CSwordBackend::DisplayOptions* m_displaySettings;
65
 
        CSwordBackend::FilterOptions m_available;
66
 
        QList<CSwordModuleInfo*> m_modules;
67
 
 
68
 
        QHash<QString, int> m_dict;
69
 
 
70
 
        QMenu* m_popup;
71
 
 
72
 
        int populateMenu();
73
 
        bool isOptionAvailable( const CSwordModuleInfo::FilterTypes option);
74
 
        int addMenuEntry( const QString name, OptionType type, const int* option, const bool available);
 
26
        Q_OBJECT
 
27
    public:
 
28
 
 
29
        CDisplaySettingsButton(CSwordBackend::DisplayOptions *displaySettings, CSwordBackend::FilterOptions *settings, const QList<CSwordModuleInfo*>& useModules, QWidget *parent = 0);
 
30
        void reset(const QList<CSwordModuleInfo*>& useModules);
 
31
        /**
 
32
        * Sets the item at position pos to the satet given as 2nd paramter.
 
33
        */
 
34
        void setItemStatus( const int pos, const bool checked );
 
35
        /**
 
36
        * Returns the number of usable menu items in the setttings menu.
 
37
        */
 
38
        int menuItemCount();
 
39
        /**
 
40
        * Returns the status of the item at position "index"
 
41
        */
 
42
        bool itemStatus( const int index );
 
43
        /**
 
44
        * Sets the status to changed. The signal changed will be emitted.
 
45
        */
 
46
        void setChanged();
 
47
 
 
48
    signals:
 
49
        void sigChanged(void);
 
50
 
 
51
    protected slots:
 
52
        void optionToggled(QAction* action);
 
53
 
 
54
    protected:
 
55
 
 
56
        /** This enum marks the option types for a display. Used internally.*/
 
57
        enum OptionType {Linebreak, Versenum, Headings, WordsofJ, Vowel, Cantillation, Accents,
 
58
                         Variant, Xref, Morphseg
 
59
                    };
 
60
 
 
61
        CSwordBackend::FilterOptions*  m_moduleSettings;
 
62
        CSwordBackend::DisplayOptions* m_displaySettings;
 
63
        CSwordBackend::FilterOptions m_available;
 
64
        QList<CSwordModuleInfo*> m_modules;
 
65
 
 
66
        QHash<QString, int> m_dict;
 
67
 
 
68
        QMenu* m_popup;
 
69
 
 
70
        int populateMenu();
 
71
        bool isOptionAvailable( const CSwordModuleInfo::FilterTypes option);
 
72
        int addMenuEntry( const QString name, OptionType type, const int* option, const bool available);
75
73
};
76
74
 
77
75
#endif