2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-16 17:32:30 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2004-07-12 12:15:31 +00:00
|
|
|
|
|
|
|
#include <sal/config.h>
|
|
|
|
#include <rtl/ustring.hxx>
|
2017-10-23 22:27:10 +02:00
|
|
|
#include <framework/xmlsignaturetemplateimpl.hxx>
|
2019-05-09 15:17:26 +03:00
|
|
|
#include <comphelper/sequence.hxx>
|
2020-01-27 11:01:25 +03:00
|
|
|
#include <cppuhelper/supportsservice.hxx>
|
2004-07-12 12:15:31 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star::uno ;
|
|
|
|
using ::com::sun::star::lang::XMultiServiceFactory ;
|
|
|
|
|
|
|
|
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
|
|
|
|
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
|
|
|
|
|
2015-12-21 10:27:05 +02:00
|
|
|
XMLSignatureTemplateImpl::XMLSignatureTemplateImpl()
|
2018-09-12 17:01:48 +02:00
|
|
|
:m_nStatus ( css::xml::crypto::SecurityOperationStatus_UNKNOWN )
|
2004-11-26 13:55:17 +00:00
|
|
|
{
|
2004-07-12 12:15:31 +00:00
|
|
|
}
|
|
|
|
|
2015-10-26 09:11:28 +02:00
|
|
|
XMLSignatureTemplateImpl::~XMLSignatureTemplateImpl() {
|
2004-07-12 12:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* XXMLSignatureTemplate */
|
2015-10-26 09:11:28 +02:00
|
|
|
void SAL_CALL XMLSignatureTemplateImpl::setTemplate( const Reference< XXMLElementWrapper >& aTemplate )
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
m_xTemplate = aTemplate ;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXMLSignatureTemplate */
|
2015-10-26 09:11:28 +02:00
|
|
|
Reference< XXMLElementWrapper > SAL_CALL XMLSignatureTemplateImpl::getTemplate()
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
return m_xTemplate ;
|
|
|
|
}
|
|
|
|
|
2015-11-26 09:49:00 +02:00
|
|
|
void SAL_CALL XMLSignatureTemplateImpl::setTarget( const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& aXmlElement )
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
targets.push_back( aXmlElement );
|
|
|
|
}
|
|
|
|
|
2015-11-26 09:49:00 +02:00
|
|
|
css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > SAL_CALL XMLSignatureTemplateImpl::getTargets()
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
sal_Int32 length = targets.size();
|
2015-11-26 09:49:00 +02:00
|
|
|
css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > aTargets (length);
|
2004-07-12 12:15:31 +00:00
|
|
|
|
|
|
|
sal_Int32 i;
|
|
|
|
|
|
|
|
for (i=0; i<length; i++)
|
|
|
|
{
|
|
|
|
aTargets[i] = targets[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return aTargets;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL XMLSignatureTemplateImpl::setBinding(
|
2015-11-26 09:49:00 +02:00
|
|
|
const css::uno::Reference< css::xml::crypto::XUriBinding >& aUriBinding )
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
m_xUriBinding = aUriBinding;
|
|
|
|
}
|
|
|
|
|
2015-11-26 09:49:00 +02:00
|
|
|
css::uno::Reference< css::xml::crypto::XUriBinding > SAL_CALL XMLSignatureTemplateImpl::getBinding()
|
2004-07-12 12:15:31 +00:00
|
|
|
{
|
|
|
|
return m_xUriBinding;
|
|
|
|
}
|
|
|
|
|
2004-11-26 13:55:17 +00:00
|
|
|
void SAL_CALL XMLSignatureTemplateImpl::setStatus(
|
2015-11-26 09:49:00 +02:00
|
|
|
css::xml::crypto::SecurityOperationStatus status )
|
2004-11-26 13:55:17 +00:00
|
|
|
{
|
|
|
|
m_nStatus = status;
|
|
|
|
}
|
|
|
|
|
2015-11-26 09:49:00 +02:00
|
|
|
css::xml::crypto::SecurityOperationStatus SAL_CALL XMLSignatureTemplateImpl::getStatus( )
|
2004-11-26 13:55:17 +00:00
|
|
|
{
|
|
|
|
return m_nStatus;
|
|
|
|
}
|
|
|
|
|
2004-07-12 12:15:31 +00:00
|
|
|
/* XServiceInfo */
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL XMLSignatureTemplateImpl::getImplementationName() {
|
2004-07-12 12:15:31 +00:00
|
|
|
return impl_getImplementationName() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XServiceInfo */
|
2017-01-26 12:28:58 +01:00
|
|
|
sal_Bool SAL_CALL XMLSignatureTemplateImpl::supportsService( const OUString& serviceName) {
|
2020-01-27 11:01:25 +03:00
|
|
|
return cppu::supportsService(this, serviceName);
|
2004-07-12 12:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* XServiceInfo */
|
2017-01-26 12:28:58 +01:00
|
|
|
Sequence< OUString > SAL_CALL XMLSignatureTemplateImpl::getSupportedServiceNames() {
|
2004-07-12 12:15:31 +00:00
|
|
|
return impl_getSupportedServiceNames() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Helper for XServiceInfo
|
2015-10-26 09:11:28 +02:00
|
|
|
Sequence< OUString > XMLSignatureTemplateImpl::impl_getSupportedServiceNames() {
|
2015-11-15 13:17:00 +02:00
|
|
|
Sequence<OUString> seqServiceNames { "com.sun.star.xml.crypto.XMLSignatureTemplate" };
|
2004-07-12 12:15:31 +00:00
|
|
|
return seqServiceNames ;
|
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString XMLSignatureTemplateImpl::impl_getImplementationName() {
|
2019-07-30 17:43:11 +02:00
|
|
|
return "com.sun.star.xml.security.framework.XMLSignatureTemplateImpl" ;
|
2004-07-12 12:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Helper for registry
|
No need to keep these whitelisted functions decorated with SAL_CALL
The only effect SAL_CALL effectively has on LO-internal code is to change non-
static member functions from __thiscall to __cdecl in MSVC (where all other
functions are __cdecl by default, anyway). (For 3rd-party code, it could be
argued that SAL_CALL is useful on function declarations in the URE stable
interface other than non-static member functions, too, in case 3rd-party code
uses a compiler switch to change the default calling convention to something
other than __cdecl. But loplugin:salcall exempts the URE stable interface,
anyway.)
One could argue that SAL_CALL, even if today it effectively only affects non-
static member functions in MSVC, could be extended in the future to affect more
functions on more platforms. However, the current code would already not
support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c
"loplugin:salcall fix functions" changed FrameControl_createInstance in
UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even
though its address (in ctl_component_getFacrory, in the same file) is passed to
cppuhelper::createSingleFactory as an argument of type
cppu::ComponentInstantiation, which is a pointer to SAL_CALL function.
Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6
Reviewed-on: https://gerrit.libreoffice.org/46436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14 08:45:02 +01:00
|
|
|
Reference< XInterface > XMLSignatureTemplateImpl::impl_createInstance( const Reference< XMultiServiceFactory >& ) {
|
2015-12-21 10:27:05 +02:00
|
|
|
return Reference< XInterface >( *new XMLSignatureTemplateImpl ) ;
|
2004-07-12 12:15:31 +00:00
|
|
|
}
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|