bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / filter / ppt / pptatom.hxx
blob3900b02f0da2f2617c0581e7bec3b443aad41ee3
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_SD_SOURCE_FILTER_PPT_PPTATOM_HXX
21 #define INCLUDED_SD_SOURCE_FILTER_PPT_PPTATOM_HXX
23 #include <svx/msdffdef.hxx>
24 #include <filter/msfilter/msdffimp.hxx>
26 class SvStream;
28 namespace ppt
31 class Atom
33 public:
34 ~Atom();
36 /** imports this atom and its child atoms */
37 static Atom* import( const DffRecordHeader& rRootRecordHeader, SvStream& rStCtrl );
39 inline const DffRecordHeader& getHeader() const;
41 /** @return true if at least one atom with the given nRecType is found */
42 inline bool hasChildAtom( sal_uInt16 nRecType ) const;
44 /** @return the first child atom with nRecType or NULL */
45 inline const Atom* findFirstChildAtom( sal_uInt16 nRecType ) const;
47 /** @return the next child atom after pLast with nRecType or NULL */
48 const Atom* findNextChildAtom( sal_uInt16 nRecType, const Atom* pLast ) const;
50 /** @return the first child atom or NULL */
51 inline const Atom* findFirstChildAtom() const;
53 /** @return the next child atom after pLast or NULL */
54 static inline const Atom* findNextChildAtom( const Atom* pLast );
56 /** @return true if this atom is a container */
57 inline bool isContainer() const;
59 /** seeks to the contents of this atom */
60 inline bool seekToContent() const;
62 /** @return the record type */
63 inline sal_uInt16 getType() const;
65 /** @return the record instance */
66 inline sal_uInt16 getInstance() const;
68 /** @return the record length */
69 inline sal_uInt32 getLength() const;
71 private:
72 Atom( const DffRecordHeader& rRecordHeader, SvStream& rStCtrl );
74 SvStream& mrStream;
75 DffRecordHeader maRecordHeader;
76 Atom* mpFirstChild;
77 Atom* mpNextAtom;
80 inline bool Atom::hasChildAtom( sal_uInt16 nRecType ) const
82 return findFirstChildAtom( nRecType ) != NULL;
85 inline const Atom* Atom::findFirstChildAtom( sal_uInt16 nRecType ) const
87 return findNextChildAtom( nRecType, NULL );
90 inline const DffRecordHeader& Atom::getHeader() const
92 return maRecordHeader;
95 inline const Atom* Atom::findFirstChildAtom() const
97 return mpFirstChild;
100 inline const Atom* Atom::findNextChildAtom( const Atom* pLast )
102 return pLast ? pLast->mpNextAtom : pLast;
105 inline bool Atom::isContainer() const
107 return (bool)maRecordHeader.IsContainer();
110 inline bool Atom::seekToContent() const
112 maRecordHeader.SeekToContent( mrStream );
113 return mrStream.GetError() == 0;
116 inline sal_uInt16 Atom::getType() const
118 return maRecordHeader.nRecType;
121 inline sal_uInt16 Atom::getInstance() const
123 return maRecordHeader.nRecInstance;
126 inline sal_uInt32 Atom::getLength() const
128 return maRecordHeader.nRecLen;
131 } // namespace ppt
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */