Initial checkin
[opensuse:qtobs.git] / obsbuildresults.h
1 /*
2  *  Qt OBS - A Qt based OBS client
3  *
4  *  Copyright (C) 2010 Novell Inc, Klaas Freitag <freitag@suse.de>
5  *
6  *  This program is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation, either version 2 of the License, or
9  *  (at your option) version 3.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  *  --
20  *  Written by Klaas Freitag <freitag@suse.de>
21  *  Contributors:
22  */
23
24 #ifndef OBSBUILDRESULTS_H
25 #define OBSBUILDRESULTS_H
26
27 #include <QString>
28 #include <QList>
29
30 class OBSPackageBuildResult
31 {
32 public:
33   OBSPackageBuildResult();
34   OBSPackageBuildResult( const QString&, const QString& );
35
36   QString name() const;
37   QString state() const;
38
39 private:
40   QString mName;
41   QString mState;
42 };
43
44 class OBSProjectBuildResult
45 {
46 public:
47     OBSProjectBuildResult();
48
49     void setProject( const QString& );
50     QString project() const;
51
52     void setRepository( const QString& );
53     QString repository() const;
54
55     void setArchitecture( const QString& );
56     QString architecture() const;
57
58     QList<OBSPackageBuildResult> packageResults();
59     void addPackageBuildResult( const OBSPackageBuildResult& );
60     void setPackageBuildResults( QList<OBSPackageBuildResult> );
61 private:
62     QString mProject;
63     QString mRepo;
64     QString mArch;
65
66     QList<OBSPackageBuildResult> mPackageResults;
67 };
68
69 /**
70   * This is a list of build results of the project.
71   * Note that all entries in the list have the same project.
72   */
73 class OBSProjectBuildResults:public QList<OBSProjectBuildResult>
74 {
75 public:
76     OBSProjectBuildResults();
77
78     QString prjName() const;
79
80     QStringList repositories() const;
81     QStringList packages() const;
82 };
83
84 #endif // OBSBUILDRESULTS_H