update ooo310-m15
[ooovba.git] / sc / source / filter / inc / fdumperole.hxx
blobad6d1b0dedd9e52c8d254326ca179d770c51f0ca
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fdumperole.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_FDUMPEROLE_HXX
32 #define SC_FDUMPEROLE_HXX
34 #include <sot/storage.hxx>
35 #include <sot/storinfo.hxx>
36 #include "fdumper.hxx"
38 #if SCF_INCL_DUMPER
40 namespace scf {
41 namespace dump {
43 // ============================================================================
44 // ============================================================================
46 class OleStorageObject : public ObjectBase
48 public:
49 explicit OleStorageObject( const OleStorageObject& rParentStrg, const String& rStrgName );
50 explicit OleStorageObject( const ObjectBase& rParent, SotStorageRef xRootStrg );
51 explicit OleStorageObject( const ObjectBase& rParent, SvStream& rRootStrm );
52 explicit OleStorageObject( const ObjectBase& rParent );
53 virtual ~OleStorageObject();
55 inline SotStorageRef GetStorage() const { return mxStrg; }
56 inline const String& GetStoragePath() const { return maPath; }
57 inline const String& GetStorageName() const { return maName; }
58 String GetFullName() const;
60 void ExtractStorageToFileSystem();
62 protected:
63 inline explicit OleStorageObject() {}
64 void Construct( const ObjectBase& rParent, SotStorageRef xStrg, const String& rPath );
65 void Construct( const OleStorageObject& rParentStrg, const String& rStrgName );
66 void Construct( const ObjectBase& rParent, SvStream& rRootStrm );
67 void Construct( const ObjectBase& rParent );
69 virtual bool ImplIsValid() const;
70 virtual void ImplDumpHeader();
71 virtual void ImplDumpFooter();
73 using ObjectBase::Construct;
75 private:
76 void DumpStorageInfo( bool bExtended );
78 private:
79 SotStorageRef mxStrg;
80 String maPath;
81 String maName;
84 typedef ScfRef< OleStorageObject > OleStorageObjectRef;
86 // ============================================================================
88 class OleStorageIterator : public Base
90 public:
91 explicit OleStorageIterator( const OleStorageObject& rStrg );
92 explicit OleStorageIterator( SotStorageRef xStrg );
93 ~OleStorageIterator();
95 ULONG GetSize() const;
97 OleStorageIterator& operator++();
98 const SvStorageInfo* operator->() const;
100 protected:
101 void Construct( SotStorageRef xStrg );
103 private:
104 virtual bool ImplIsValid() const;
106 private:
107 typedef ScfRef< SvStorageInfoList > SvStorageInfoListRef;
108 SvStorageInfoListRef mxInfoList;
109 ULONG mnIndex;
112 // ============================================================================
113 // ============================================================================
115 class OleStreamObject : public StreamObjectBase
117 public:
118 explicit OleStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName );
119 virtual ~OleStreamObject();
121 protected:
122 inline explicit OleStreamObject() {}
123 void Construct( const OleStorageObject& rParentStrg, const String& rStrmName );
125 virtual bool ImplIsValid() const;
127 using StreamObjectBase::Construct;
129 private:
130 SotStorageStreamRef mxStrm;
133 typedef ScfRef< OleStreamObject > OleStreamObjectRef;
135 // ============================================================================
137 class OlePropertyStreamObject : public OleStreamObject
139 public:
140 explicit OlePropertyStreamObject( const OleStorageObject& rParentStrg, const String& rStrmName );
142 protected:
143 inline explicit OlePropertyStreamObject() {}
144 void Construct( const OleStorageObject& rParentStrg, const String& rStrmName );
146 virtual void ImplDumpBody();
148 using OleStreamObject::Construct;
150 private:
151 void DumpSection( const String& rGuid, sal_uInt32 nStartPos );
153 void DumpProperty( sal_Int32 nPropId, sal_uInt32 nStartPos );
154 void DumpCodePageProperty( sal_uInt32 nStartPos );
155 void DumpDictionaryProperty( sal_uInt32 nStartPos );
157 void DumpPropertyContents( sal_Int32 nPropId );
158 void DumpPropertyValue( sal_Int32 nPropId, sal_Int32 nBaseType );
160 sal_Int32 DumpPropertyType();
161 void DumpBlob( const sal_Char* pcName );
162 String DumpString8( const sal_Char* pcName );
163 String DumpCharArray8( const sal_Char* pcName, sal_Int32 nCharCount );
164 String DumpString16( const sal_Char* pcName );
165 String DumpCharArray16( const sal_Char* pcName, sal_Int32 nCharCount );
166 DateTime DumpFileTime( const sal_Char* pcName );
168 bool StartElement( sal_uInt32 nStartPos );
169 void WriteSectionHeader( const String& rGuid, sal_uInt32 nStartPos );
170 void WritePropertyHeader( sal_Int32 nPropId, sal_uInt32 nStartPos );
172 private:
173 NameListRef mxPropIds;
174 rtl_TextEncoding meTextEnc;
175 bool mbIsUnicode;
178 // ============================================================================
179 // ============================================================================
181 } // namespace dump
182 } // namespace scf
184 #endif
185 #endif