From b9337e22ce1dbf2eba0e8c8db294ae99f4111f91 Mon Sep 17 00:00:00 2001
From: Bjoern Michaelsen
- The method gets called with Mutex acquired.
-
- as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
- assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
- @return an pointer to the newly created array helper. Must not be NULL.
- */
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const = 0;
- };
-
- //------------------------------------------------------------------
- template
The given context (it's mutex, respectively) is locked, and an exception is thrown if the context - is not alive anymore. In the latter case, of course, the mutex is freed, again.
- - @param _pContext - the context which shall be guarded - @precondThe context (it's mutex, respectively) is unlocked.
- */ - inline ~OContextEntryGuard(); - }; - - //..................................................................... - inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext ) - :OContextEntryGuard_Base( _pContext->GetMutex( OAccessibleContextHelper::OAccessControl() ) ) - { - _pContext->ensureAlive( OAccessibleContextHelper::OAccessControl() ); - } - - //..................................................................... - inline OContextEntryGuard::~OContextEntryGuard() - { - } - - //===================================================================== - //= OExternalLockGuard - //===================================================================== - class OExternalLockGuard - :public OMutexGuard - ,public OContextEntryGuard - { - public: - inline OExternalLockGuard( OAccessibleContextHelper* _pContext ); - inline ~OExternalLockGuard( ); - }; - - //..................................................................... - inline OExternalLockGuard::OExternalLockGuard( OAccessibleContextHelper* _pContext ) - :OMutexGuard( _pContext->getExternalLock( OAccessibleContextHelper::OAccessControl() ) ) - ,OContextEntryGuard( _pContext ) - { - // #102438# - // Only lock the external mutex, - // release the ::osl::Mutex of the OAccessibleContextHelper instance. - // If you call into another UNO object with locked ::osl::Mutex, - // this may lead to dead locks. - clear(); - } - - //..................................................................... - inline OExternalLockGuard::~OExternalLockGuard( ) - { - } - -//......................................................................... -} // namespace comphelper -//......................................................................... - -#endif // COMPHELPER_ACCESSIBLE_CONTEXT_HELPER_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/inc/comphelper/accessibleeventnotifier.hxx b/comphelper/inc/comphelper/accessibleeventnotifier.hxx deleted file mode 100644 index f0a745baa5a8..000000000000 --- a/comphelper/inc/comphelper/accessibleeventnotifier.hxx +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- 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 . - */ - -#ifndef COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER -#define COMPHELPER_ACCESSIBLE_EVENT_NOTIFIER - -#includeNo precaution is taken to care for disposal of this component. When the component
- dies, it must call
Note that no disposing event is fired when you use this method, the client is simply revoked.
- You can for instance revoke a client if the last listener for it is revoked, but the client
- itself is not disposed.
- When the client is disposed, you should prefer
Any possibly pending events for this client are removed from the queue.
- - @seealso revokeClientNotifyDisposing - */ - static void revokeClient( const TClientId _nClient ); - - /** revokes a client, with additionally notifying a disposing event to all listeners registered for - this client - -Any other possibly pending events for this client are removed from the queue
- - @param _nClient - the id of the client which should be revoked - @param _rxEventSource - the source to be notified together with theThis class does not have own ref counting. In addition, it does not implement - the XAccesibleContext interface, but provides all the methods from this interface - which must be implemented using the inner context (such as getAccessibleChild*).
- -Children of the aggregated XAccessibleContext are wrapped, too.
- -AccessibleEvents fired by the inner context are multiplexed, especially, any references to - children in such events are translated. This means that even in such events, no un-wrapped object - will ever leave this class - if the aggregated context notifies an child event, the child passed - to the event is wrapped
- - @seealso OAccessibleContextWrapper - */ - class COMPHELPER_DLLPUBLIC OAccessibleContextWrapperHelper - :private OComponentProxyAggregationHelper - ,public OAccessibleContextWrapperHelper_Base - { - protected: - /// the context we're wrapping (properly typed, in opposite to OComponentProxyAggregationHelper::m_xInner) - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > - m_xInnerContext; - /// the XAccessible which created this context - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - m_xOwningAccessible; - /// the XAccessible which is to be returned in getAccessibleParent - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - m_xParentAccessible; - - OWrappedAccessibleChildrenManager* m_pChildMapper; // for mapping children from our inner context to our callers - - protected: - /** ctor - - @param _rxContext - a service factory - - @param _rxInnerAccessibleContext - the object to wrap - - @param _rxOwningAccessible - The XAccessible which created this object. This is necessary because children - of our wrapped context meed to be wrapped, too, and if they're asked for a parent, - they of course should return the proper parentUsually, you derive your clas from both OAccessibleContextWrapperHelper and XAccessibleEventBroadcaster, - and simply call all your XAccessibleEventListener with the given event.
- -The mutex of the BroadcastHelper passed to the instance's ctor is not locked when calling - into this method
- */ - virtual void notifyTranslatedEvent( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent ) throw (::com::sun::star::uno::RuntimeException) = 0; - - protected: - ~OAccessibleContextWrapperHelper( ); - - OAccessibleContextWrapperHelper( ); // never implemented - OAccessibleContextWrapperHelper( const OAccessibleContextWrapperHelper& ); // never implemented - OAccessibleContextWrapperHelper& operator=( const OAccessibleContextWrapperHelper& ); // never implemented - }; - - //========================================================================= - //= OAccessibleContextWrapper - //========================================================================= - typedef ::cppu::PartialWeakComponentImplHelper2< ::com::sun::star::accessibility::XAccessibleEventBroadcaster - , ::com::sun::star::accessibility::XAccessibleContext - > OAccessibleContextWrapper_CBase; - - class COMPHELPER_DLLPUBLIC OAccessibleContextWrapper - :public OBaseMutex - ,public OAccessibleContextWrapper_CBase - ,public OAccessibleContextWrapperHelper - { - private: - ::comphelper::AccessibleEventNotifier::TClientId m_nNotifierClient; // for notifying AccessibleEvents - - public: - /** ctor - - @param _rxContext - a service factory - - @param _rxInnerAccessibleContext - the object to wrap - - @param _rxOwningAccessible - The XAccessible which created this object. This is necessary because children - of our wrapped context meed to be wrapped, too, and if they're asked for a parent, - they of course should return the proper parentto be called only once per lifetime
- */ - void setTransientChildren( sal_Bool _bSet = sal_True ); - - /** sets the XAccessible which belongs to the XAccessibleContext which we work for -to be called only once per lifetime
- */ - void setOwningAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxAcc ); - - /// retrieves a wrapper for the given accessible - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - getAccessibleWrapperFor( - const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxKey, - sal_Bool _bCreate = sal_True - ); - - /// erases the given key from the map (if it is present there) - void removeFromCache( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxKey ); - - /// invalidates (i.e. empties) the map - void invalidateAll( ); - - /** disposes (i.e. cleares) the manager - -Note that the XAccessibleContext's of the mapped XAccessible objects are disposed, too.
- */ - void dispose(); - - /** handles a notification as got from the parent of the children we're managing -This applies only to the notifications which have a direct impact on our map.
- */ - void handleChildNotification( const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent ); - - /** translates events as got from the parent of the children we're managing -This applies only to the notifications which deal with child objects which we manage.
- */ - void translateAccessibleEvent( - const ::com::sun::star::accessibility::AccessibleEventObject& _rEvent, - ::com::sun::star::accessibility::AccessibleEventObject& _rTranslatedEvent - ); - - protected: - // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); - - protected: - void implTranslateChildEventValue( const ::com::sun::star::uno::Any& _rInValue, ::com::sun::star::uno::Any& _rOutValue ); - - protected: - ~OWrappedAccessibleChildrenManager( ); - - private: - COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager( ); // never implemented - COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager( const OWrappedAccessibleChildrenManager& ); // never implemented - COMPHELPER_DLLPRIVATE OWrappedAccessibleChildrenManager& operator=( const OWrappedAccessibleChildrenManager& ); // never implemented - }; - -//............................................................................. -} // namespace accessibility -//............................................................................. - -#endif // COMPHELPER_ACCESSIBLE_WRAPPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/inc/comphelper/accimplaccess.hxx b/comphelper/inc/comphelper/accimplaccess.hxx deleted file mode 100644 index 3407c5a7b8b4..000000000000 --- a/comphelper/inc/comphelper/accimplaccess.hxx +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- 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 . - */ - -#ifndef COMPHELPER_ACCIMPLACCESS_HXX -#define COMPHELPER_ACCIMPLACCESS_HXX - -#includeFor instance, when you want to implement a context which can be re-parented, you: -
setAccessibleParent( component, new_parent )
- Another aspect which can be controlled from the outside are states. If you have a class which
- has only partial control over it's states, you may consider deriving from OAccessibleImplementationAccess.
- For instance, say you have an implementation (say component A) which is unable to know or to
- determine if the represented object is selected, but another component (say B) which uses A (and integrates
- it into a tree of accessibility components) is.
- In this case, if A is derived from OAccessibleImplementationAccess, B can manipulate this
- foreign-controlled state flag "SELECTED" by using the static helper methods on this class.
Please note that the support for foreign controlled states is rather restrictive: You can't have states - which may be controlled by a foreign instances. This is implied by the fact that a derived - class can ask for states which are set only, not for the ones which are reset currently. -
- */ - class COMPHELPER_DLLPUBLIC OAccessibleImplementationAccess : public OAccImpl_Base - { - private: - OAccImpl_Impl* m_pImpl; - - protected: - /// retrieves the parent previously set via<
- operator, otherwise the collator will be used. The parameter is ignored if /singletons
key in a component context,
- so accessing them means retrieving the value under /singletons/<instance_name>
.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const OUString& _rInstanceName ) const;
-
- /** retrieves a singleton instance from the context
-
- Singletons are collected below the /singletons
key in a component context,
- so accessing them means retrieving the value under /singletons/<instance_name>
.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const sal_Char* _pAsciiInstanceName ) const
- {
- return getSingleton( OUString::createFromAscii( _pAsciiInstanceName ) );
- }
-
- /** returns the ->XMultiServiceFactory interface of ->m_xORB, for passing to
- older code which does not yet support ->XMultiComponentFactory
- @throws ::com::sun::star::uno::RuntimeException
- if our our component factory does not support this interface
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- getLegacyServiceFactory() const;
-
- /** retrieves a value from our component context
- @param _rName
- the name of the value to retrieve
- @return
- the context value with the given name
- @seealso XComponentContext::getValueByName
- @seealso getContextValueByAsciiName
- */
- ::com::sun::star::uno::Any
- getContextValueByName( const OUString& _rName ) const;
-
- /** retrieves a value from our component context, specified by 8-bit ASCII string
- @param _rName
- the name of the value to retrieve, as ASCII character string
- @return
- the context value with the given name
- @seealso XComponentContext::getValueByName
- @seealso getContextValueByName
- */
- inline ::com::sun::star::uno::Any
- getContextValueByAsciiName( const sal_Char* _pAsciiName ) const
- {
- return getContextValueByName( OUString::createFromAscii( _pAsciiName ) );
- }
-
- };
-
-//........................................................................
-} // namespace comphelper
-//........................................................................
-
-#endif // COMPHELPER_COMPONENTCONTEXT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/inc/comphelper/componentguard.hxx b/comphelper/inc/comphelper/componentguard.hxx
deleted file mode 100644
index eb1cfbcc24a8..000000000000
--- a/comphelper/inc/comphelper/componentguard.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- 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 .
- */
-
-#ifndef COMPHELPER_COMPONENTGUARD_HXX
-#define COMPHELPER_COMPONENTGUARD_HXX
-
-#include ::cppu::createSingleComponentFactory
)
- FactoryInstantiation pFactoryCreationFunc;
-
- ComponentDescription()
- :sImplementationName()
- ,aSupportedServices()
- ,sSingletonName()
- ,pComponentCreationFunc( NULL )
- ,pFactoryCreationFunc( NULL )
- {
- }
-
- ComponentDescription(
- const OUString& _rImplementationName,
- const ::com::sun::star::uno::Sequence< OUString >& _rSupportedServices,
- const OUString& _rSingletonName,
- ::cppu::ComponentFactoryFunc _pComponentCreationFunc,
- FactoryInstantiation _pFactoryCreationFunc
- )
- :sImplementationName( _rImplementationName )
- ,aSupportedServices( _rSupportedServices )
- ,sSingletonName( _rSingletonName )
- ,pComponentCreationFunc( _pComponentCreationFunc )
- ,pFactoryCreationFunc( _pFactoryCreationFunc )
- {
- }
- };
-
- //=========================================================================
- //= OModule
- //=========================================================================
- class OModuleImpl;
- class COMPHELPER_DLLPUBLIC OModule
- {
- private:
- oslInterlockedCount m_nClients; /// number of registered clients
- OModuleImpl* m_pImpl; /// impl class. lives as long as at least one client for the module is registered
-
- protected:
- mutable ::osl::Mutex m_aMutex; /// access safety
-
- public:
- OModule();
-
- virtual ~OModule();
-
- /** register a component implementing a service with the given data.
- @param _rImplementationName
- the implementation name of the component
- @param _rServiceNames
- the services the component supports
- @param _pCreateFunction
- a function for creating an instance of the component
- @param _pFactoryFunction
- a function for creating a factory for that component
- */
- void registerImplementation(
- const OUString& _rImplementationName,
- const ::com::sun::star::uno::Sequence< OUString >& _rServiceNames,
- ::cppu::ComponentFactoryFunc _pCreateFunction,
- FactoryInstantiation _pFactoryFunction = ::cppu::createSingleComponentFactory );
-
- /** registers a component given by Usually used from within component_getFactory.
- @param _pImplementationName - the implementation name of the component - @return - the XInterface access to a factory for the component - */ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getComponentFactory( - const OUString& _rImplementationName ); - - /** version of getComponentFactory which directly takes the char argument you got in your component_getFactory call - */ - void* getComponentFactory( const sal_Char* _pImplementationName ); - - public: - class ClientAccess { friend class OModuleClient; private: ClientAccess() { } }; - /// register a client for the module - void registerClient( ClientAccess ); - /// revoke a client for the module - void revokeClient( ClientAccess ); - - protected: - /** called when the first client has been registered - @precond -Assumed that the template argument has the three methods -
static OUString getImplementationName_static()
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static()
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)
- ::cppu::createSingleComponentFactory
.
- */
- OAutoRegistration( OModule& _rModule );
- };
-
- template Assumed that the template argument has the three methods -
static OUString getImplementationName_static()
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_static()
static OUString getSingletonName_static()
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)
- Useful if you have a non-refcountable class which should act as container listener.
- In this case, derive this class from OContainerListener, and create an adapter
-
- Alternatively, when using the
- ImplementationReference::createFromQuery() method to create an
- instance, this type can serve a different need: if the
- provided CppType only derives from XInterface (generally
- speaking, derives from a UNO interface above UnoType in the
- class hierarchy), then the default XIfType constitutes a
- possibly invalid downcast to UnoType. Setting XIfType equal to
- CppTypes's most derived UNO interface type then solves this
- problem (which is not as arcane as it seems to be. Just
- imagine you're providing a C++ abstract interface, which must
- provide UNO reference semantics. Naturally, you will derive
- this C++ interface only from XInterface, to reduce the number
- of ambiguous classes. Even more naturally, it is reasonable to
- have UnoType be something different from XInterface, governed
- by the usage of the C++ interface)
-
- @sample ImplementationReference< MyCppType, XMyInterface >
-
- @sample ImplementationReference< MyAbstractCppType, XMyInterface, XInterface >
- for an abstract C++ class
-
- @see ::rtl::Reference
-
- */
- template < class CppType,
- class UnoType,
- class XIfType=UnoType > class ImplementationReference
- {
- public:
-
- typedef UnoType UnoInterfaceType;
- typedef CppType ImplementationType;
- typedef XIfType UnambiguousXInterfaceType;
-
- /** Default-construct an ImplementationReference
-
- Uno reference will be invalid, implementation pointer will
- be NULL.
- */
- ImplementationReference() :
- mxRef(),
- mpImpl( NULL )
- {
- }
-
- /** Create an ImplementationReference from C++ pointer.
-
- This constructor does not perform an explicit
- QueryInterface on the provided implementation object, but
- constructs the UNO reference directly from the given
- pointer. This is the fastest, and most often the best way
- to create an ImplementationReference. If the conversion
- between the implementation object and the required UNO
- interface is ambiguous, provide the third template
- parameter with a type that can be unambiguously upcasted
- to the UNO interface (the second template parameter).
-
- There are cases, however, where performing a
- QueryInterface is the better, albeit slower choice. In
- these cases, createFromQuery() should be used.
-
- @param pImpl
- Pointer to the C++ implementation type
-
- @see createFromQuery()
- */
- explicit ImplementationReference( ImplementationType* pImpl ) :
- mxRef( static_cast
-
-
- See
- EventLogger aLogger( xContext, sLoggerName );
- ....
- aLogger.log( LogLevel::SEVERE, sSomeMessage );
- aLogger.logp( LogLevel::CONFIG, "MyClass", "MyMethod", sSomeMessage, SomeParameter1, SomeParameter2, SomeParameter3 );
-
-
- The log
and logp
calls support up to 6 parameters, which can be of
- arbitrary type. For every parameter, there must exist a function convertLogArgToString
- which takes an argument of the respective type, and returns a string.
-
- After a parameter has been converted to a string using the above mentioned
- convertLogArgToString
function, a placeholder $1$ (resp. $2$ resp. $4$ ...)
- in the message will be replaced with this string, and the resulting message will be logged.
- */
- class COMPHELPER_DLLPUBLIC EventLogger
- {
- protected:
- ::boost::shared_ptr< EventLogger_Impl > m_pImpl;
-
- public:
- /** creates an EventLogger
instance working with a css.logging.XLogger
- instance given by ASCII name.
-
- @param _rxContext
- the component context to create services
-
- @param _rLoggerName
- the ASCII name of the logger to create.
- */
- EventLogger(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
- const sal_Char* _pAsciiLoggerName
- );
-
- ~EventLogger();
-
- public:
- /// determines whether an event with the given level would be logged
- bool isLoggable( const sal_Int32 _nLogLevel ) const;
-
- //----------------------------------------------------------------
- //- XLogger::log equivalents/wrappers
- //- string messages
-
- /// logs a given message, without any arguments, or source class/method names
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage );
- return false;
- }
-
- /** logs a given message, replacing a placeholder in the message with an argument
-
- The function takes, additionally to the log level and the message, an arbitrary
- argument. This argument is converted to a string using an overloaded function
- named convertLogArgToString
. Then, a placeholder "$1$"
- is searched in the message string, and replaced with the argument string.
- */
- template< typename ARGTYPE1 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- //----------------------------------------------------------------
- //- XLogger::log equivalents/wrappers
- //- ASCII messages
-
- /// logs a given message, without any arguments, or source class/method names
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ) );
- return false;
- }
-
- /** logs a given message, replacing a placeholder in the message with an argument
-
- The function takes, additionally to the log level and the message, an arbitrary
- argument. This argument is converted to a string using an overloaded function
- named convertLogArgToString
. Then, a placeholder "$1$"
- is searched in the message string, and replaced with the argument string.
- */
- template< typename ARGTYPE1 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- //----------------------------------------------------------------
- //- XLogger::logp equivalents/wrappers
- //- string messages
-
- /// logs a given message, without any arguments, or source class/method names
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage );
- return false;
- }
-
- /** logs a given message, replacing a placeholder in the message with an argument
-
- The function takes, additionally to the logp level and the message, an arbitrary
- argument. This argument is converted to a string using an overloaded function
- named convertLogArgToString
. Then, a placeholder "$1$"
- is searched in the message string, and replaced with the argument string.
- */
- template< typename ARGTYPE1 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, _rMessage,
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- //----------------------------------------------------------------
- //- XLogger::logp equivalents/wrappers
- //- ASCII messages
-
- /// logs a given ASCII message, without any arguments, or source class/method names
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ) );
- return false;
- }
-
- /** logs a given ASCII message, replacing a placeholder in the message with an argument
-
- The function takes, additionally to the logp level and the message, an arbitrary
- argument. This argument is converted to a string using an overloaded function
- named convertLogArgToString
. Then, a placeholder "$1$"
- is searched in the message string, and replaced with the argument string.
- */
- template< typename ARGTYPE1 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Char* _pAsciiMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, OUString::createFromAscii( _pAsciiMessage ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- protected:
- bool impl_log(
- const sal_Int32 _nLogLevel,
- const sal_Char* _pSourceClass,
- const sal_Char* _pSourceMethod,
- const OUString& _rMessage,
- const OptionalString& _rArgument1 = OptionalString(),
- const OptionalString& _rArgument2 = OptionalString(),
- const OptionalString& _rArgument3 = OptionalString(),
- const OptionalString& _rArgument4 = OptionalString(),
- const OptionalString& _rArgument5 = OptionalString(),
- const OptionalString& _rArgument6 = OptionalString()
- ) const;
- };
-
- //====================================================================
- //= ResourceBasedEventLogger
- //====================================================================
- struct ResourceBasedEventLogger_Data;
- /** extends the EventLogger class with functionality to load log messages from
- a resource bundle.
- */
- class COMPHELPER_DLLPUBLIC ResourceBasedEventLogger : public EventLogger
- {
- private:
- ::boost::shared_ptr< ResourceBasedEventLogger_Data > m_pData;
-
- public:
- /** creates a resource based event logger
- @param _rxContext
- the component context for creating new components
- @param _pResourceBundleBaseName
- the ASCII base name of the resource bundle to use. Will be used
- in conjunction with XResourceBundleLoader::loadResource.
- @param _pAsciiLoggerName
- the ASCII name of the logger to work with. If NULL, the office-wide
- default logger will be used.
-
- */
- ResourceBasedEventLogger(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
- const sal_Char* _pResourceBundleBaseName,
- const sal_Char* _pAsciiLoggerName = NULL
- );
-
- //----------------------------------------------------------------
- //- XLogger::log equivalents/wrappers
- //- resource IDs
-
- /// logs a given message, without any arguments, or source class/method names
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ) );
- return false;
- }
-
- /** logs a given message, replacing a placeholder in the message with an argument
-
- The function takes, additionally to the log level and the message, an arbitrary
- argument. This argument is converted to a string using an overloaded function
- named convertLogArgToString
. Then, a placeholder "$1$"
- is searched in the message string, and replaced with the argument string.
- */
- template< typename ARGTYPE1 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- //----------------------------------------------------------------
- //- XLogger::logp equivalents/wrappers
- //- resource IDs
-
- /// logs a given ASCII message, without any arguments, or source class/method names
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ) );
- return false;
- }
-
- /** logs a given ASCII message, replacing a placeholder in the message with an argument
- */
- template< typename ARGTYPE1 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 2 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 3 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 4 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 5 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ) );
- return false;
- }
-
- /// logs a given ASCII message, replacing 6 placeholders in the message with respective values
- template< typename ARGTYPE1, typename ARGTYPE2, typename ARGTYPE3, typename ARGTYPE4, typename ARGTYPE5, typename ARGTYPE6 >
- bool logp( const sal_Int32 _nLogLevel, const sal_Char* _pSourceClass, const sal_Char* _pSourceMethod, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const
- {
- if ( isLoggable( _nLogLevel ) )
- return impl_log( _nLogLevel, _pSourceClass, _pSourceMethod, impl_loadStringMessage_nothrow( _nMessageResID ),
- OptionalString( log::convert::convertLogArgToString( _argument1 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument2 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument3 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument4 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument5 ) ),
- OptionalString( log::convert::convertLogArgToString( _argument6 ) ) );
- return false;
- }
-
- private:
- OUString impl_loadStringMessage_nothrow( const sal_Int32 _nMessageResID ) const;
- };
-
-//........................................................................
-} // namespace comphelper
-//........................................................................
-
-#endif // COMPHELPER_LOGGING_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/inc/comphelper/make_shared_from_uno.hxx b/comphelper/inc/comphelper/make_shared_from_uno.hxx
deleted file mode 100644
index 2a70094a3f94..000000000000
--- a/comphelper/inc/comphelper/make_shared_from_uno.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- 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 .
- */
-#ifndef INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX
-#define INCLUDED_COMPHELPER_MAKE_SHARED_FROM_UNO_HXX
-
-#include "boost/shared_ptr.hpp"
-#include
- boost::shared_ptr
-
- @attention The shared_ptr operates on a separate reference counter, so
- weak pointers (boost::weak_ptr) are invalidated when the last
- shared_ptr is destroyed, although the UNO object may still be
- alive.
-
- @param p object pointer
- @return shared_ptr to object
-*/
-template
- template
-
- which make a sequence out of the passed elements.
-
- The maximum number of elements can be set by defining
- COMPHELPER_MAKESEQUENCE_MAX_ARGS; its default is 12.
-*/
-#define COMPHELPER_MAKESEQUENCE_make(z_, n_, unused_) \
-template