| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the LibreOffice project. |
| 4 |
* |
| 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/. |
| 8 |
* |
| 9 |
* This file incorporates work covered by the following license notice: |
| 10 |
* |
| 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 . |
| 18 |
*/ |
| 19 |
|
| 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> |
| 25 |
|
| 26 |
using namespace ::com::sun::star::uno ; |
| 27 |
using ::com::sun::star::lang::XMultiServiceFactory ; |
| 28 |
|
| 29 |
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; |
| 30 |
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ; |
| 31 |
|
| 32 |
XMLSignatureTemplateImpl::XMLSignatureTemplateImpl() |
| 33 |
:m_nStatus ( css::xml::crypto::SecurityOperationStatus_UNKNOWN ) |
| 34 |
{ |
| 35 |
} |
| 36 |
|
| 37 |
XMLSignatureTemplateImpl::~XMLSignatureTemplateImpl() { |
| 38 |
} |
| 39 |
|
| 40 |
/* XXMLSignatureTemplate */ |
| 41 |
void SAL_CALL XMLSignatureTemplateImpl::setTemplate( const Reference< XXMLElementWrapper >& aTemplate ) |
| 42 |
{ |
| 43 |
m_xTemplate = aTemplate ; |
| 44 |
} |
| 45 |
|
| 46 |
/* XXMLSignatureTemplate */ |
| 47 |
Reference< XXMLElementWrapper > SAL_CALL XMLSignatureTemplateImpl::getTemplate() |
| 48 |
{ |
| 49 |
return m_xTemplate ; |
| 50 |
} |
| 51 |
|
| 52 |
void SAL_CALL XMLSignatureTemplateImpl::setTarget( const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& aXmlElement ) |
| 53 |
{ |
| 54 |
targets.push_back( aXmlElement ); |
| 55 |
} |
| 56 |
|
| 57 |
css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > SAL_CALL XMLSignatureTemplateImpl::getTargets() |
| 58 |
{ |
| 59 |
return comphelper::containerToSequence(targets); |
| 60 |
} |
| 61 |
|
| 62 |
void SAL_CALL XMLSignatureTemplateImpl::setBinding( |
| 63 |
const css::uno::Reference< css::xml::crypto::XUriBinding >& aUriBinding ) |
| 64 |
{ |
| 65 |
m_xUriBinding = aUriBinding; |
| 66 |
} |
| 67 |
|
| 68 |
css::uno::Reference< css::xml::crypto::XUriBinding > SAL_CALL XMLSignatureTemplateImpl::getBinding() |
| 69 |
{ |
| 70 |
return m_xUriBinding; |
| 71 |
} |
| 72 |
|
| 73 |
void SAL_CALL XMLSignatureTemplateImpl::setStatus( |
| 74 |
css::xml::crypto::SecurityOperationStatus status ) |
| 75 |
{ |
| 76 |
m_nStatus = status; |
| 77 |
} |
| 78 |
|
| 79 |
css::xml::crypto::SecurityOperationStatus SAL_CALL XMLSignatureTemplateImpl::getStatus( ) |
| 80 |
{ |
| 81 |
return m_nStatus; |
| 82 |
} |
| 83 |
|
| 84 |
/* XServiceInfo */ |
| 85 |
OUString SAL_CALL XMLSignatureTemplateImpl::getImplementationName() { |
| 86 |
return impl_getImplementationName() ; |
| 87 |
} |
| 88 |
|
| 89 |
/* XServiceInfo */ |
| 90 |
sal_Bool SAL_CALL XMLSignatureTemplateImpl::supportsService( const OUString& serviceName) { |
| 91 |
return cppu::supportsService(this, serviceName); |
| 92 |
} |
| 93 |
|
| 94 |
/* XServiceInfo */ |
| 95 |
Sequence< OUString > SAL_CALL XMLSignatureTemplateImpl::getSupportedServiceNames() { |
| 96 |
return impl_getSupportedServiceNames() ; |
| 97 |
} |
| 98 |
|
| 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 ; |
| 103 |
} |
| 104 |
|
| 105 |
OUString XMLSignatureTemplateImpl::impl_getImplementationName() { |
| 106 |
return u"com.sun.star.xml.security.framework.XMLSignatureTemplateImpl"_ustr ; |
| 107 |
} |
| 108 |
|
| 109 |
//Helper for registry |
| 110 |
Reference< XInterface > XMLSignatureTemplateImpl::impl_createInstance( const Reference< XMultiServiceFactory >& ) { |
| 111 |
return Reference< XInterface >( *new XMLSignatureTemplateImpl ) ; |
| 112 |
} |
| 113 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |