merge the formfield patch from ooo-build
[ooovba.git] / svtools / inc / xbmread.hxx
blob6161b6a5b64a4cb3b4757534344b0c38a7211890
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xbmread.hxx,v $
10 * $Revision: 1.5 $
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 _XBMREAD_HXX
32 #define _XBMREAD_HXX
34 #ifndef _GRAPH_HXX
35 #include <vcl/graph.hxx>
36 #endif
37 #ifndef _BMPACC_HXX
38 #include <vcl/bmpacc.hxx>
39 #endif
41 #ifdef _XBMPRIVATE
43 // ---------
44 // - Enums -
45 // ---------
47 enum XBMFormat
49 XBM10,
50 XBM11
53 enum ReadState
55 XBMREAD_OK,
56 XBMREAD_ERROR,
57 XBMREAD_NEED_MORE
60 // -------------
61 // - XBMReader -
62 // -------------
64 class XBMReader : public GraphicReader
66 SvStream& rIStm;
67 Bitmap aBmp1;
68 BitmapWriteAccess* pAcc1;
69 short* pHexTable;
70 BitmapColor aWhite;
71 BitmapColor aBlack;
72 long nLastPos;
73 long nWidth;
74 long nHeight;
75 BOOL bStatus;
77 void InitTable();
78 ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
79 const char* pTok2 = NULL, const char* pTok3 = NULL );
80 long ParseDefine( const sal_Char* pDefine );
81 BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
84 public:
86 XBMReader( SvStream& rStm );
87 virtual ~XBMReader();
89 ReadState ReadXBM( Graphic& rGraphic );
92 #endif // _XBMPRIVATE
94 // -------------
95 // - ImportXBM -
96 // -------------
98 BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic );
100 #endif // _XBMREAD_HXX