1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _XMLENCRYPTIONTEMPLATEIMPL_HXX_ 29 #define _XMLENCRYPTIONTEMPLATEIMPL_HXX_ 30 31 #include <sal/config.h> 32 #include <rtl/ustring.hxx> 33 #include <cppuhelper/factory.hxx> 34 #include <cppuhelper/implbase3.hxx> 35 #include <com/sun/star/uno/Exception.hpp> 36 37 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ 38 #include <com/sun/star/uno/Reference.hxx> 39 #endif 40 #include <com/sun/star/lang/XSingleServiceFactory.hpp> 41 42 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_ 43 #include <com/sun/star/lang/XServiceInfo.hpp> 44 #endif 45 #include <com/sun/star/lang/XInitialization.hpp> 46 #include <com/sun/star/lang/XUnoTunnel.hpp> 47 #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp> 48 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> 49 50 class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3< 51 ::com::sun::star::xml::crypto::XXMLEncryptionTemplate , 52 ::com::sun::star::lang::XInitialization , 53 ::com::sun::star::lang::XServiceInfo > 54 { 55 private : 56 ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ; 57 ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTarget ; 58 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; 59 ::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus; 60 61 public : 62 XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; 63 virtual ~XMLEncryptionTemplateImpl() ; 64 65 //Methods from XXMLEncryptionTemplate 66 virtual void SAL_CALL setTemplate( 67 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement 68 ) 69 throw (com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException); 70 71 virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTemplate( 72 ) throw (com::sun::star::uno::RuntimeException); 73 74 virtual void SAL_CALL setTarget( 75 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper >& aXmlElement 76 ) throw( com::sun::star::lang::IllegalArgumentException); 77 78 virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTarget( 79 ) throw (com::sun::star::uno::RuntimeException) ; 80 81 virtual void SAL_CALL setStatus( 82 ::com::sun::star::xml::crypto::SecurityOperationStatus status ) 83 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 84 virtual ::com::sun::star::xml::crypto::SecurityOperationStatus 85 SAL_CALL getStatus( ) 86 throw (::com::sun::star::uno::RuntimeException); 87 88 //Methods from XInitialization 89 virtual void SAL_CALL initialize( 90 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments 91 ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ; 92 93 //Methods from XServiceInfo 94 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; 95 96 virtual sal_Bool SAL_CALL supportsService( 97 const ::rtl::OUString& ServiceName 98 ) throw( ::com::sun::star::uno::RuntimeException ) ; 99 100 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ; 101 102 //Helper for XServiceInfo 103 static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ; 104 105 static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ; 106 107 //Helper for registry 108 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ; 109 110 static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ; 111 } ; 112 113 #endif // _XMLENCRYPTIONTEMPLATE_XMLSECIMPL_HXX_ 114