bump product version to 4.1.6.2
[LibreOffice.git] / unoxml / source / events / testlistener.hxx
blob5d5b1e4f4fe57da7a425e241736912b6138c6c77
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #ifndef EVENT_TESTLISTENER_HXX
21 #define EVENT_TESTLISTENER_HXX
23 #include <sal/types.h>
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/uno/Sequence.h>
28 #include <com/sun/star/uno/XInterface.hpp>
29 #include <com/sun/star/uno/Exception.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/lang/XInitialization.hpp>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/xml/dom/events/XEventTarget.hpp>
34 #include <com/sun/star/xml/dom/events/XEventListener.hpp>
35 #include <com/sun/star/xml/dom/events/XEvent.hpp>
37 #include <cppuhelper/implbase3.hxx>
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::xml::dom;
42 using namespace com::sun::star::xml::dom::events;
44 namespace DOM { namespace events
47 typedef ::cppu::WeakImplHelper3
48 < ::com::sun::star::xml::dom::events::XEventListener
49 , ::com::sun::star::lang::XInitialization
50 , ::com::sun::star::lang::XServiceInfo
51 > CTestListener_Base;
53 class CTestListener
54 : public CTestListener_Base
57 private:
58 Reference< ::com::sun::star::lang::XMultiServiceFactory > m_factory;
59 Reference <XEventTarget> m_target;
60 OUString m_type;
61 sal_Bool m_capture;
62 OUString m_name;
64 public:
66 // static helpers for service info and component management
67 static const char* aImplementationName;
68 static const char* aSupportedServiceNames[];
69 static OUString _getImplementationName();
70 static Sequence< OUString > _getSupportedServiceNames();
71 static Reference< XInterface > _getInstance(
72 const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
73 rSMgr);
75 CTestListener(
76 const Reference< ::com::sun::star::lang::XMultiServiceFactory >&
77 rSMgr)
78 : m_factory(rSMgr){};
80 virtual ~CTestListener();
82 // XServiceInfo
83 virtual OUString SAL_CALL getImplementationName()
84 throw (RuntimeException);
85 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName)
86 throw (RuntimeException);
87 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames ()
88 throw (RuntimeException);
91 // XEventListener
92 virtual void SAL_CALL initialize(const Sequence< Any >& args) throw (RuntimeException);
94 virtual void SAL_CALL handleEvent(const Reference< XEvent >& evt) throw (RuntimeException);
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */