/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** used for declaring UNO3-Defaults, i.e. acquire/release if you want to forward all queryInterfaces to the base class, (e.g. if you override queryAggregation)
*/ #define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass) \ virtualvoid SAL_CALL acquire() noexcept override { baseclass::acquire(); } \ virtualvoid SAL_CALL release() noexcept override { baseclass::release(); } \ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override \
{ return baseclass::queryInterface(_rType); }
/** Use this macro to forward XComponent methods to base class
When using the ::cppu::WeakComponentImplHelper base classes to implement a UNO interface, a problem occurs when the interface itself already derives from XComponent (like e.g. awt::XWindow or awt::XControl): ::cppu::WeakComponentImplHelper is then still abstract. Using this macro in the most derived class definition provides overrides for the XComponent methods, forwarding them to the given baseclass.
@param classname Name of the class this macro is issued within
@param baseclass Name of the baseclass that should have the XInterface methods forwarded to - that's usually the WeakComponentImplHelperN base
@param implhelper Name of the baseclass that should have the XComponent methods forwarded to - in the case of the WeakComponentImplHelper, that would be ::cppu::WeakComponentImplHelperBase
*/ #define DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS(classname, baseclass, implhelper) \ virtualvoid SAL_CALL acquire() noexcept override { baseclass::acquire(); } \ virtualvoid SAL_CALL release() noexcept override { baseclass::release(); } \ virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override \
{ return baseclass::queryInterface(_rType); } \ virtualvoid SAL_CALL dispose() override \
{ \
implhelper::dispose(); \
} \ virtualvoid SAL_CALL addEventListener( \
css::uno::Reference< css::lang::XEventListener > const & xListener ) override \
{ \
implhelper::addEventListener(xListener); \
} \ virtualvoid SAL_CALL removeEventListener( \
css::uno::Reference< css::lang::XEventListener > const & xListener ) override \
{ \
implhelper::removeEventListener(xListener); \
}
//= deriving from multiple XInterface-derived classes
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.