~ubuntu-branches/ubuntu/maverick/datakiosk/maverick

« back to all changes in this revision

Viewing changes to src/src/datareport.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-06-27 22:48:06 UTC
  • Revision ID: james.westby@ubuntu.com-20050627224806-8farkci1dc2onhbs
Tags: upstream-0.7
ImportĀ upstreamĀ versionĀ 0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2005 by Adam Treat                                      *
 
3
 *   treat@kde.org                                                         *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 ***************************************************************************/
 
11
 
 
12
#ifndef DATAREPORT_H
 
13
#define DATAREPORT_H
 
14
 
 
15
#include <qhbox.h>
 
16
 
 
17
#include <kapplication.h>
 
18
#include <kparts/mainwindow.h>
 
19
#include <kparts/browserextension.h>
 
20
 
 
21
class Project;
 
22
class DataTable;
 
23
 
 
24
class DataReport : public QHBox
 
25
{
 
26
    Q_OBJECT
 
27
public:
 
28
    DataReport( Project *project );
 
29
    DataReport( Project *project, DataTable* parent );
 
30
 
 
31
    virtual ~DataReport();
 
32
 
 
33
    void setAsActiveReport( bool active );
 
34
    void initialize();
 
35
    bool isInitialized();
 
36
 
 
37
    DataTable *parent() const;
 
38
    KParts::ReadOnlyPart *kugarPart() const;
 
39
 
 
40
    int numRows() const;
 
41
 
 
42
    virtual QString name() const;
 
43
    void setName( const QString &n );
 
44
 
 
45
    QString iconName() const;
 
46
    void setIconName( const QString &n );
 
47
 
 
48
    QString templateURL() const;
 
49
    void setTemplateURL( const QString &url );
 
50
 
 
51
    QString dataSearch() const;
 
52
    void setDataSearch( const QString &dataSearch );
 
53
 
 
54
    void addTable( const QString &table );
 
55
    void clearTables();
 
56
    QStringList tables() const;
 
57
 
 
58
    QStringList sort() const;
 
59
    void setSort( const QStringList &sort );
 
60
 
 
61
    bool needsRefresh();
 
62
 
 
63
public slots:
 
64
    void refreshReport();
 
65
    void queueRefresh();
 
66
 
 
67
signals:
 
68
    void signalNameChanged( const QString &name );
 
69
    void reportRefreshed();
 
70
 
 
71
private:
 
72
    void setup();
 
73
    QMap<QString, int> readTemplateFields() const;
 
74
 
 
75
private:
 
76
    DataTable *m_parent;
 
77
    Project *m_project;
 
78
    KParts::ReadOnlyPart *m_part;
 
79
    KParts::BrowserExtension *m_browser;
 
80
 
 
81
    int m_numRows;
 
82
    QString m_dataReportName;
 
83
    QString m_dataReportIconName;
 
84
    QString m_templateURL;
 
85
    QString m_dataSearch;
 
86
    QStringList m_tables;
 
87
    QStringList m_sort;
 
88
    bool m_needsRefresh;
 
89
    bool m_isInitialized;
 
90
};
 
91
 
 
92
#endif