~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/displaywindow/cmodulechooserbutton.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CMODULECHOOSERBUTTON_H
 
13
#define CMODULECHOOSERBUTTON_H
 
14
 
 
15
//BibleTime includes
 
16
#include "backend/cswordmoduleinfo.h"
 
17
#include "util/cpointers.h"
 
18
 
 
19
//Qt includes
 
20
#include <qdict.h>
 
21
#include <qtoolbutton.h>
 
22
 
 
23
//KDE includes
 
24
#include <ktoolbarbutton.h>
 
25
#include <kpopupmenu.h>
 
26
 
 
27
class KPopupMenu;
 
28
class CModuleChooserBar;
 
29
 
 
30
/** The CModuleChooserButton displays a list of submenus sorted by language which contain the possible modules
 
31
  * which can be displayed together with the first one.
 
32
  * @author The BibleTime team
 
33
  */
 
34
class CModuleChooserButton : public KToolBarButton, public CPointers  {
 
35
        Q_OBJECT
 
36
public:
 
37
        CModuleChooserButton(CSwordModuleInfo* useModule, CSwordModuleInfo::ModuleType type, const int id, CModuleChooserBar *parent, const char *name = 0 );
 
38
        ~CModuleChooserButton();
 
39
 
 
40
        CSwordModuleInfo* module();
 
41
        /**
 
42
        * Returns the id used for this button.
 
43
        */
 
44
        int getId() const;
 
45
        void updateMenuItems();
 
46
 
 
47
protected: // Protected methods
 
48
        void populateMenu();
 
49
 
 
50
private:
 
51
        /**
 
52
        * Returns the icon used for the current status.
 
53
        */
 
54
        const QString iconName();
 
55
 
 
56
        bool m_hasModule;
 
57
        int m_id;
 
58
        int m_noneId;
 
59
        int m_titleId;
 
60
        CSwordModuleInfo::ModuleType m_moduleType;
 
61
        CSwordModuleInfo* m_module;
 
62
 
 
63
        KPopupMenu* m_popup;
 
64
        QPtrList<KPopupMenu> m_submenus;
 
65
 
 
66
        CModuleChooserBar* m_moduleChooserBar;
 
67
 
 
68
 
 
69
private slots:
 
70
        void moduleChosen(int ID );
 
71
 
 
72
signals:
 
73
        void sigRemoveButton(const int ID);
 
74
        void sigAddButton();
 
75
        void sigChanged();
 
76
};
 
77
#endif