diff -r e2f2a04ad397 offapi/com/sun/star/awt/PrinterServer.idl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/offapi/com/sun/star/awt/PrinterServer.idl Thu Apr 07 13:15:24 2011 -0300 @@ -0,0 +1,51 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2011 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_awt_PrinterServer_idl__ +#define __com_sun_star_awt_PrinterServer_idl__ + +#ifndef __com_sun_star_awt_XPrinterServer_idl__ +#include +#endif + +//============================================================================= + +module com { module sun { module star { module awt { + +//============================================================================= + +/** manages several printers on one machine. + */ +service PrinterServer +{ + interface XPrinterServer; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff -r e2f2a04ad397 offapi/com/sun/star/awt/makefile.mk --- a/offapi/com/sun/star/awt/makefile.mk Wed Apr 06 19:22:59 2011 -0300 +++ b/offapi/com/sun/star/awt/makefile.mk Thu Apr 07 13:15:24 2011 -0300 @@ -129,6 +129,7 @@ PopupMenuDirection.idl\ PosSize.idl\ PrinterException.idl\ + PrinterServer.idl\ PushButtonType.idl\ RasterOperation.idl\ Rectangle.idl\ diff -r e2f2a04ad397 toolkit/inc/toolkit/awt/vclxprinter.hxx --- a/toolkit/inc/toolkit/awt/vclxprinter.hxx Wed Apr 06 19:22:59 2011 -0300 +++ b/toolkit/inc/toolkit/awt/vclxprinter.hxx Thu Apr 07 13:15:24 2011 -0300 @@ -33,11 +33,15 @@ #include #include #include +#include #include +#include #include #include +#include #include +#include #include #include "vcl/oldprintadaptor.hxx" @@ -198,24 +202,17 @@ // class VCLXPrinterServer // ---------------------------------------------------- -class VCLXPrinterServer : public ::com::sun::star::awt::XPrinterServer, - public ::cppu::OWeakObject +typedef ::cppu::WeakImplHelper2< com::sun::star::awt::XPrinterServer, + com::sun::star::lang::XServiceInfo > VCLXPrinterServer_Base; +class VCLXPrinterServer : public VCLXPrinterServer_Base { public: - - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - // ::com::sun::star::awt::XPrinterServer ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const ::rtl::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); + + DECLIMPL_SERVICEINFO( VCLXPrinterServer, szServiceName2_PrinterServer ); }; diff -r e2f2a04ad397 toolkit/source/awt/vclxprinter.cxx --- a/toolkit/source/awt/vclxprinter.cxx Wed Apr 06 19:22:59 2011 -0300 +++ b/toolkit/source/awt/vclxprinter.cxx Thu Apr 07 13:15:24 2011 -0300 @@ -419,19 +419,6 @@ // class VCLXPrinterServer // ---------------------------------------------------- -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXPrinterServer::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XPrinterServer*, this ) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXPrinterServer ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinterServer>* ) NULL ) -IMPL_XTYPEPROVIDER_END - // ::com::sun::star::awt::XPrinterServer ::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException) { @@ -459,5 +446,3 @@ return xP; } - -