Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svtools / xbmread.hxx
blob76ac6bbe4aaac4209091832e9128f8f7c342866f
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.3 $
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 namespace binfilter
44 #ifdef _XBMPRIVATE
46 // ---------
47 // - Enums -
48 // ---------
50 enum XBMFormat
52 XBM10,
53 XBM11
56 enum ReadState
58 XBMREAD_OK,
59 XBMREAD_ERROR,
60 XBMREAD_NEED_MORE
63 // -------------
64 // - XBMReader -
65 // -------------
67 class XBMReader : public GraphicReader
69 SvStream& rIStm;
70 Bitmap aBmp1;
71 BitmapWriteAccess* pAcc1;
72 short* pHexTable;
73 BitmapColor aWhite;
74 BitmapColor aBlack;
75 long nLastPos;
76 long nWidth;
77 long nHeight;
78 BOOL bStatus;
80 void InitTable();
81 ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
82 const char* pTok2 = NULL, const char* pTok3 = NULL );
83 long ParseDefine( const sal_Char* pDefine );
84 BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
87 public:
89 XBMReader( SvStream& rStm );
90 virtual ~XBMReader();
92 ReadState ReadXBM( Graphic& rGraphic );
95 #endif // _XBMPRIVATE
97 // -------------
98 // - ImportXBM -
99 // -------------
101 BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic );
105 #endif // _XBMREAD_HXX