Line data Source code
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 <tools/link.hxx>
21 : #include <rtl/ustring.hxx>
22 :
23 : #include <cppuhelper/implbase1.hxx>
24 : #include <cppuhelper/implbase3.hxx>
25 :
26 : #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
27 : #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
28 : #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
29 :
30 : namespace com {
31 : namespace sun {
32 : namespace star {
33 : namespace io {
34 : class XInputStream; }
35 : namespace embed {
36 : class XStorage; }
37 : }}}
38 :
39 : // MT: Not needed any more, remove later...
40 :
41 : class ImplXMLSignatureListener : public cppu::WeakImplHelper3
42 : <
43 : com::sun::star::xml::crypto::sax::XSignatureCreationResultListener,
44 : com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener,
45 : com::sun::star::xml::sax::XDocumentHandler
46 : >
47 : {
48 : private:
49 : Link maCreationResultListenerListener;
50 : Link maVerifyResultListenerListener;
51 : Link maStartVerifySignatureElementListener;
52 :
53 : com::sun::star::uno::Reference<
54 : com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
55 :
56 : public:
57 : ImplXMLSignatureListener( const Link& rCreationResultListenerListener, const Link rVerifyResultListenerListener, const Link rStartVerifySignatureElement );
58 : virtual ~ImplXMLSignatureListener();
59 :
60 : void setNextHandler(com::sun::star::uno::Reference<
61 : com::sun::star::xml::sax::XDocumentHandler > xNextHandler);
62 :
63 : // com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
64 : virtual void SAL_CALL signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus creationResult )
65 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
66 :
67 : // com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
68 : virtual void SAL_CALL signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult )
69 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 :
71 : // com::sun::star::xml::sax::XDocumentHandler
72 : virtual void SAL_CALL startElement( const OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs )
73 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 :
75 : virtual void SAL_CALL startDocument( )
76 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 :
78 : virtual void SAL_CALL endDocument( )
79 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 :
81 : virtual void SAL_CALL endElement( const OUString& aName )
82 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 :
84 : virtual void SAL_CALL characters( const OUString& aChars )
85 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 :
87 : virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces )
88 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 :
90 : virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData )
91 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 :
93 : virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
94 : throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 : };
96 :
97 : // XUriBinding
98 :
99 0 : class UriBindingHelper : public cppu::WeakImplHelper1
100 : <
101 : com::sun::star::xml::crypto::XUriBinding
102 : >
103 : {
104 : private:
105 : com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorage;
106 :
107 : public:
108 : UriBindingHelper();
109 : UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage );
110 :
111 : void SAL_CALL setUriBinding( const OUString& uri, const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream )
112 : throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 :
114 : com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getUriBinding( const OUString& uri )
115 : throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 :
117 : static com::sun::star::uno::Reference < com::sun::star::io::XInputStream > OpenInputStream( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStore, const OUString& rURI );
118 : };
119 :
120 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|