update dev300-m57
[ooovba.git] / svtools / inc / twain.hxx
blob7314e6c046e4aa153c17a4f93cbba115d9bec6fe
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: twain.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 _TWAIN_HXX
32 #define _TWAIN_HXX
34 // please add new platforms if TWAIN is available
35 #if defined WIN || defined WNT || defined UNX
36 #define TWAIN_AVAILABLE 1
37 #else
38 #undef TWAIN_AVAILABLE
39 #endif
41 // include following only, if define is not set
42 #ifndef _TWAIN_HXX_CHECK
44 #include <vcl/bitmap.hxx>
46 // -----------
47 // - Defines -
48 // -----------
50 #define TWAIN_ERR_NO_ERROR 0
51 #define TWAIN_ERR_MODULE_NOT_LOADED 2
52 #define TWAIN_ERR_DSMENTRY_NOT_FOUND 4
53 #define TWAIN_ERR_SOURCE_MANAGER_NOT_OPENED 6
54 #define TWAIN_ERR_SOURCE_SELECTION_DIALOG 8
56 // ---------
57 // - Twain -
58 // ---------
60 struct TwainImp;
61 namespace com { namespace sun { namespace star { namespace lang { struct EventObject; } } } }
63 class Twain
65 friend class TwainEventListener;
67 private:
69 TwainImp* mpImp;
71 Bitmap maBitmap;
72 Link maUpdateLink;
73 USHORT mnErrorCode;
74 BOOL mbScanning;
76 Twain();
77 Twain( const Twain& rTwain );
78 const Twain& operator=( const Twain& rTwain ) { return *this; }
80 protected:
82 void Disposing( const com::sun::star::lang::EventObject& rEventObject );
84 public:
86 Twain( const Link& rUpdateLink );
87 ~Twain();
89 BOOL SelectSource();
90 BOOL PerformTransfer();
92 Bitmap GetBitmap();
94 BOOL IsScanning() const { return mbScanning; }
95 USHORT GetErrorCode() const { return mnErrorCode; }
98 #endif // _TWAIN_HXX_CHECK
99 #endif // _TWAIN_HXX