1/*
2 * This file Copyright (C) Mnemosyne LLC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9 *
10 * $Id: hig.h 11092 2010-08-01 20:36:13Z charles $
11 */
12
13#ifndef QTR_HIG_H
14#define QTR_HIG_H
15
16#include <QWidget>
17
18class QCheckBox;
19class QLabel;
20class QString;
21class QGridLayout;
22class QLayout;
23
24class HIG: public QWidget
25{
26        Q_OBJECT
27
28    public:
29        enum {
30            PAD_SMALL = 3,
31            PAD = 6,
32            PAD_BIG = 12,
33            PAD_LARGE = PAD_BIG
34        };
35
36    public:
37        HIG( QWidget * parent = 0 );
38        virtual ~HIG( );
39
40    public:
41        void addSectionDivider( );
42        void addSectionTitle( const QString& );
43        void addSectionTitle( QWidget* );
44        void addSectionTitle( QLayout* );
45        void addWideControl( QLayout * );
46        void addWideControl( QWidget * );
47        QCheckBox* addWideCheckBox( const QString&, bool isChecked );
48        QLabel* addLabel( const QString& );
49        QLabel* addTallLabel( const QString& );
50        void addLabel( QWidget * );
51        void addTallLabel( QWidget * );
52        void addControl( QWidget * );
53        void addControl( QLayout * );
54        QLabel* addRow( const QString & label, QWidget * control, QWidget * buddy=0 );
55        QLabel* addRow( const QString & label, QLayout * control, QWidget * buddy );
56        void addRow( QWidget * label, QWidget * control, QWidget * buddy=0 );
57        void addRow( QWidget * label, QLayout * control, QWidget * buddy );
58        QLabel* addTallRow( const QString & label, QWidget * control, QWidget * buddy=0 );
59        void finish( );
60
61    private:
62        QLayout* addRow( QWidget* w );
63
64    private:
65        int myRow;
66        bool myHasTall;
67        QGridLayout * myGrid;
68};
69
70#endif // QTR_HIG_H
71