TagLib API Documentation
matroskaelement.h
Go to the documentation of this file.
1/***************************************************************************
2 * This library is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU Lesser General Public License version *
4 * 2.1 as published by the Free Software Foundation. *
5 * *
6 * This library is distributed in the hope that it will be useful, but *
7 * WITHOUT ANY WARRANTY; without even the implied warranty of *
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
9 * Lesser General Public License for more details. *
10 * *
11 * You should have received a copy of the GNU Lesser General Public *
12 * License along with this library; if not, write to the Free Software *
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
14 * 02110-1301 USA *
15 * *
16 * Alternatively, this file is available under the Mozilla Public *
17 * License Version 1.1. You may obtain a copy of the License at *
18 * http://www.mozilla.org/MPL/ *
19 ***************************************************************************/
20
21#ifndef TAGLIB_MATROSKAELEMENT_H
22#define TAGLIB_MATROSKAELEMENT_H
23#ifndef DO_NOT_DOCUMENT
24
25#include <memory>
26#include "taglib_export.h"
27#include "taglib.h"
28#include "tlist.h"
29#include "matroskawritestyle.h"
30
31namespace TagLib {
32 class File;
33 class ByteVector;
34
35 namespace Matroska {
36 class TAGLIB_EXPORT Element
37 {
38 public:
39 using ID = unsigned int;
40 explicit Element(ID id);
41 virtual ~Element();
42
43 offset_t size() const;
44 offset_t offset() const;
45 ID id() const;
46 void setOffset(offset_t offset);
47 void adjustOffset(offset_t delta);
48 void setSize(offset_t size);
49 void setID(ID id);
50 virtual bool render();
51 void setNeedsRender(bool needsRender);
52 bool needsRender() const;
53 void setData(const ByteVector &data);
54 const ByteVector &data() const;
55 virtual void write(TagLib::File &file);
56 void addSizeListener(Element *element);
57 void addSizeListeners(const List<Element *> &elements);
58 bool emitSizeChanged(offset_t delta);
59 virtual bool sizeChanged(Element &caller, offset_t delta);
60
61 void setWriteStyle(WriteStyle style);
62 WriteStyle writeStyle() const;
63 void setIsLastElement(bool isLast);
64 void setAppendOffset(offset_t appendOffset);
65 bool wasMoved() const;
69 void setIsTrailingInSegment(bool isTrailing);
70 bool isTrailingInSegment() const;
71
72 protected:
73 offset_t sizeRenderedOrWritten() const;
74
75 private:
76 virtual ByteVector renderInternal() = 0;
77
78 class ElementPrivate;
80 std::unique_ptr<ElementPrivate> e;
81 };
82 }
83}
84
85#endif
86#endif
A file class with some useful methods for tag manipulation.
Definition tfile.h:51
WriteStyle
Definition matroskawritestyle.h:36
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
off_t offset_t
Definition taglib.h:64
#define TAGLIB_EXPORT
Definition taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55