![]() |
|
00001 /*************************************************************************** 00002 copyright : (C) 2013 by Lukas Krejci 00003 email : krejclu6@fel.cvut.cz 00004 ***************************************************************************/ 00005 00006 /*************************************************************************** 00007 * This library is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU Lesser General Public License version * 00009 * 2.1 as published by the Free Software Foundation. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, but * 00012 * 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 library; if not, write to the Free Software * 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 00019 * 02110-1301 USA * 00020 * * 00021 * Alternatively, this file is available under the Mozilla Public * 00022 * License Version 1.1. You may obtain a copy of the License at * 00023 * http://www.mozilla.org/MPL/ * 00024 ***************************************************************************/ 00025 00026 #ifndef TAGLIB_TABLEOFCONTENTSFRAME 00027 #define TAGLIB_TABLEOFCONTENTSFRAME 00028 00029 #include "id3v2tag.h" 00030 #include "id3v2frame.h" 00031 00032 namespace TagLib { 00033 00034 namespace ID3v2 { 00035 00041 00042 00043 class TAGLIB_EXPORT TableOfContentsFrame : public ID3v2::Frame 00044 { 00045 friend class FrameFactory; 00046 00047 public: 00052 TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data); 00053 00059 TableOfContentsFrame(const ByteVector &elementID, 00060 const ByteVectorList &children = ByteVectorList(), 00061 const FrameList &embeddedFrames = FrameList()); 00062 00066 ~TableOfContentsFrame(); 00067 00074 ByteVector elementID() const; 00075 00082 bool isTopLevel() const; 00083 00090 bool isOrdered() const; 00091 00098 uint entryCount() const; 00099 00105 ByteVectorList childElements() const; 00106 00113 void setElementID(const ByteVector &eID); 00114 00121 void setIsTopLevel(const bool &t); 00122 00129 void setIsOrdered(const bool &o); 00130 00136 void setChildElements(const ByteVectorList &l); 00137 00143 void addChildElement(const ByteVector &cE); 00144 00150 void removeChildElement(const ByteVector &cE); 00151 00166 const FrameListMap &embeddedFrameListMap() const; 00167 00179 const FrameList &embeddedFrameList() const; 00180 00192 const FrameList &embeddedFrameList(const ByteVector &frameID) const; 00193 00201 void addEmbeddedFrame(Frame *frame); 00202 00210 void removeEmbeddedFrame(Frame *frame, bool del = true); 00211 00219 void removeEmbeddedFrames(const ByteVector &id); 00220 00221 virtual String toString() const; 00222 00223 PropertyMap asProperties() const; 00224 00232 static TableOfContentsFrame *findByElementID(const Tag *tag, const ByteVector &eID); 00233 00241 static TableOfContentsFrame *findTopLevel(const Tag *tag); 00242 00243 protected: 00244 virtual void parseFields(const ByteVector &data); 00245 virtual ByteVector renderFields() const; 00246 00247 private: 00248 TableOfContentsFrame(const ID3v2::Header *tagHeader, const ByteVector &data, Header *h); 00249 TableOfContentsFrame(const TableOfContentsFrame &); 00250 TableOfContentsFrame &operator=(const TableOfContentsFrame &); 00251 00252 class TableOfContentsFramePrivate; 00253 TableOfContentsFramePrivate *d; 00254 }; 00255 } 00256 } 00257 00258 #endif