Bump version to 4.1-6
[LibreOffice.git] / writerfilter / source / doctok / WW8PropertySetImpl.hxx
blob78340a8a479fb9ccff24bafa1fd45f52bd6c5116
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_WW8_PROPERTY_SET_IMPL_HXX
21 #define INCLUDED_WW8_PROPERTY_SET_IMPL_HXX
23 #include <resourcemodel/WW8ResourceModel.hxx>
24 #include <doctok/WW8Document.hxx>
25 #include "WW8StructBase.hxx"
26 #include "WW8OutputWithDepth.hxx"
28 #include <map>
30 namespace writerfilter {
31 namespace doctok
34 class WW8PropertyImpl : public WW8Property, public WW8StructBase
36 sal_uInt8 get_ispmd() const
37 { return sal::static_int_cast<sal_uInt8>(getId() & 0xff); }
38 bool get_fSpec() const { return (getId() & 0x100) != 0; }
39 sal_uInt8 get_sgc() const
40 { return sal::static_int_cast<sal_uInt8>((getId() >> 10) & 0x7); }
41 sal_uInt8 get_spra() const
42 { return sal::static_int_cast<sal_uInt8>((getId() >> 13) & 0x7); }
44 public:
45 WW8PropertyImpl(WW8Stream & rStream, sal_uInt32 nOffset, sal_uInt32 nCount);
46 WW8PropertyImpl(const WW8StructBase & rBase, sal_uInt32 nOffset,
47 sal_uInt32 nCount);
49 WW8PropertyImpl(WW8StructBase * pBase, sal_uInt32 nOffset,
50 sal_uInt32 nCount);
52 virtual ~WW8PropertyImpl();
54 sal_uInt32 getId() const { return getU16(0); }
55 sal_uInt32 getParam() const;
56 WW8Stream::Sequence getParams() const;
58 sal_uInt32 getByteLength() const;
59 sal_uInt32 getParamOffset() const;
61 virtual void dump(OutputWithDepth<string> & o) const;
62 string toString() const;
65 class WW8PropertySetImpl : public WW8PropertySet, public WW8StructBase,
66 public ::writerfilter::Reference<Properties>
68 bool mbPap;
70 public:
71 typedef boost::shared_ptr<WW8PropertySet> Pointer_t;
73 WW8PropertySetImpl(WW8Stream & rStream, sal_uInt32 nOffset,
74 sal_uInt32 nCount, bool bPap = false);
76 WW8PropertySetImpl(const WW8StructBase & rBase, sal_uInt32 nOffset,
77 sal_uInt32 nCount, bool bPap = false);
79 virtual ~WW8PropertySetImpl();
81 virtual WW8PropertySetIterator::Pointer_t begin();
82 virtual WW8PropertySetIterator::Pointer_t end();
84 virtual void dump(OutputWithDepth<string> & o) const;
85 virtual void dots(ostream & o);
87 virtual string getType() const;
89 virtual WW8Property::Pointer_t getAttribute(sal_uInt32 nOffset) const;
91 virtual bool isPap() const;
92 virtual sal_uInt32 get_istd() const;
94 virtual void insert(const WW8PropertySet::Pointer_t /*pSet*/) {}
96 virtual void resolve(Properties & rHandler);
98 /**
99 Get and distribute information from sprm that is used
100 internally by the document.
102 @param rSprm sprm to process
103 @param rHandler property handler to resolve huge papx (sprm 0x6646) to
105 virtual void resolveLocal(Sprm & rSprm, Properties & rHandler);
108 class WW8PropertySetIteratorImpl : public WW8PropertySetIterator
110 WW8PropertySetImpl * mpAttrSet;
111 sal_uInt32 mnOffset;
113 public:
114 WW8PropertySetIteratorImpl(WW8PropertySetImpl * pAttrSet,
115 sal_uInt32 nOffset)
116 : mpAttrSet(pAttrSet), mnOffset(nOffset)
120 virtual ~WW8PropertySetIteratorImpl();
122 virtual WW8PropertySetIterator & operator++();
124 virtual WW8Property::Pointer_t get() const;
126 virtual bool equal(const WW8PropertySetIterator & rIt) const;
128 virtual string toString() const;
131 ::writerfilter::Reference<Properties>::Pointer_t createSprmProps
132 (WW8PropertyImpl & rProp);
133 ::writerfilter::Reference<BinaryObj>::Pointer_t createSprmBinary
134 (WW8PropertyImpl & rProp);
137 #endif // INCLUDED_WW8_PROPERTY_SET_IMPL_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */