Resolves: #i87883# add a PrinterServer.idl and fix impl
Change-Id: Id351109616737f916d7f4c2715347daa23367281
This commit is contained in:
@@ -25,11 +25,15 @@
|
|||||||
#include <com/sun/star/awt/XPrinter.hpp>
|
#include <com/sun/star/awt/XPrinter.hpp>
|
||||||
#include <com/sun/star/awt/XPrinterServer.hpp>
|
#include <com/sun/star/awt/XPrinterServer.hpp>
|
||||||
#include <com/sun/star/awt/XInfoPrinter.hpp>
|
#include <com/sun/star/awt/XInfoPrinter.hpp>
|
||||||
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include <com/sun/star/lang/XTypeProvider.hpp>
|
#include <com/sun/star/lang/XTypeProvider.hpp>
|
||||||
|
#include <cppuhelper/implbase2.hxx>
|
||||||
#include <cppuhelper/weak.hxx>
|
#include <cppuhelper/weak.hxx>
|
||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
|
|
||||||
|
#include <toolkit/helper/macros.hxx>
|
||||||
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
|
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
|
||||||
|
#include <toolkit/helper/servicenames.hxx>
|
||||||
#include <cppuhelper/propshlp.hxx>
|
#include <cppuhelper/propshlp.hxx>
|
||||||
|
|
||||||
#include "vcl/oldprintadaptor.hxx"
|
#include "vcl/oldprintadaptor.hxx"
|
||||||
@@ -190,30 +194,18 @@ public:
|
|||||||
// class VCLXPrinterServer
|
// class VCLXPrinterServer
|
||||||
// ----------------------------------------------------
|
// ----------------------------------------------------
|
||||||
|
|
||||||
class VCLXPrinterServer : public ::com::sun::star::awt::XPrinterServer,
|
class VCLXPrinterServer : public ::cppu::WeakImplHelper2<com::sun::star::awt::XPrinterServer,
|
||||||
public ::com::sun::star::lang::XTypeProvider,
|
com::sun::star::lang::XServiceInfo>
|
||||||
public ::cppu::OWeakObject
|
|
||||||
{
|
{
|
||||||
public:
|
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::awt::XPrinterServer
|
||||||
::com::sun::star::uno::Sequence< OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException);
|
::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::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);
|
::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_
|
#endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -1744,6 +1744,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
|
|||||||
PopupMenuDirection \
|
PopupMenuDirection \
|
||||||
PosSize \
|
PosSize \
|
||||||
PrinterException \
|
PrinterException \
|
||||||
|
PrinterServer \
|
||||||
PushButtonType \
|
PushButtonType \
|
||||||
RasterOperation \
|
RasterOperation \
|
||||||
Rectangle \
|
Rectangle \
|
||||||
|
28
offapi/com/sun/star/awt/PrinterServer.idl
Normal file
28
offapi/com/sun/star/awt/PrinterServer.idl
Normal file
@@ -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: */
|
@@ -406,19 +406,6 @@ IMPL_XTYPEPROVIDER_END
|
|||||||
// class VCLXPrinterServer
|
// 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::awt::XPrinterServer
|
||||||
::com::sun::star::uno::Sequence< OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException)
|
::com::sun::star::uno::Sequence< OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user