summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/opackage.h
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/opackage.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/opackage.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/opackage.h b/noncore/settings/packagemanager/opackage.h
new file mode 100644
index 0000000..1e2e49f
--- a/dev/null
+++ b/noncore/settings/packagemanager/opackage.h
@@ -0,0 +1,74 @@
1/*
2                This file is part of the Opie Project
3
4              Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5 =.
6 .=l.
7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#ifndef OPACKAGE_H
33#define OPACKAGE_H
34
35#include <qlist.h>
36#include <qstring.h>
37
38class OPackage
39{
40public:
41 enum Command { Install, Remove, Update, Upgrade, Download, Info, Files, Version, NotDefined };
42
43 OPackage( const QString &name = 0x0,
44 const QString &version = 0x0, const QString &versionInstalled = 0x0,
45 const QString &source = 0x0, const QString &destination = 0x0,
46 const QString &category = "misc" );
47
48 const QString &name() { return m_name; }
49 const QString &version() { return m_version; }
50 const QString &versionInstalled() { return m_versionInstalled; }
51 const QString &source() { return m_source; }
52 const QString &destination() { return m_destination; }
53 const QString &category() { return m_category; }
54
55 void setName( const QString &name ) { m_name = name; }
56 void setVersion( const QString &version ) { m_version = version; }
57 void setVersionInstalled( const QString &version ) { m_versionInstalled = version; }
58 void setSource( const QString &source ) { m_source = source; }
59 void setDestination( const QString &destination ) { m_destination = destination; }
60 void setCategory( const QString &category ) { m_category = category; }
61
62private:
63 QString m_name; // Name of item
64 QString m_version; // Available version number of item
65 QString m_versionInstalled; // Installed version number of item, null if not installed
66 QString m_source; // Source feed of available version
67 QString m_destination; // Location item is installed to, null if not installed
68 QString m_category; // Item category
69};
70
71typedef QList<OPackage> OPackageList;
72typedef QListIterator<OPackage> OPackageListIterator;
73
74#endif