Bump version to 4.1-6
[LibreOffice.git] / writerfilter / source / doctok / Dff.hxx
blobef438086ba0bb87100b842528f9425d2de82ccc4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DFF_HXX
21 #define INCLUDED_DFF_HXX
23 #include <vector>
24 #include "WW8StructBase.hxx"
25 #include "WW8ResourceModelImpl.hxx"
27 namespace writerfilter {
28 namespace doctok
30 using std::vector;
32 class DffBlock;
34 class DffRecord : public WW8StructBase, public writerfilter::Reference<Properties>,
35 public Sprm
37 bool bInitialized;
38 public:
39 typedef boost::shared_ptr<DffRecord> Pointer_t;
41 protected:
42 typedef vector<Pointer_t> Records_t;
43 Records_t mRecords;
45 void initChildren();
47 public:
49 DffRecord(WW8Stream & rStream, sal_uInt32 nOffset, sal_uInt32 nCount);
50 DffRecord(WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 nCount);
51 virtual ~DffRecord() {}
53 bool isContainer() const;
54 sal_uInt32 calcSize() const;
56 sal_uInt32 getVersion() const;
57 sal_uInt32 getInstance() const;
58 sal_uInt32 getRecordType() const;
60 virtual DffRecord * clone() const { return new DffRecord(*this); }
62 virtual void resolveLocal(Properties & rHandler);
63 virtual void resolveChildren(Properties & rHandler);
65 Records_t findRecords(sal_uInt32 nType, bool bRecursive = true,
66 bool bAny = false);
68 void findRecords
69 (sal_uInt32 nType, Records_t & rRecords,
70 bool bRecursive = true, bool bAny = false);
72 Records_t::iterator begin();
73 Records_t::iterator end();
75 sal_uInt32 getShapeType();
76 sal_uInt32 getShapeId();
77 sal_uInt32 getShapeBid();
79 /* Properties methods */
80 virtual void resolve(Properties & rHandler);
81 virtual string getType() const;
83 /* Sprm methods */
84 virtual sal_uInt32 getId() const { return getRecordType(); }
85 virtual Value::Pointer_t getValue();
86 virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary();
87 virtual writerfilter::Reference<Stream>::Pointer_t getStream();
88 virtual writerfilter::Reference<Properties>::Pointer_t getProps();
90 virtual string toString() const;
91 virtual string getName() const;
93 virtual Kind getKind();
95 friend class DffBlock;
98 typedef vector<DffRecord::Pointer_t> Records_t;
100 class DffBlock : public WW8StructBase,
101 public writerfilter::Reference<Properties>
103 bool bInitialized;
104 sal_uInt32 mnPadding;
106 Records_t mRecords;
108 protected:
109 void initChildren();
111 public:
112 typedef boost::shared_ptr<DffBlock> Pointer_t;
114 DffBlock(WW8Stream & rStream, sal_uInt32 nOffset, sal_uInt32 nCount, sal_uInt32 nPadding);
115 DffBlock(WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 nCount, sal_uInt32 nPadding);
116 DffBlock(const DffBlock & rSrc);
117 virtual ~DffBlock() {}
119 Records_t findRecords(sal_uInt32 nType, bool bRecursive = true,
120 bool bAny = false);
122 void findRecords(sal_uInt32 nType, Records_t & rRecords,
123 bool bRecursive = true, bool bAny = false);
125 DffRecord::Pointer_t getShape(sal_uInt32 nSpid);
126 DffRecord::Pointer_t getBlip(sal_uInt32 nBlip);
128 Records_t::iterator begin();
129 Records_t::iterator end();
131 /* Properties methods */
132 virtual void resolve(Properties & rHandler);
133 virtual string getType() const;
136 DffRecord *
137 createDffRecord(WW8StructBase * pParent, sal_uInt32 nOffset,
138 sal_uInt32 * nSize = NULL);
139 DffRecord *
140 createDffRecord(WW8Stream & rStream, sal_uInt32 nOffset,
141 sal_uInt32 * nSize = NULL);
145 #endif
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */