asfattribute.h
Go to the documentation of this file.
1 /**************************************************************************
2  copyright : (C) 2005-2007 by Lukáš Lalinský
3  email : lalinsky@gmail.com
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_ASFATTRIBUTE_H
27 #define TAGLIB_ASFATTRIBUTE_H
28 
29 #include "tstring.h"
30 #include "tbytevector.h"
31 #include "taglib_export.h"
32 #include "asfpicture.h"
33 
34 namespace TagLib
35 {
36 
37  namespace ASF
38  {
39 
40  class File;
41  class Picture;
42 
44  {
45  public:
46 
51  UnicodeType = 0,
52  BytesType = 1,
53  BoolType = 2,
54  DWordType = 3,
55  QWordType = 4,
56  WordType = 5,
57  GuidType = 6
58  };
59 
63  Attribute();
64 
68  Attribute(const String &value);
69 
73  Attribute(const ByteVector &value);
74 
86  Attribute(const Picture &value);
87 
91  Attribute(unsigned int value);
92 
96  Attribute(unsigned long long value);
97 
101  Attribute(unsigned short value);
102 
106  Attribute(bool value);
107 
111  Attribute(const Attribute &item);
112 
116  ASF::Attribute &operator=(const Attribute &other);
117 
121  virtual ~Attribute();
122 
126  AttributeTypes type() const;
127 
131  unsigned short toBool() const;
132 
136  unsigned short toUShort() const;
137 
141  unsigned int toUInt() const;
142 
146  unsigned long long toULongLong() const;
147 
151  String toString() const;
152 
156  ByteVector toByteVector() const;
157 
161  Picture toPicture() const;
162 
166  int language() const;
167 
171  void setLanguage(int value);
172 
176  int stream() const;
177 
181  void setStream(int value);
182 
183 #ifndef DO_NOT_DOCUMENT
184  /* THIS IS PRIVATE, DON'T TOUCH IT! */
185  String parse(ASF::File &file, int kind = 0);
186 #endif
187 
189  int dataSize() const;
190 
191  private:
192  friend class File;
193 
194  ByteVector render(const String &name, int kind = 0) const;
195 
196  class AttributePrivate;
197  AttributePrivate *d;
198  };
199  }
200 
201 }
202 
203 #endif