1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
24 #include "WW8StructBase.hxx"
25 #include "WW8ResourceModelImpl.hxx"
27 namespace writerfilter
{
34 class DffRecord
: public WW8StructBase
, public writerfilter::Reference
<Properties
>,
39 typedef boost::shared_ptr
<DffRecord
> Pointer_t
;
42 typedef vector
<Pointer_t
> Records_t
;
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,
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;
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
>
104 sal_uInt32 mnPadding
;
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,
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;
137 createDffRecord(WW8StructBase
* pParent
, sal_uInt32 nOffset
,
138 sal_uInt32
* nSize
= NULL
);
140 createDffRecord(WW8Stream
& rStream
, sal_uInt32 nOffset
,
141 sal_uInt32
* nSize
= NULL
);
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */