oopapidocs  2.0
metadatavalue.h
00001 #ifndef METADATAVALUE_H
00002 #define METADATAVALUE_H
00003 
00004 
00005 #include <QTime>
00006 #include <QUrl>
00007 #include <QString>
00008 #include <QImage>
00009 #include "preference.h"
00010 #include "metadataexport.h"
00011 //start
00017 class METADATAEXPORT MetaDataValue {
00018 public:
00019 
00020     friend METADATAEXPORT QTextStream& operator<< (QTextStream& os, 
00021                                          const MetaDataValue& mdv);
00022     friend METADATAEXPORT QTextStream& operator>> (QTextStream& is,
00023                                          MetaDataValue& mdv);
00024     friend METADATAEXPORT QDataStream& operator<< (QDataStream& os,
00025                                          const MetaDataValue& mdv);
00026     friend METADATAEXPORT QDataStream& operator>> (QDataStream& is,
00027                                          MetaDataValue& mdv);
00028     friend METADATAEXPORT bool operator==(const MetaDataValue&,
00029                                           const MetaDataValue&);
00030 //end
00031     MetaDataValue(): m_isNull(true) {}
00032     MetaDataValue(const MetaDataValue& other);
00033     virtual ~MetaDataValue() {}
00034 
00035     virtual MetaDataValue& operator=(const MetaDataValue& other) ;
00036 
00037     virtual QUrl url() const;
00038 //start    
00039     virtual QString fileName() const ;
00040     virtual Preference preference() const ;
00041     virtual QString genre() const;
00042     virtual QString artist() const;
00043     virtual QString albumTitle() const;
00044     virtual QString trackTitle() const;
00045     virtual QString trackNumber() const;
00046     virtual const QImage &image() const;
00047 
00051     virtual QTime trackTime() const;
00052     virtual QString trackTimeString() const;
00053     virtual QString comment() const;
00054 //end    
00055     virtual bool isNull() const;
00056     virtual void setNull(bool n);
00057 
00058     // Setters
00061     virtual void setFileName(QString fileName);
00062     virtual void setUrl(QUrl url);
00063     virtual void setPreference(const Preference & newPref);
00064     virtual void setGenre(const QString & newGenre);
00065     virtual void setArtist(const QString & newArtist);
00066     virtual void setTrackNumber(const QString& newTrackNumber);
00067     virtual void setTrackTitle(const QString &newTitle);
00068     virtual void setImage(const QImage& img) {
00069         m_Image = img;
00070     }
00071     virtual void setTrackTime(const QTime &time) {
00072         m_TrackTime = time;
00073     }
00074     virtual void setAlbumTitle(const QString &newAlbumTitle);
00075     virtual void setComment(const QString &newComment);
00076 //start
00077 protected:
00078     bool m_isNull;
00079     QUrl m_Url;
00080     QString m_TrackNumber;
00081     QString m_TrackTitle;
00082     QString m_Comment;
00083     Preference m_Preference;
00084     QString m_Genre;
00085     QString m_Artist;
00086     QTime m_TrackTime;
00087     QString m_AlbumTitle;
00088     QImage m_Image;
00089 };
00090 Q_DECLARE_METATYPE(MetaDataValue);  /* Add to QVariant type system. */
00091 //end
00092 
00093 METADATAEXPORT bool operator==(const MetaDataValue&, 
00094                                const MetaDataValue&);
00095 METADATAEXPORT QTextStream& operator<< (QTextStream& os, 
00096                                         const MetaDataValue& mdv);
00097 METADATAEXPORT QTextStream& operator>> (QTextStream& is, 
00098                                         MetaDataValue& mdv);
00099 METADATAEXPORT QDataStream& operator<< (QDataStream& os,
00100                                         const MetaDataValue& mdv);
00101 METADATAEXPORT QDataStream& operator>> (QDataStream& is, 
00102                                         MetaDataValue& mdv);
00103 
00104 
00105 #endif        //  #ifndef METADATAVALUE_H
 All Classes Namespaces Functions Enumerations