1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #include <tools/link.hxx>
29 #include <rtl/ustring.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <cppuhelper/implbase3.hxx>
34 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
35 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
36 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
50 // MT: Not needed any more, remove later...
52 class ImplXMLSignatureListener
: public cppu::WeakImplHelper3
54 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
,
55 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
,
56 com::sun::star::xml::sax::XDocumentHandler
60 Link maCreationResultListenerListener
;
61 Link maVerifyResultListenerListener
;
62 Link maStartVerifySignatureElementListener
;
64 com::sun::star::uno::Reference
<
65 com::sun::star::xml::sax::XDocumentHandler
> m_xNextHandler
;
68 ImplXMLSignatureListener( const Link
& rCreationResultListenerListener
, const Link rVerifyResultListenerListener
, const Link rStartVerifySignatureElement
);
69 ~ImplXMLSignatureListener();
71 void setNextHandler(com::sun::star::uno::Reference
<
72 com::sun::star::xml::sax::XDocumentHandler
> xNextHandler
);
74 // com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
75 virtual void SAL_CALL
signatureCreated( sal_Int32 securityId
, com::sun::star::xml::crypto::SecurityOperationStatus creationResult
)
76 throw (com::sun::star::uno::RuntimeException
);
78 // com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
79 virtual void SAL_CALL
signatureVerified( sal_Int32 securityId
, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult
)
80 throw (com::sun::star::uno::RuntimeException
);
82 // com::sun::star::xml::sax::XDocumentHandler
83 virtual void SAL_CALL
startElement( const rtl::OUString
& aName
, const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttribs
)
84 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
86 virtual void SAL_CALL
startDocument( )
87 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
endDocument( )
90 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
92 virtual void SAL_CALL
endElement( const rtl::OUString
& aName
)
93 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
characters( const rtl::OUString
& aChars
)
96 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
98 virtual void SAL_CALL
ignorableWhitespace( const rtl::OUString
& aWhitespaces
)
99 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
processingInstruction( const rtl::OUString
& aTarget
, const rtl::OUString
& aData
)
102 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
setDocumentLocator( const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XLocator
>& xLocator
)
105 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
109 // ---------------------------------------------------------------------------------
111 // ---------------------------------------------------------------------------------
113 class UriBindingHelper
: public cppu::WeakImplHelper1
115 com::sun::star::xml::crypto::XUriBinding
119 com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
> mxStorage
;
124 UriBindingHelper( const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& rxStorage
);
126 void SAL_CALL
setUriBinding( const rtl::OUString
& uri
, const com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>& aInputStream
)
127 throw (com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
129 com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
getUriBinding( const rtl::OUString
& uri
)
130 throw (com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
132 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 rtl::OUString
& rURI
);