File: qtgui.h

package info (click to toggle)
turqstat 2.2.2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,928 kB
  • ctags: 1,145
  • sloc: cpp: 16,876; perl: 250; makefile: 193; sh: 8
file content (134 lines) | stat: -rw-r--r-- 4,362 bytes parent folder | download | duplicates (2)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Copyright (c) 2000-2001 Peter Karlsson
//
// $Id: qtgui.h,v 1.6 2001/10/27 12:49:39 peter Exp $
//
// 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 __QTGUI_H
#define __QTGUI_H

#include <qobject.h>
#include <qmainwindow.h>
#include <time.h>

class AreaRead;
class StatEngine;
class QMenuBar;
class QLineEdit;
class QProgressDialog;

/**
 * Class describing our main window. This class is used in the Qt version to
 * display the main window to the user.
 */
class InfoWindow : public QMainWindow
{
    Q_OBJECT

public:
    /** Standard constructor. */
    InfoWindow();
    /** Standard destructor. */
    ~InfoWindow();

    /**
     * Retrieve the progress dialog associated with the main window.
     * @return Pointer to the QProgressDialog object used with the main
     *         window.
     */
    QProgressDialog *getProgressDialog() { return progress; };

    /**
     * Retrieve global main window object. Use this static method to
     * retrieve the global (and only) instance of this class. The object is
     * instanciated on the first call.
     *
     * @return The global InfoWindow object.
     */
    static InfoWindow *getMainWindow();

private:
    /** Main menubar. */
    QMenuBar *menu;

    // Data displayers
    QLineEdit *numareas;
    QLineEdit *numtexts;
    QLineEdit *numbytes;
    QLineEdit *numlines;
    QLineEdit *numqbytes;
    QLineEdit *numqlines;
    QLineEdit *numpeople;
    QLineEdit *numsubjects;
    QLineEdit *numprograms;
    QLineEdit *numnets;
    QLineEdit *numdomains;
    QLineEdit *earliestwritten;
    QLineEdit *latestwritten;

    /** Progress bar dialog. */
    QProgressDialog *progress;

    // Internal state
    bool hasnews,   ///< State variable indicating if we have seen news areas.
         hasany;    ///< State variable indicating if we have seen any areas.
    QString defaultserver; ///< Last selected news server.

    // Statistics
    StatEngine *engine; ///< Engine containing all collected data.

    /**
     * Display a message saying that area types are incompatible. Internal.
     */
    void incompatible();

    /**
     * Fill main window with initial values. Internal.
     */
    void zeroFill();

    /**
     * Transfer data from an area object to the engine. Internal.
     */
    void transfer(AreaRead *, bool);

    // Start date
    time_t start;   ///< Earliest time to collect statistics from.
    time_t end;     ///< Last time to collect statistics to.
    int daysback;   ///< Number of days back to collect statistics from.

public slots:
    void open();            ///< Slot handling File|Open message base.
    void opennews();        ///< Slot handling File|Open news group.
    void clear();           ///< Slot handling File|Clear data.
    void report();          ///< Slot handling File|Save report.
    void quotelist();       ///< Slot handling Show|Quoter blacklist.
    void senderlist();      ///< Slot handling Show|Sender toplist.
    void contentlist();     ///< Slot handling Show|Original content toplist.
    void fidonetlist();     ///< Slot handling Show|Fidonet net toplist.
    void domainlist();      ///< Slot handling Show|Internet topdomain toplist.
    void receiverlist();    ///< Slot handling Show|Receiver toplist.
    void subjectlist();     ///< Slot handling Show|Subject toplist.
    void softwarelist();    ///< Slot handling Show|Software toplist.
    void timelist();        ///< Slot handling Show|Postings per hour.
    void daylist();         ///< Slot handling Show|Postings per day.
    void startdate();       ///< Slot handling Edit|Set start date.

    void update();          ///< Slot handling incoming new statistics data.

signals:
    void newdata();         ///< Signal indicating new statistics data.
};

#endif