File: qtbars.h

package info (click to toggle)
turqstat 3.0-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,112 kB
  • ctags: 1,328
  • sloc: cpp: 17,929; perl: 252; makefile: 223; ansic: 75; sh: 16
file content (72 lines) | stat: -rw-r--r-- 2,132 bytes parent folder | download
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
// Copyright (c) 2000-2008 Peter Karlsson
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef QTBARS_H
#define QTBARS_H

#include <qdialog.h>

class StatEngine;
class QProgressBar;

/**
 * Class describing a window showing bars with posting frequencies. This
 * class is used in the Qt version to display the postings per weekday and
 * postings per hour graphs.
 */
class BarWindow : public QDialog
{
    Q_OBJECT

public:
    /**
     * Numeric constants describing all available frequency graphs that can
     * be displayed by this class.
     */
    enum bar_e
    {
        Days,   ///< Weekday posting frequencies.
        Hours   ///< Hour posting frequencies.
    };

    /**
     * Standard constructor. Creates a window ready to fill in with toplist
     * data.
     * @param parent  Parent widget owning the window.
     * @param name    Name given to this instance.
     * @param bartype Type of graph to display in the window.
     */
    BarWindow(QWidget *parent, const char *name, bar_e bartype);
    /** Standard destructor. */
    ~BarWindow();

    /**
     * Fill the graph with statistics from loaded message bases.
     * @param engine Pointer to the engine containing the statistics.
     */
    void fillOut(StatEngine *engine);

protected:
    /** Array of progress bars (ab)used to display frequencies. */
    QProgressBar **m_bars_pp;

    /** The kind of frequencies associated with this object. */
    enum bar_e type;

    /** Number of entries in the QProgressBar array. */
    int m_numentries;
};

#endif