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

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: scanner.cxx,v $
00006  *
00007  *  $Revision: 1.6 $
00008  *
00009  *  last change: $Author: ihi $ $Date: 2008/01/14 15:03:38 $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
00037 #include "precompiled_extensions.hxx"
00038 #include <scanner.hxx>
00039 
00040 // ------------------
00041 // - ScannerManager -
00042 // ------------------
00043 
00044 REF( XInterface ) SAL_CALL ScannerManager_CreateInstance( const REF( com::sun::star::lang::XMultiServiceFactory )& /*rxFactory*/ ) throw ( Exception )
00045 {
00046         return *( new ScannerManager() );
00047 }
00048 
00049 // -----------------------------------------------------------------------------
00050 
00051 ScannerManager::ScannerManager() :
00052         mpData( NULL )
00053 {
00054 }
00055 
00056 // -----------------------------------------------------------------------------
00057 
00058 ScannerManager::~ScannerManager()
00059 {
00060         DestroyData();
00061 }
00062 
00063 // -----------------------------------------------------------------------------
00064 
00065 ANY SAL_CALL ScannerManager::queryInterface( const Type& rType ) throw( RuntimeException )
00066 {
00067         const ANY aRet( cppu::queryInterface( rType, 
00068                                                                                   static_cast< XScannerManager* >( this ),
00069                                                                                   static_cast< AWT::XBitmap* >( this ) ) );
00070 
00071         return( aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ) );
00072 }
00073 
00074 // -----------------------------------------------------------------------------
00075 
00076 void SAL_CALL ScannerManager::acquire() throw()
00077 {
00078         OWeakObject::acquire();
00079 }
00080 
00081 // -----------------------------------------------------------------------------
00082 
00083 void SAL_CALL ScannerManager::release() throw()
00084 {
00085         OWeakObject::release();
00086 }
00087 
00088 // -----------------------------------------------------------------------------
00089 
00090 SEQ( sal_Int8 ) SAL_CALL ScannerManager::getMaskDIB() throw()
00091 {
00092         return SEQ( sal_Int8 )(); 
00093 }
00094 
00095 // -----------------------------------------------------------------------------
00096 
00097 OUString ScannerManager::getImplementationName() throw ()
00098 {
00099         return getImplementationName_Static();
00100 }
00101 
00102 // -----------------------------------------------------------------------------
00103 
00104 OUString ScannerManager::getImplementationName_Static() throw()
00105 {
00106         return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.scanner.ScannerManager" ) );
00107 }
00108 
00109 // -----------------------------------------------------------------------------
00110 
00111 SEQ( OUString ) ScannerManager::getSupportedServiceNames() throw ()
00112 {
00113         return getSupportedServiceNames_Static();
00114 }
00115 
00116 // -----------------------------------------------------------------------------
00117 
00118 SEQ( OUString ) ScannerManager::getSupportedServiceNames_Static() throw ()
00119 {
00120         SEQ( OUString ) aSNS( 1 );
00121         
00122         aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.scanner.ScannerManager" ) ); 
00123         
00124         return aSNS;
00125 }
00126 
00127 // -----------------------------------------------------------------------------
00128 
00129 BOOL ScannerManager::supportsService( const OUString& ServiceName ) throw ()
00130 {
00131         SEQ( OUString ) aSNL( getSupportedServiceNames() );
00132         const OUString* pArray = aSNL.getConstArray();
00133 
00134         for( INT32 i = 0; i < aSNL.getLength(); i++ )
00135                 if( pArray[i] == ServiceName )
00136                         return TRUE;
00137         
00138         return FALSE;
00139 }

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