bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / filter / ppt / pptatom.hxx
blob950623bda5e33b8958a7d2a9abef4e5aa65c5545
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 <filter/msfilter/dffrecordheader.hxx>
25 namespace ppt
28 class Atom
30 public:
31 ~Atom();
33 /** imports this atom and its child atoms */
34 static Atom* import( const DffRecordHeader& rRootRecordHeader, SvStream& rStCtrl );
36 /** @return true if at least one atom with the given nRecType is found */
37 inline bool hasChildAtom( sal_uInt16 nRecType ) const;
39 /** @return the first child atom with nRecType or NULL */
40 inline const Atom* findFirstChildAtom( sal_uInt16 nRecType ) const;
42 /** @return the next child atom after pLast with nRecType or NULL */
43 const Atom* findNextChildAtom( sal_uInt16 nRecType, const Atom* pLast ) const;
45 /** @return the first child atom or NULL */
46 inline const Atom* findFirstChildAtom() const;
48 /** @return the next child atom after pLast or NULL */
49 static inline const Atom* findNextChildAtom( const Atom* pLast );
51 /** @return true if this atom is a container */
52 inline bool isContainer() const;
54 /** seeks to the contents of this atom */
55 inline bool seekToContent() const;
57 /** @return the record type */
58 inline sal_uInt16 getType() const;
60 /** @return the record instance */
61 inline sal_uInt16 getInstance() const;
63 /** @return the record length */
64 inline sal_uInt32 getLength() const;
66 private:
67 Atom( const DffRecordHeader& rRecordHeader, SvStream& rStCtrl );
69 SvStream& mrStream;
70 DffRecordHeader const maRecordHeader;
71 Atom* mpFirstChild;
72 Atom* mpNextAtom;
75 inline bool Atom::hasChildAtom( sal_uInt16 nRecType ) const
77 return findFirstChildAtom( nRecType ) != nullptr;
80 inline const Atom* Atom::findFirstChildAtom( sal_uInt16 nRecType ) const
82 return findNextChildAtom( nRecType, nullptr );
85 inline const Atom* Atom::findFirstChildAtom() const
87 return mpFirstChild;
90 inline const Atom* Atom::findNextChildAtom( const Atom* pLast )
92 return pLast ? pLast->mpNextAtom : pLast;
95 inline bool Atom::isContainer() const
97 return maRecordHeader.IsContainer();
100 inline bool Atom::seekToContent() const
102 maRecordHeader.SeekToContent( mrStream );
103 return mrStream.GetError() == ERRCODE_NONE;
106 inline sal_uInt16 Atom::getType() const
108 return maRecordHeader.nRecType;
111 inline sal_uInt16 Atom::getInstance() const
113 return maRecordHeader.nRecInstance;
116 inline sal_uInt32 Atom::getLength() const
118 return maRecordHeader.nRecLen;
121 } // namespace ppt
123 #endif
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */