summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/displaywindow/cmodulechooserbar.h
blob: 0ab2009bfdbe11187bf4ecf1877da66b09501f5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2006 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/



#ifndef CMODULECHOOSERBAR_H
#define CMODULECHOOSERBAR_H

//BibleTime includes
#include "cmodulechooserbutton.h"

#include "backend/cswordmoduleinfo.h"

#include "util/cpointers.h"

//Qt includes
#include <qwidget.h>
#include <qhbox.h>

//KDE includes
#include <ktoolbar.h>

/**
  * @author The BibleTime team
  */
class CModuleChooserBar : public KToolBar  {
	Q_OBJECT
public:
	/**
	* Default constructor
	*/
	CModuleChooserBar(ListCSwordModuleInfo useModules, CSwordModuleInfo::ModuleType type,  QWidget *parent=0, const char *name=0);
	/**
	* Returns a list of selected modules.
	*/
	ListCSwordModuleInfo getModuleList();
	/**
	* Sets the number of the maximum count of buttons.
	*/
	void setButtonLimit( const int limit);
	/**
	* Sets the modules which are chosen in this module chooser bar.
	*/
	void setModules( ListCSwordModuleInfo modules );

protected:
	/**
	 * Adds a button to the toolbar
	 */
	CModuleChooserButton* const addButton( CSwordModuleInfo* const module );

protected slots: // Protected slots
	/* Add a button
	* This slot calls the addButton function above to add a button.
	*/
	void addButton();
	/**
	* Removes a button from the toolbar
	*/
	void removeButton( const int ID );
	void updateMenuItems();

private:
	CSwordModuleInfo::ModuleType m_moduleType;
	int m_idCounter;
	int m_buttonLimit;
	QPtrList<CModuleChooserButton> m_buttonList;

signals: // Signals
	void sigChanged();
};

#endif