1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
21 #include <rtl/ustring.hxx>
22 #include <framework/xmlsignaturetemplateimpl.hxx>
23 #include <comphelper/sequence.hxx>
24 #include <cppuhelper/supportsservice.hxx>
26 using namespace ::com::sun::star::uno
;
27 using ::com::sun::star::lang::XMultiServiceFactory
;
29 using ::com::sun::star::xml::wrapper::XXMLElementWrapper
;
30 using ::com::sun::star::xml::crypto::XXMLSignatureTemplate
;
32 XMLSignatureTemplateImpl::XMLSignatureTemplateImpl()
33 :m_nStatus ( css::xml::crypto::SecurityOperationStatus_UNKNOWN
)
37 XMLSignatureTemplateImpl::~XMLSignatureTemplateImpl() {
40 /* XXMLSignatureTemplate */
41 void SAL_CALL
XMLSignatureTemplateImpl::setTemplate( const Reference
< XXMLElementWrapper
>& aTemplate
)
43 m_xTemplate
= aTemplate
;
46 /* XXMLSignatureTemplate */
47 Reference
< XXMLElementWrapper
> SAL_CALL
XMLSignatureTemplateImpl::getTemplate()
52 void SAL_CALL
XMLSignatureTemplateImpl::setTarget( const css::uno::Reference
< css::xml::wrapper::XXMLElementWrapper
>& aXmlElement
)
54 targets
.push_back( aXmlElement
);
57 css::uno::Sequence
< css::uno::Reference
< css::xml::wrapper::XXMLElementWrapper
> > SAL_CALL
XMLSignatureTemplateImpl::getTargets()
59 return comphelper::containerToSequence(targets
);
62 void SAL_CALL
XMLSignatureTemplateImpl::setBinding(
63 const css::uno::Reference
< css::xml::crypto::XUriBinding
>& aUriBinding
)
65 m_xUriBinding
= aUriBinding
;
68 css::uno::Reference
< css::xml::crypto::XUriBinding
> SAL_CALL
XMLSignatureTemplateImpl::getBinding()
73 void SAL_CALL
XMLSignatureTemplateImpl::setStatus(
74 css::xml::crypto::SecurityOperationStatus status
)
79 css::xml::crypto::SecurityOperationStatus SAL_CALL
XMLSignatureTemplateImpl::getStatus( )
85 OUString SAL_CALL
XMLSignatureTemplateImpl::getImplementationName() {
86 return impl_getImplementationName() ;
90 sal_Bool SAL_CALL
XMLSignatureTemplateImpl::supportsService( const OUString
& serviceName
) {
91 return cppu::supportsService(this, serviceName
);
95 Sequence
< OUString
> SAL_CALL
XMLSignatureTemplateImpl::getSupportedServiceNames() {
96 return impl_getSupportedServiceNames() ;
99 //Helper for XServiceInfo
100 Sequence
< OUString
> XMLSignatureTemplateImpl::impl_getSupportedServiceNames() {
101 Sequence
<OUString
> seqServiceNames
{ u
"com.sun.star.xml.crypto.XMLSignatureTemplate"_ustr
};
102 return seqServiceNames
;
105 OUString
XMLSignatureTemplateImpl::impl_getImplementationName() {
106 return u
"com.sun.star.xml.security.framework.XMLSignatureTemplateImpl"_ustr
;
109 //Helper for registry
110 Reference
< XInterface
> XMLSignatureTemplateImpl::impl_createInstance( const Reference
< XMultiServiceFactory
>& ) {
111 return Reference
< XInterface
>( *new XMLSignatureTemplateImpl
) ;
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */