diff options
-rw-r--r-- | include/toolkit/awt/vclxprinter.hxx | 24 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/PrinterServer.idl | 28 | ||||
-rw-r--r-- | toolkit/source/awt/vclxprinter.cxx | 13 |
4 files changed, 37 insertions, 29 deletions
diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx index ca14b2d35f67..a3aca63f381a 100644 --- a/include/toolkit/awt/vclxprinter.hxx +++ b/include/toolkit/awt/vclxprinter.hxx @@ -25,11 +25,15 @@ #include <com/sun/star/awt/XPrinter.hpp> #include <com/sun/star/awt/XPrinterServer.hpp> #include <com/sun/star/awt/XInfoPrinter.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> +#include <cppuhelper/implbase2.hxx> #include <cppuhelper/weak.hxx> #include <osl/mutex.hxx> +#include <toolkit/helper/macros.hxx> #include <toolkit/helper/mutexandbroadcasthelper.hxx> +#include <toolkit/helper/servicenames.hxx> #include <cppuhelper/propshlp.hxx> #include "vcl/oldprintadaptor.hxx" @@ -190,29 +194,17 @@ public: // class VCLXPrinterServer // ---------------------------------------------------- -class VCLXPrinterServer : public ::com::sun::star::awt::XPrinterServer, - public ::com::sun::star::lang::XTypeProvider, - public ::cppu::OWeakObject +class VCLXPrinterServer : public ::cppu::WeakImplHelper2<com::sun::star::awt::XPrinterServer, + com::sun::star::lang::XServiceInfo> { 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< OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); -}; - - + DECLIMPL_SERVICEINFO(VCLXPrinterServer, szServiceName2_PrinterServer); +}; #endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_ diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index b73b86ac9f2a..a3772e08104d 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -1744,6 +1744,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\ PopupMenuDirection \ PosSize \ PrinterException \ + PrinterServer \ PushButtonType \ RasterOperation \ Rectangle \ diff --git a/offapi/com/sun/star/awt/PrinterServer.idl b/offapi/com/sun/star/awt/PrinterServer.idl new file mode 100644 index 000000000000..e323939988f4 --- /dev/null +++ b/offapi/com/sun/star/awt/PrinterServer.idl @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_awt_PrinterServer_idl__ +#define __com_sun_star_awt_PrinterServer_idl__ + +#include <com/sun/star/awt/XPrinterServer.idl> + +module com { module sun { module star { module awt { + +/** mechanism to discover and manage printers + */ +service PrinterServer +{ + interface com::sun::star::awt::XPrinterServer; +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index a682157477e4..60ef23190da0 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -406,19 +406,6 @@ IMPL_XTYPEPROVIDER_END // 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, - (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< OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException) { |