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

oipkg.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 OIPKG_H
00032 #define OIPKG_H
00033 
00034 #include "oconfitem.h"
00035 #include "opackage.h"
00036 
00037 #include <qpe/config.h>
00038 
00039 #include <qobject.h>
00040 
00041 // Ipkg execution options (m_ipkgExecOptions)
00042 #define FORCE_DEPENDS                           0x0001
00043 #define FORCE_REMOVE                            0x0002
00044 #define FORCE_REINSTALL                         0x0004
00045 #define FORCE_OVERWRITE                         0x0008
00046 
00047 class OConfItemList;
00048 
00049 class OIpkg : public QObject
00050 {
00051     Q_OBJECT
00052 
00053 public:
00054     OIpkg( Config *config = 0l, QObject *parent = 0l, const char *name = 0l );
00055     ~OIpkg();
00056 
00057     OConfItemList *configItems();
00058     OConfItemList *servers();
00059     OConfItemList *destinations();
00060     OConfItemList *options();
00061 
00062     int  ipkgExecOptions() { return m_ipkgExecOptions; }
00063     int  ipkgExecVerbosity() { return m_ipkgExecVerbosity; }
00064 
00065     void setConfigItems( OConfItemList *configList );
00066     void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; }
00067     void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; }
00068 
00069     void saveSettings();
00070 
00071     OPackageList *availablePackages( const QString &server = QString::null );
00072     OPackageList *installedPackages( const QString &destName = QString::null,
00073                                      const QString &destPath = QString::null );
00074 
00075     OConfItem    *findConfItem( OConfItem::Type type = OConfItem::NotDefined,
00076                                 const QString &name = QString::null );
00077 
00078     bool executeCommand( OPackage::Command command = OPackage::NotDefined,
00079                          const QStringList &parameters = QStringList(),
00080                          const QString &destination = QString::null,
00081                          const QObject *receiver = 0l,
00082                          const char *slotOutput = 0l,
00083                          bool rawOutput = true );
00084     void abortCommand();
00085 
00086     void ipkgMessage( char *msg );
00087     void ipkgStatus( char *status );
00088     void ipkgList( char *filelist );
00089 
00090 private:
00091     Config        *m_config;            // Pointer to application configuration file
00092     OConfItemList *m_confInfo;          // Contains info from all Ipkg configuration files
00093     int            m_ipkgExecOptions;   // Bit-mapped flags for Ipkg execution options
00094     int            m_ipkgExecVerbosity; // Ipkg execution verbosity level
00095     QString        m_rootPath;          // Directory path where the 'root' destination is located
00096 
00097     void           loadConfiguration();
00098     OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined );
00099     const QString &rootPath();
00100     void           linkPackageDir( const QString &dest = QString::null );
00101     void           unlinkPackage( const QString &package = QString::null,
00102                                   OConfItemList *destList = 0l );
00103 
00104 signals:
00105     void signalIpkgMessage( const QString &msg );
00106     void signalIpkgStatus( const QString &status );
00107     void signalIpkgList( const QString &filelist );
00108 };
00109 
00110 #endif

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