Kaydet (Commit) c9e52cff authored tarafından Matúš Kukan's avatar Matúš Kukan

tk: Constructor feature for AsyncCallback.

Change-Id: I8be86768e3a9cbe11282e9caeb0f31141d2590e6
üst 08d10512
......@@ -28,19 +28,6 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/awt/XRequestCallback.hpp"
// component helper namespace
namespace comp_AsyncCallback {
// component and service helper functions:
OUString SAL_CALL _getImplementationName();
css::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames();
css::uno::Reference< css::uno::XInterface > SAL_CALL _create( css::uno::Reference< css::uno::XComponentContext > const & context );
} // closing component helper namespace
/// anonymous implementation namespace
namespace {
......@@ -50,7 +37,7 @@ class AsyncCallback:
css::awt::XRequestCallback>
{
public:
explicit AsyncCallback(css::uno::Reference< css::uno::XComponentContext > const & context);
AsyncCallback() {}
// ::com::sun::star::lang::XServiceInfo:
virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException);
......@@ -77,18 +64,12 @@ private:
void operator =(AsyncCallback &); // not defined
virtual ~AsyncCallback() {}
css::uno::Reference< css::uno::XComponentContext > m_xContext;
};
AsyncCallback::AsyncCallback(css::uno::Reference< css::uno::XComponentContext > const & context) :
m_xContext(context)
{}
// com.sun.star.uno.XServiceInfo:
OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::RuntimeException)
{
return comp_AsyncCallback::_getImplementationName();
return OUString("com.sun.star.awt.comp.AsyncCallback");
}
::sal_Bool SAL_CALL AsyncCallback::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
......@@ -98,7 +79,9 @@ OUString SAL_CALL AsyncCallback::getImplementationName() throw (css::uno::Runtim
css::uno::Sequence< OUString > SAL_CALL AsyncCallback::getSupportedServiceNames() throw (css::uno::RuntimeException)
{
return comp_AsyncCallback::_getSupportedServiceNames();
css::uno::Sequence< OUString > s(1);
s[0] = "com.sun.star.awt.AsyncCallback";
return s;
}
// ::com::sun::star::awt::XRequestCallback:
......@@ -133,45 +116,12 @@ IMPL_STATIC_LINK_NOINSTANCE( AsyncCallback, Notify_Impl, CallbackData*, pCallbac
} // closing anonymous implementation namespace
// component helper namespace
namespace comp_AsyncCallback {
OUString SAL_CALL _getImplementationName() {
return OUString("com.sun.star.awt.comp.AsyncCallback");
}
css::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames()
{
css::uno::Sequence< OUString > s(1);
s[0] = "com.sun.star.awt.AsyncCallback";
return s;
}
css::uno::Reference< css::uno::XInterface > SAL_CALL _create(
const css::uno::Reference< css::uno::XComponentContext > & context)
SAL_THROW((css::uno::Exception))
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_awt_comp_AsyncCallback_get_implementation(
css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
return static_cast< ::cppu::OWeakObject * >(new AsyncCallback(context));
return cppu::acquire(new AsyncCallback());
}
} // closing component helper namespace
static ::cppu::ImplementationEntry const entries[] = {
{ &comp_AsyncCallback::_create,
&comp_AsyncCallback::_getImplementationName,
&comp_AsyncCallback::_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
void * SAL_CALL comp_AsyncCallback_component_getFactory(
const char * implName, void * serviceManager, void * registryKey)
{
return ::cppu::component_getFactoryHelper(
implName, serviceManager, registryKey, entries);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -181,12 +181,10 @@ extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
extern "C"
{
TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* )
{
void* pRet = NULL;
......@@ -267,9 +265,6 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImple
GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL );
GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL );
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
}
return pRet;
}
......
......@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="tk" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.awt.comp.AsyncCallback">
<implementation name="com.sun.star.awt.comp.AsyncCallback"
constructor="com_sun_star_awt_comp_AsyncCallback_get_implementation">
<service name="com.sun.star.awt.AsyncCallback"/>
</implementation>
<implementation name="com.sun.star.comp.awt.Layout">
......
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