ipod.h

00001  /*****************************************************************************
00002  *                                                                            *
00003  *   Copyright (C) 2004-2006 by Michael Schulze                               *
00004  *   mike.s@genion.de                                                         *
00005  *                                                                            *
00006  *  The code contained in this file is free software; you can redistribute    *
00007  *  it and/or modify it under the terms of the GNU Lesser General Public      *
00008  *  License as published by the Free Software Foundation; either version      *
00009  *  2.1 of the License, or (at your option) any later version.                *
00010  *                                                                            *
00011  *  This file is distributed in the hope that it will be useful,              *
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00014  *  Lesser General Public License for more details.                           *
00015  *                                                                            *
00016  *  You should have received a copy of the GNU Lesser General Public          *
00017  *  License along with this code; if not, write to the Free Software          *
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
00019  *                                                                            *
00020  *  iTunes and iPod are trademarks of Apple                                   *
00021  *                                                                            *
00022  *  This product is not supported/written/published by Apple!                 *
00023  *****************************************************************************/
00024 
00025 #ifndef IPOD_H
00026 #define IPOD_H
00027 
00028 #include <qfile.h>
00029 #include <qstring.h>
00030 
00031 #include "itunesdb.h"
00032 
00033 #include "ipoddevicedetails.h"
00034 #include "ipodsysinfo.h"
00035 
00036 #define LOGFILEPREFIX "/kio_ipod-"
00037 #define LOG_DEFAULT true
00038 
00044 class IPod {
00045 public:
00046 
00051     IPod( const QString& ipodBase );
00052 
00056     virtual ~IPod();
00057 
00062     bool open();
00063 
00069     void initialize( const QString& title );
00070 
00075     bool isOpen();
00076 
00081     bool isStillConnected();
00082 
00087     void close();
00088 
00092     QString getName() const;
00093 
00097     void setName(const QString& name);
00098 
00102     const QString& getItunesDBError() const;
00103 
00108     const IPodSysInfo& getSysInfo() const;
00109 
00114     IPodSysInfo& getSysInfo();
00115 
00120     const ITunesDB& getITunesDB() const;
00121 
00126     ITunesDB& getITunesDB();
00127 
00132     void synchronize();
00133 
00138     bool isDirty() const { return m_itunesdb.isDirty(); }
00139 
00143     void lock(bool write_lock);
00144     bool isLocked();
00145     void unlock();
00146 
00147     const QString& getBasePath() const { return m_ipodBase; }
00148 
00149     static QString createDistinctIPodName(const IPod& ipod);
00150 
00151     // This method can be removed when we're able to handle podcasts
00152     bool hasPodcasts() { return m_itunesdb.hasPodcasts(); }
00153 
00154 protected:
00155     QString m_ipodBase;
00156 
00157 private:
00158     IPodSysInfo m_sysInfo;
00159     ITunesDB m_itunesdb;
00160     IPodDeviceDetails m_deviceDetails;
00161 
00162 };
00163 
00164 #endif

Generated on Tue Dec 12 16:39:26 2006 for libqtpod.kdevelop by  doxygen 1.5.1