1 /************************************************************************** 2 copyright : (C) 2007 by Lukáš Lalinský 3 email : [email protected] 4 **************************************************************************/ 5 6 /*************************************************************************** 7 * This library is free software; you can redistribute it and/or modify * 8 * it under the terms of the GNU Lesser General Public License version * 9 * 2.1 as published by the Free Software Foundation. * 10 * * 11 * This library is distributed in the hope that it will be useful, but * 12 * WITHOUT ANY WARRANTY; without even the implied warranty of * 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 14 * Lesser General Public License for more details. * 15 * * 16 * You should have received a copy of the GNU Lesser General Public * 17 * License along with this library; if not, write to the Free Software * 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 19 * 02110-1301 USA * 20 * * 21 * Alternatively, this file is available under the Mozilla Public * 22 * License Version 1.1. You may obtain a copy of the License at * 23 * http://www.mozilla.org/MPL/ * 24 ***************************************************************************/ 25 26 #ifndef TAGLIB_MP4ITEM_H 27 #define TAGLIB_MP4ITEM_H 28 29 #include "tstringlist.h" 30 #include "mp4coverart.h" 31 #include "taglib_export.h" 32 33 namespace TagLib { 34 35 namespace MP4 { 36 37 class TAGLIB_EXPORT Item 38 { 39 public: 40 struct IntPair { 41 int first, second; 42 }; 43 44 Item(); 45 Item(const Item &item); 46 47 /*! 48 * Copies the contents of \a item into this Item. 49 */ 50 Item &operator=(const Item &item); 51 52 /*! 53 * Exchanges the content of the Item by the content of \a item. 54 */ 55 void swap(Item &item); 56 57 ~Item(); 58 59 Item(int value); 60 Item(unsigned char value); 61 Item(unsigned int value); 62 Item(long long value); 63 Item(bool value); 64 Item(int first, int second); 65 Item(const StringList &value); 66 Item(const ByteVectorList &value); 67 Item(const CoverArtList &value); 68 69 void setAtomDataType(AtomDataType type); 70 AtomDataType atomDataType() const; 71 72 int toInt() const; 73 unsigned char toByte() const; 74 unsigned int toUInt() const; 75 long long toLongLong() const; 76 bool toBool() const; 77 IntPair toIntPair() const; 78 StringList toStringList() const; 79 ByteVectorList toByteVectorList() const; 80 CoverArtList toCoverArtList() const; 81 82 bool isValid() const; 83 84 private: 85 class ItemPrivate; 86 ItemPrivate *d; 87 }; 88 89 } 90 91 } 92 93 #endif 94