Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

opackage.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003 
00004                              Copyright (C)2004, 2005 Dan Williams <drw@handhelds.org>
00005               =.
00006             .=l.
00007            .>+-=
00008  _;:,     .>    :=|.         This program is free software; you can
00009 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00010 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00011 .="- .-=="i,     .._         License as published by the Free Software
00012  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00013      ._= =}       :          or (at your option) any later version.
00014     .%`+i>       _;_.
00015     .i_,=:_.      -<s.       This program is distributed in the hope that
00016      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00017     : ..    .:,     . . .    without even the implied warranty of
00018     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00019   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00020 ..}^=.=       =       ;      Library General Public License for more
00021 ++=   -.     .`     .:       details.
00022 :     =  ...= . :.=-
00023  -.   .:....=;==+<;          You should have received a copy of the GNU
00024   -_. . .   )=.  =           Library General Public License along with
00025     --        :-=`           this library; see the file COPYING.LIB.
00026                              If not, write to the Free Software Foundation,
00027                              Inc., 59 Temple Place - Suite 330,
00028                              Boston, MA 02111-1307, USA.
00029 */
00030 
00031 #ifndef OPACKAGE_H
00032 #define OPACKAGE_H
00033 
00034 #include <qlist.h>
00035 #include <qstring.h>
00036 
00037 class OPackage
00038 {
00039 public:
00040     enum Command { Install, Remove, Update, Upgrade, Download, Info, Files, Version, NotDefined };
00041 
00042     OPackage( const QString &name= QString::null,
00043               const QString &version= QString::null, const QString &versionInstalled= QString::null,
00044               const QString &source= QString::null, const QString &destination= QString::null,
00045               const QString &category = "misc", const QString &information = QString::null,
00046               const QString &files = QString::null );
00047 
00048     const QString &name()             { return m_name; }
00049     const QString &version()          { return m_version; }
00050     const QString &versionInstalled() { return m_versionInstalled; }
00051     const QString &source()           { return m_source; }
00052     const QString &destination()      { return m_destination; }
00053     const QString &category()         { return m_category; }
00054     const QString &information()      { return m_information; }
00055     const QString &files()            { return m_files; }
00056 
00057     void setName( const QString &name )                { m_name = name; }
00058     void setVersion( const QString &version )          { m_version = version; }
00059     void setVersionInstalled( const QString &version ) { m_versionInstalled = version; }
00060     void setSource( const QString &source )            { m_source = source; }
00061     void setDestination( const QString &destination )  { m_destination = destination; }
00062     void setCategory( const QString &category )        { m_category = category; }
00063     void setInformation( const QString &information )  { m_information = information; }
00064     void setFiles( const QString &files )              { m_files = files; }
00065 
00066 private:
00067     QString m_name;             // Name of item
00068     QString m_version;          // Available version number of item
00069     QString m_versionInstalled; // Installed version number of item, null if not installed
00070     QString m_source;           // Source feed of available version
00071     QString m_destination;      // Location item is installed to, null if not installed
00072     QString m_category;         // Item category
00073     QString m_information;      // Package information
00074     QString m_files;            // File list information
00075 };
00076 
00077 typedef QList<OPackage>         OPackageList;
00078 typedef QListIterator<OPackage> OPackageListIterator;
00079 
00080 #endif

Generated on Sat Nov 5 16:17:57 2005 for OPIE by  doxygen 1.4.2