xref: /aoo41x/main/unoxml/source/events/uievent.hxx (revision 7f654276)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef EVENT_UIEVENT_HXX
25 #define EVENT_UIEVENT_HXX
26 
27 #include <sal/types.h>
28 
29 #include <com/sun/star/xml/dom/events/PhaseType.hpp>
30 #include <com/sun/star/xml/dom/events/XUIEvent.hpp>
31 #include <com/sun/star/xml/dom/views/XAbstractView.hpp>
32 
33 #include <cppuhelper/implbase1.hxx>
34 
35 #include "event.hxx"
36 
37 
38 using ::rtl::OUString;
39 using namespace com::sun::star::xml::dom::views;
40 
41 namespace DOM { namespace events {
42 
43 typedef ::cppu::ImplInheritanceHelper1< CEvent, XUIEvent > CUIEvent_Base;
44 
45 class CUIEvent
46     : public CUIEvent_Base
47 {
48 protected:
49     sal_Int32 m_detail;
50     Reference< XAbstractView > m_view;
51 
52 public:
53     explicit CUIEvent();
54 
55     virtual Reference< XAbstractView > SAL_CALL getView() throw(RuntimeException);
56     virtual sal_Int32 SAL_CALL getDetail() throw(RuntimeException);
57     virtual void SAL_CALL initUIEvent(const OUString& typeArg,
58                      sal_Bool canBubbleArg,
59                      sal_Bool cancelableArg,
60                      const Reference< XAbstractView >& viewArg,
61                      sal_Int32 detailArg) throw(RuntimeException);
62 
63     // delegate to CEvent, since we are inheriting from CEvent and XEvent
64     virtual OUString SAL_CALL getType() throw (RuntimeException);
65     virtual Reference< XEventTarget > SAL_CALL getTarget() throw (RuntimeException);
66     virtual Reference< XEventTarget > SAL_CALL getCurrentTarget() throw (RuntimeException);
67     virtual PhaseType SAL_CALL getEventPhase() throw (RuntimeException);
68     virtual sal_Bool SAL_CALL getBubbles() throw (RuntimeException);
69     virtual sal_Bool SAL_CALL getCancelable() throw (RuntimeException);
70     virtual com::sun::star::util::Time SAL_CALL getTimeStamp() throw (RuntimeException);
71     virtual void SAL_CALL stopPropagation() throw (RuntimeException);
72     virtual void SAL_CALL preventDefault() throw (RuntimeException);
73     virtual void SAL_CALL initEvent(
74         const OUString& eventTypeArg,
75         sal_Bool canBubbleArg,
76         sal_Bool cancelableArg)
77         throw (RuntimeException);
78 };
79 }}
80 #endif
81