]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/qt-console/util/comboutil.h
Backport from BEE
[bacula/bacula] / bacula / src / qt-console / util / comboutil.h
1 #ifndef _COMBOUTIL_H_
2 #define _COMBOUTIL_H_
3 /*
4    Bacula® - The Network Backup Solution
5
6    Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
7
8    The main author of Bacula is Kern Sibbald, with contributions from many
9    others, a complete list can be found in the file AUTHORS.
10
11    You may use this file and others of this release according to the
12    license defined in the LICENSE file, which includes the Affero General
13    Public License, v3.0 ("AGPLv3") and some additional permissions and
14    terms pursuant to its AGPLv3 Section 7.
15
16    Bacula® is a registered trademark of Kern Sibbald.
17 */
18 /*
19  *   Version $Id$
20  *
21  *   Combobox helpers - Riccardo Ghetta, May 2008
22  */
23
24 class QComboBox;
25 class QString;
26 class QStringList;
27
28 /* selects value val on combo, if exists */
29 void comboSel(QComboBox *combo, const QString &val);
30
31 /* if the combo has selected something different from "Any" uses the selection
32  * to build a condition on field fldname and adds it to the condition list */
33 void comboCond(QStringList &cndlist, const QComboBox *combo, const char *fldname);
34
35 /* these helpers are used to give an uniform content to common combos.
36  * There are two routines per combo type:
37  * - XXXXComboFill fills the combo with values.
38  * - XXXXComboCond checks the combo and, if selected adds a condition
39  *   on the field fldName to the list of conditions cndList
40  */
41
42 /* boolean combo (yes/no) */
43 void boolComboFill(QComboBox *combo);
44 void boolComboCond(QStringList &cndlist, const QComboBox *combo, const char *fldname);
45
46 /* backup level combo */
47 void levelComboFill(QComboBox *combo);
48 void levelComboCond(QStringList &cndlist, const QComboBox *combo, const char *fldname);
49
50 /* job status combo */
51 void jobStatusComboFill(QComboBox *combo);
52 void jobStatusComboCond(QStringList &cndlist, const QComboBox *combo, const char *fldname);
53
54 #endif /* _COMBOUTIL_H_ */