Kaydet (Commit) 25cedf1d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Introduce com.sun.star.beans.theIntrospection singleton

...deprecating com.sun.star.beans.Introspection (single-instance) service.

Change-Id: Ica2e3a3541c7dcb1aab79222c5abf40d6988c882
üst 3952988d
......@@ -47,7 +47,7 @@
#include <com/sun/star/beans/PropertyConcept.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/script/BasicErrorException.hpp>
#include <com/sun/star/script/InvocationAdapterFactory.hpp>
#include <com/sun/star/script/XAllListener.hpp>
......@@ -2455,7 +2455,7 @@ void SbUnoObject::doIntrospection( void )
{
// get the introspection service
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
xIntrospection = Introspection::create( xContext );
xIntrospection = theIntrospection::get( xContext );
}
// pass the introspection
......
......@@ -21,7 +21,7 @@
#include <osl/diagnose.h>
#include <comphelper/eventattachermgr.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/io/XObjectInputStream.hpp>
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/io/XObjectOutputStream.hpp>
......@@ -351,7 +351,7 @@ void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& )
Reference< XEventAttacherManager > createEventAttacherManager( const Reference< XComponentContext > & rxContext )
throw( Exception )
{
Reference< XIntrospection > xIntrospection = Introspection::create( rxContext );
Reference< XIntrospection > xIntrospection = theIntrospection::get( rxContext );
return new ImplEventAttacherManager( xIntrospection, rxContext );
}
......
......@@ -22,7 +22,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/script/XEventAttacher2.hpp>
#include <com/sun/star/script/Converter.hpp>
......@@ -389,7 +389,7 @@ Reference< XIntrospection > EventAttacherImpl::getIntrospection() throw( Excepti
Guard< Mutex > aGuard( m_aMutex );
if( !m_xIntrospection.is() )
{
m_xIntrospection = Introspection::create( m_xContext );
m_xIntrospection = theIntrospection::get( m_xContext );
}
return m_xIntrospection;
}
......
......@@ -32,7 +32,7 @@
#include <com/sun/star/awt/XTabControllerModel.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/XIntrospectionAccess.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/container/XChild.hpp>
......@@ -83,7 +83,7 @@ namespace pcr
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::TypeClass_STRING;
using ::com::sun::star::uno::Type;
using ::com::sun::star::beans::Introspection;
using ::com::sun::star::beans::theIntrospection;
using ::com::sun::star::beans::XPropertyChangeListener;
using ::com::sun::star::beans::Property;
using ::com::sun::star::beans::PropertyState;
......@@ -979,7 +979,7 @@ namespace pcr
// we use a set to avoid duplicates
TypeBag aListeners;
Reference< XIntrospection > xIntrospection = Introspection::create( m_xContext );
Reference< XIntrospection > xIntrospection = theIntrospection::get( m_xContext );
// --- model listeners
lcl_addListenerTypesFor_throw(
......
......@@ -23,7 +23,7 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/reflection/XEnumTypeDescription.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/inspection/PropertyControlType.hpp>
#include <com/sun/star/inspection/XHyperlinkControl.hpp>
#include <com/sun/star/awt/XActionListener.hpp>
......@@ -338,7 +338,7 @@ namespace pcr
m_xPropertyState.clear();
// create an introspection adapter for the component
Reference< XIntrospection > xIntrospection = Introspection::create( m_xContext );
Reference< XIntrospection > xIntrospection = theIntrospection::get( m_xContext );
Reference< XIntrospectionAccess > xIntrospectionAccess( xIntrospection->inspect( makeAny( _rxIntrospectee ) ) );
if ( !xIntrospectionAccess.is() )
......
......@@ -34,7 +34,7 @@
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/script/Converter.hpp>
#include <com/sun/star/script/InvocationAdapterFactory.hpp>
#include <com/sun/star/reflection/theCoreReflection.hpp>
......@@ -62,7 +62,7 @@ using com::sun::star::script::XInvocationAdapterFactory2;
using com::sun::star::script::XInvocation;
using com::sun::star::beans::XMaterialHolder;
using com::sun::star::beans::XIntrospection;
using com::sun::star::beans::Introspection;
using com::sun::star::beans::theIntrospection;
#include <vector>
......@@ -283,7 +283,7 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
c->xAdapterFactory = css::script::InvocationAdapterFactory::create(ctx);
c->xIntrospection = Introspection::create(ctx);
c->xIntrospection = theIntrospection::get(ctx);
Any a = ctx->getValueByName("/singletons/com.sun.star.reflection.theTypeDescriptionManager");
a >>= c->xTdMgr;
......
......@@ -32,7 +32,7 @@
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/beans/XIntrospectionAccess.hpp>
......@@ -273,7 +273,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
{
if ( !m_pImpl->m_xIntrospection.is() )
{
m_pImpl->m_xIntrospection = Introspection::create( m_pImpl->m_rModel.getController()->getORB() );
m_pImpl->m_xIntrospection = theIntrospection::get( m_pImpl->m_rModel.getController()->getORB() );
}
Reference< XIntrospectionAccess > xIntrospection(
m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ),
......
......@@ -30,7 +30,7 @@
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
#include <com/sun/star/beans/XIntrospectionAccess.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/XCellRange.hpp>
......@@ -762,7 +762,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
uno::Reference<beans::XIntrospection> xIntro = beans::Introspection::create( xContext );
uno::Reference<beans::XIntrospection> xIntro = beans::theIntrospection::get( xContext );
uno::Any aObject;
aObject <<= xAddIn;
uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
......@@ -1024,7 +1024,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
uno::Reference<beans::XIntrospection> xIntro = beans::Introspection::create(xContext);
uno::Reference<beans::XIntrospection> xIntro = beans::theIntrospection::get(xContext);
uno::Any aObject;
aObject <<= xInterface;
uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
......
......@@ -18,7 +18,7 @@
*/
#include <cppuhelper/bootstrap.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XFrame.hpp>
......@@ -74,7 +74,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
if( !xIntrospection.is() )
{
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
xIntrospection.set( beans::Introspection::create(xContext) );
xIntrospection.set( beans::theIntrospection::get(xContext) );
}
return xIntrospection->inspect( aObject );
}
......
......@@ -25,7 +25,7 @@
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
......@@ -566,7 +566,7 @@ static OUString aResourceResolverPropName("ResourceResolver");
if( !xIntrospection.is() )
{
// Get introspection service
xIntrospection = Introspection::create( m_xContext );
xIntrospection = theIntrospection::get( m_xContext );
}
// Do introspection
......
......@@ -26,7 +26,7 @@
#include <ooo/vba/XVBAToOOEventDescGen.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
......@@ -395,7 +395,7 @@ ScriptEventHelper::getEventListeners()
{
std::list< OUString > eventMethods;
Reference< beans::XIntrospection > xIntrospection = beans::Introspection::create( m_xCtx );
Reference< beans::XIntrospection > xIntrospection = beans::theIntrospection::get( m_xCtx );
Reference< beans::XIntrospectionAccess > xIntrospectionAccess =
xIntrospection->inspect( makeAny( m_xControl ) );
......
......@@ -21,5 +21,6 @@
prefix="introspection" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.stoc.Introspection">
<service name="com.sun.star.beans.Introspection"/>
<singleton name="com.sun.star.beans.theIntrospection"/>
</implementation>
</component>
......@@ -37,7 +37,7 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/beans/XExactName.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
......@@ -1100,7 +1100,7 @@ InvocationService::InvocationService( const Reference<XComponentContext> & xCtx
OUString("com.sun.star.script.Converter"),
xCtx ),
UNO_QUERY );
xIntrospection = Introspection::create(xCtx);
xIntrospection = theIntrospection::get(xCtx);
}
InvocationService::~InvocationService() {}
......
......@@ -50,7 +50,7 @@
#include <com/sun/star/awt/XCheckBox.hpp>
#include <com/sun/star/awt/XListBox.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
......@@ -375,8 +375,8 @@ namespace
Sequence< Type> aModelListeners;
Sequence< Type> aControlListeners;
Reference< XIntrospection> xModelIntrospection = Introspection::create(::comphelper::getProcessComponentContext());
Reference< XIntrospection> xControlIntrospection = Introspection::create(::comphelper::getProcessComponentContext());
Reference< XIntrospection> xModelIntrospection = theIntrospection::get(::comphelper::getProcessComponentContext());
Reference< XIntrospection> xControlIntrospection = theIntrospection::get(::comphelper::getProcessComponentContext());
if (xModel.is())
{
......
......@@ -80,6 +80,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,udkapi,com/sun/star/util,\
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,com/sun/star/beans,\
PropertyBag \
Introspection \
theIntrospection \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,udkapi,com/sun/star/bridge,\
BridgeFactory \
......
......@@ -25,14 +25,10 @@
module com { module sun { module star { module beans {
/** provides functionality to get information about an object's
properties and methods.
<p><strong>Important note:</strong>An object can only be
inspected completely if it supports the
com::sun::star::lang::XTypeProvider interface.</p>
/** A legacy (single-instance) service variant of theIntrospection singleton.
<p>For details see method XIntrospection::inspect() .</p>
*/
@deprecated Use theIntrospection instead.
*/
published service Introspection : com::sun::star::beans::XIntrospection;
......
/* -*- 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 INCLUDED_com_sun_star_beans_theIntrospection_idl
#define INCLUDED_com_sun_star_beans_theIntrospection_idl
module com { module sun { module star { module beans {
published interface XIntrospection;
/** provides functionality to get information about an object's
properties and methods.
<p><strong>Important note:</strong>An object can only be inspected
completely if it supports the com::sun::star::lang::XTypeProvider
interface.</p>
<p>For details, see method XIntrospection::inspect().</p>
@since LibreOffice 4.3
*/
published singleton theIntrospection: XIntrospection;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -24,6 +24,7 @@
#include <new>
#include "com/sun/star/beans/Introspection.hpp"
#include "com/sun/star/beans/theIntrospection.hpp"
#include "com/sun/star/bridge/BridgeFactory.hpp"
#include "com/sun/star/bridge/UnoUrlResolver.hpp"
#include "com/sun/star/connection/Acceptor.hpp"
......@@ -143,6 +144,7 @@ private:
}
}
css::beans::Introspection::create(context_);
css::beans::theIntrospection::get(context_);
css::bridge::BridgeFactory::create(context_);
css::bridge::UnoUrlResolver::create(context_);
css::connection::Acceptor::create(context_);
......
......@@ -31,7 +31,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/Introspection.hpp>
#include <com/sun/star/beans/theIntrospection.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XDialog.hpp>
......@@ -102,7 +102,7 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
if( !xIntrospection.is() )
{
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
xIntrospection.set( beans::Introspection::create( xContext ) );
xIntrospection.set( beans::theIntrospection::get( xContext ) );
}
return xIntrospection->inspect( aObject );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment