00001 // -*- C++ -*- 00002 // $Id: frame.h,v 1.39 2001/07/30 18:22:53 abscess Exp $ 00003 00004 // id3lib: a C++ library for creating and manipulating id3v1/v2 tags 00005 // Copyright 1999, 2000 Scott Thomas Haug 00006 00007 // This library is free software; you can redistribute it and/or modify it 00008 // under the terms of the GNU Library General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or (at your 00010 // option) any later version. 00011 // 00012 // This library is distributed in the hope that it will be useful, but WITHOUT 00013 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00015 // License for more details. 00016 // 00017 // You should have received a copy of the GNU Library General Public License 00018 // along with this library; if not, write to the Free Software Foundation, 00019 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 00021 // The id3lib authors encourage improvements and optimisations to be sent to 00022 // the id3lib coordinator. Please see the README file for details on where to 00023 // send such submissions. See the AUTHORS file for a list of people who have 00024 // contributed to id3lib. See the ChangeLog file for a list of changes to 00025 // id3lib. These files are distributed with id3lib at 00026 // http://download.sourceforge.net/id3lib/ 00027 00028 #ifndef _ID3LIB_FRAME_H_ 00029 #define _ID3LIB_FRAME_H_ 00030 00031 #include <id3/globals.h> 00032 00033 class ID3_Field; 00034 class ID3_FrameImpl; 00035 class ID3_Reader; 00036 class ID3_Writer; 00037 00038 class ID3_CPP_EXPORT ID3_Frame 00039 { 00040 ID3_FrameImpl* _impl; 00041 public: 00042 00043 class Iterator 00044 { 00045 public: 00046 virtual ID3_Field* GetNext() = 0; 00047 }; 00048 00049 class ConstIterator 00050 { 00051 public: 00052 virtual const ID3_Field* GetNext() = 0; 00053 }; 00054 00055 public: 00056 ID3_Frame(ID3_FrameID id = ID3FID_NOFRAME); 00057 ID3_Frame(const ID3_Frame&); 00058 00059 virtual ~ID3_Frame(); 00060 00061 void Clear(); 00062 00063 bool SetID(ID3_FrameID id); 00064 ID3_FrameID GetID() const; 00065 00066 ID3_Field* GetField(ID3_FieldID name) const; 00067 00068 size_t NumFields() const; 00069 00070 const char* GetDescription() const; 00071 static const char* GetDescription(ID3_FrameID); 00072 00073 const char* GetTextID() const; 00074 00075 ID3_Frame& operator=(const ID3_Frame &); 00076 bool HasChanged() const; 00077 bool Parse(ID3_Reader&); 00078 void Render(ID3_Writer&) const; 00079 size_t Size(); 00080 bool Contains(ID3_FieldID fld) const; 00081 bool SetSpec(ID3_V2Spec); 00082 ID3_V2Spec GetSpec() const; 00083 00084 bool SetCompression(bool b); 00085 bool GetCompression() const; 00086 size_t GetDataSize() const; 00087 00088 bool SetEncryptionID(uchar id); 00089 uchar GetEncryptionID() const; 00090 00091 bool SetGroupingID(uchar id); 00092 uchar GetGroupingID() const; 00093 00094 Iterator* CreateIterator(); 00095 ConstIterator* CreateIterator() const; 00096 00097 // Deprecated 00098 ID3_Field& Field(ID3_FieldID name) const; 00099 //ID3_Field* GetFieldNum(index_t) const; 00100 }; 00101 00102 #endif /* _ID3LIB_FRAME_H_ */