/Users/ericb/Desktop/NATIVEPRINTDLG01/extensions/source/scanner/scanner.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: scanner.hxx,v $
00006  *
00007  *  $Revision: 1.5 $
00008  *
00009  *  last change: $Author: hr $ $Date: 2006/06/19 10:46:34 $
00010  *
00011  *  The Contents of this file are made available subject to
00012  *  the terms of GNU Lesser General Public License Version 2.1.
00013  *
00014  *
00015  *    GNU Lesser General Public License Version 2.1
00016  *    =============================================
00017  *    Copyright 2005 by Sun Microsystems, Inc.
00018  *    901 San Antonio Road, Palo Alto, CA 94303, USA
00019  *
00020  *    This library is free software; you can redistribute it and/or
00021  *    modify it under the terms of the GNU Lesser General Public
00022  *    License version 2.1, as published by the Free Software Foundation.
00023  *
00024  *    This library is distributed in the hope that it will be useful,
00025  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  *    Lesser General Public License for more details.
00028  *
00029  *    You should have received a copy of the GNU Lesser General Public
00030  *    License along with this library; if not, write to the Free Software
00031  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00032  *    MA  02111-1307  USA
00033  *
00034  ************************************************************************/
00035 
00036 #ifndef _EXT_SCANNER_HXX
00037 #define _EXT_SCANNER_HXX
00038 
00039 #ifndef _STREAM_HXX
00040 #include <tools/stream.hxx>
00041 #endif
00042 #ifndef _VOS_MUTEX_HXX_
00043 #include <vos/mutex.hxx>
00044 #endif
00045 #ifndef __RTL_USTRING_HXX_
00046 #include <rtl/ustring.hxx>
00047 #endif
00048 #ifndef _CPPUHELPER_WEAK_HXX_
00049 #include <cppuhelper/weak.hxx>
00050 #endif
00051 #ifndef _CPPUHELPER_WEAK_HXX_
00052 #include <cppuhelper/weak.hxx>
00053 #endif
00054 #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
00055 #include <com/sun/star/uno/Reference.h>
00056 #endif
00057 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_
00058 #include <com/sun/star/uno/Sequence.h>
00059 #endif
00060 #ifndef __COM_SUN_STAR_AWT_XBITMAP_HPP
00061 #include <com/sun/star/awt/XBitmap.hpp>
00062 #endif
00063 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
00064 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
00065 #endif
00066 #ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
00067 #include <com/sun/star/lang/XEventListener.hpp>
00068 #endif
00069 #ifndef __COM_SUN_STAR_LANG_EVENTOBJECT_HPP
00070 #include <com/sun/star/lang/EventObject.hpp>
00071 #endif
00072 #ifndef _COM_SUN_STAR_SCANNER_XSCANNERMANAGER_HPP_
00073 #include <com/sun/star/scanner/XScannerManager.hpp>
00074 #endif
00075 #ifndef _COM_SUN_STAR_SCANNER_SCANNEREXCEPTION_HPP_
00076 #include <com/sun/star/scanner/ScannerException.hpp>
00077 #endif
00078 
00079 using namespace rtl;
00080 using namespace cppu;
00081 using namespace com::sun::star::uno;
00082 using namespace com::sun::star::scanner;
00083 
00084 // -----------
00085 // - Defines -
00086 // -----------
00087 
00088 #define REF( _def_Obj )                                         Reference< _def_Obj >
00089 #define SEQ( _def_Obj )                                         Sequence< _def_Obj > 
00090 #define ANY                                                                     Any 
00091 #define AWT                                                                     com::sun::star::awt
00092 
00093 // ------------------
00094 // - ScannerManager -
00095 // ------------------
00096 
00097 class ScannerManager : public OWeakObject, XScannerManager, AWT::XBitmap
00098 {
00099 protected:
00100 
00101         vos::OMutex                                                             maProtector;
00102         void*                                                                   mpData;
00103 
00104         void                                                                    DestroyData();
00105 
00106 public:
00107 
00108                                                                                         ScannerManager();
00109         virtual                                                                 ~ScannerManager();
00110                                                                                         
00111         // XInterface                                                                           
00112         virtual ANY SAL_CALL                                    queryInterface( const Type & rType ) throw( RuntimeException );
00113     virtual void SAL_CALL                                       acquire() throw();
00114     virtual void SAL_CALL                                       release() throw();
00115 
00116         // XScannerManager
00117         virtual SEQ( ScannerContext ) SAL_CALL  getAvailableScanners() throw();
00118         virtual BOOL SAL_CALL                                   configureScanner( ScannerContext& scanner_context ) throw( ScannerException );
00119         virtual void SAL_CALL                                   startScan( const ScannerContext& scanner_context, const REF( com::sun::star::lang::XEventListener )& rxListener ) throw( ScannerException );
00120         virtual ScanError SAL_CALL                              getError( const ScannerContext& scanner_context ) throw( ScannerException );
00121         virtual REF( AWT::XBitmap ) SAL_CALL    getBitmap( const ScannerContext& scanner_context ) throw( ScannerException );
00122 
00123         // XBitmap
00124         virtual AWT::Size SAL_CALL                              getSize() throw();
00125         virtual SEQ( sal_Int8 ) SAL_CALL                getDIB() throw();
00126         virtual SEQ( sal_Int8 ) SAL_CALL                getMaskDIB() throw();
00127 
00128         // Misc
00129         OUString                                                                getImplementationName() throw();
00130         static OUString                                                 getImplementationName_Static() throw();
00131     Sequence< OUString >                                        getSupportedServiceNames() throw();
00132     static Sequence< OUString >                         getSupportedServiceNames_Static() throw();
00133     BOOL                                                                        supportsService( const OUString& ServiceName ) throw();
00134 
00135         void                                                                    Lock() { maProtector.acquire(); }
00136         void                                                                    Unlock() { maProtector.release(); }
00137 
00138         void*                                                                   GetData() const { return mpData; }
00139         void                                                                    SetData( void* pData ) { DestroyData(); mpData = pData; }
00140 };
00141 
00142 // -----------------------------------------------------------------------------
00143 
00144 REF( XInterface ) SAL_CALL ScannerManager_CreateInstance( const REF( com::sun::star::lang::XMultiServiceFactory )& rxFactory ) throw( Exception );
00145 
00146 #endif

Generated on Thu Feb 28 17:53:26 2008 for AquaScanner by  doxygen 1.5.1