ipodsysinfo.h

00001  /*****************************************************************************
00002  *   Copyright (C) 2004 by Andrew de Quincey                                  *
00003  *   adq@lidskialf.net                                                        *
00004  *   Copyright (C) 2005 by Michael Schulze                                    *
00005  *   mike.s@genion.de                                                         *
00006  *                                                                            *
00007  *  The code contained in this file is free software; you can redistribute    *
00008  *  it and/or modify it under the terms of the GNU Lesser General Public      *
00009  *  License as published by the Free Software Foundation; either version      *
00010  *  2.1 of the License, or (at your option) any later version.                *
00011  *                                                                            *
00012  *  This file is distributed in the hope that it will be useful,              *
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00015  *  Lesser General Public License for more details.                           *
00016  *                                                                            *
00017  *  You should have received a copy of the GNU Lesser General Public          *
00018  *  License along with this code; if not, write to the Free Software          *
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
00020  *                                                                            *
00021  *  iTunes and iPod are trademarks of Apple                                   *
00022  *                                                                            *
00023  *  This product is not supported/written/published by Apple!                 *
00024  *****************************************************************************/
00025 
00026 #ifndef IPODSYSINFO_H
00027 #define IPODSYSINFO_H
00028 
00029 #include <qobject.h>
00030 #include <qmap.h>
00031 #include <qstring.h>
00032 #include <qdir.h>
00033 
00034 #define IPOD_CONTROLDIR "/iPod_Control"
00035 #define IPOD_MUSICDIR   "Music"
00036 
00040 class IPodSysInfo {
00041 public:
00042     IPodSysInfo( const QString& filename );
00043     ~IPodSysInfo();
00044 
00048     bool load();
00049 
00050     void refreshDiskUsageStats();
00051 
00057     QValueList<QString> getKeys() const;
00058 
00065     QString getValue(const QString& key) const;
00066 
00071     unsigned long getTotalDiskSpaceKB();
00072 
00077     unsigned long getAvailableDiskSpaceKB();
00078 
00083     unsigned long getUsedDiskSpaceKB();
00084 
00088     int getNumTrackFileDirs() const { return m_numTrackFileDirs; }
00089 
00093     const QDir& getMusicDir() const { return m_musicDir; }
00094 
00095     // const QString& getDeviceName() const { return m_deviceName; }
00096 
00100     const QString& getDeviceMountpoint() const { return m_ipodBase; }
00101 
00105     void clear();
00106 
00111     QString getIPodControlDirName() { return QString( m_ipodBase + IPOD_CONTROLDIR ); }
00112 
00117     bool createMusicDirs();
00118 
00125     QString findNewTrackFileName( Q_UINT32 id );
00126 
00127 private:
00128 
00129     QDir findMusicDir( const QString& ipodbase, bool * found = NULL ) const;
00130 
00131     void ensureDiskUsageStats();
00132     QMap<QString, QString> m_details;
00133     QString m_ipodBase;
00134     // QString m_deviceName;
00135     QDir m_musicDir;
00136     uint m_numTrackFileDirs;
00137 
00138     unsigned long m_kbytesTotal;
00139     unsigned long m_kbytesAvail;
00140 };
00141 
00142 #endif

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