xref: /aoo42x/main/sot/source/sdstor/stgole.hxx (revision bbfc4cc7)
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 _SDSTOR_STGOLE_HXX
25 #define _SDSTOR_STGOLE_HXX
26 
27 #include <string.h> // memset()
28 
29 #include "sot/stg.hxx"
30 #include "stgelem.hxx"
31 
32 class StgInternalStream : public SvStream
33 {
34     BaseStorageStream* pStrm;
35 	virtual sal_uLong GetData( void* pData, sal_uLong nSize );
36     virtual sal_uLong PutData( const void* pData, sal_uLong nSize );
37     virtual sal_uLong SeekPos( sal_uLong nPos );
38     virtual void  FlushData();
39 public:
40     StgInternalStream( BaseStorage&, const String&, sal_Bool );
41    ~StgInternalStream();
42 	void Commit();
43 };
44 
45 // standard stream "\1CompObj"
46 
47 class StgCompObjStream : public StgInternalStream
48 {
49 	ClsId  aClsId;
50 	String aUserName;
51 	sal_uLong  nCbFormat;
52 public:
53     StgCompObjStream( BaseStorage&, sal_Bool );
GetClsId()54 	ClsId&  GetClsId()    { return aClsId;    }
GetUserName()55 	String& GetUserName() { return aUserName; }
GetCbFormat()56 	sal_uLong&  GetCbFormat() { return nCbFormat; }
57 	sal_Bool    Load();
58 	sal_Bool    Store();
59 };
60 
61 // standard stream "\1Ole"
62 
63 class StgOleStream : public StgInternalStream
64 {
65 	sal_uInt32 nFlags;
66 public:
67     StgOleStream( BaseStorage&, sal_Bool );
GetFlags()68 	sal_uInt32& GetFlags() { return nFlags; }
69 	sal_Bool Load();
70 	sal_Bool Store();
71 };
72 
73 #endif
74