1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _DFFRECORDHEADER_HXX 25 #define _DFFRECORDHEADER_HXX 26 27 #include <tools/solar.h> 28 #include <tools/stream.hxx> 29 #include <filter/msfilter/msfilterdllapi.h> 30 #include <svx/msdffdef.hxx> 31 32 class MSFILTER_DLLPUBLIC DffRecordHeader 33 { 34 35 public: 36 sal_uInt8 nRecVer; // may be DFF_PSFLAG_CONTAINER 37 sal_uInt16 nRecInstance; 38 sal_uInt16 nImpVerInst; 39 sal_uInt16 nRecType; 40 sal_uInt32 nRecLen; 41 sal_uLong nFilePos; 42 public: DffRecordHeader()43 DffRecordHeader() : nRecVer(0), nRecInstance(0), nImpVerInst(0), nRecType(0), nRecLen(0), nFilePos(0) {} IsContainer() const44 FASTBOOL IsContainer() const { return nRecVer == DFF_PSFLAG_CONTAINER; } GetRecBegFilePos() const45 sal_uLong GetRecBegFilePos() const { return nFilePos; } GetRecEndFilePos() const46 sal_uLong GetRecEndFilePos() const { return nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen; } SeekToEndOfRecord(SvStream & rIn) const47 void SeekToEndOfRecord(SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE + nRecLen ); } SeekToContent(SvStream & rIn) const48 void SeekToContent( SvStream& rIn) const { rIn.Seek(nFilePos + DFF_COMMON_RECORD_HEADER_SIZE ); } SeekToBegOfRecord(SvStream & rIn) const49 void SeekToBegOfRecord(SvStream& rIn) const { rIn.Seek( nFilePos ); } 50 51 MSFILTER_DLLPUBLIC friend SvStream& operator>>(SvStream& rIn, DffRecordHeader& rRec); 52 53 }; 54 55 #endif 56