xref: /trunk/main/unoxml/source/events/mouseevent.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_MOUSEEVENT_HXX
25 #define EVENT_MOUSEEVENT_HXX
26 
27 #include <com/sun/star/xml/dom/events/PhaseType.hpp>
28 #include <com/sun/star/xml/dom/events/XMouseEvent.hpp>
29 
30 #include <cppuhelper/implbase1.hxx>
31 
32 #include "uievent.hxx"
33 
34 
35 using ::rtl::OUString;
36 
37 namespace DOM { namespace events {
38 
39 typedef ::cppu::ImplInheritanceHelper1< CUIEvent, XMouseEvent >
40     CMouseEvent_Base;
41 
42 class CMouseEvent
43     : public CMouseEvent_Base
44 {
45 protected:
46     sal_Int32 m_screenX;
47     sal_Int32 m_screenY;
48     sal_Int32 m_clientX;
49     sal_Int32 m_clientY;
50     sal_Bool m_ctrlKey;
51     sal_Bool m_shiftKey;
52     sal_Bool m_altKey;
53     sal_Bool m_metaKey;
54     sal_Int16 m_button;
55     Reference< XEventTarget > m_relatedTarget;
56 
57 public:
58     explicit CMouseEvent();
59 
60     virtual sal_Int32 SAL_CALL getScreenX() throw (RuntimeException);
61     virtual sal_Int32 SAL_CALL getScreenY() throw (RuntimeException);
62     virtual sal_Int32 SAL_CALL getClientX() throw (RuntimeException);
63     virtual sal_Int32 SAL_CALL getClientY() throw (RuntimeException);
64     virtual sal_Bool SAL_CALL getCtrlKey() throw (RuntimeException);
65     virtual sal_Bool SAL_CALL getShiftKey() throw (RuntimeException);
66     virtual sal_Bool SAL_CALL getAltKey() throw (RuntimeException);
67     virtual sal_Bool SAL_CALL getMetaKey() throw (RuntimeException);
68     virtual sal_Int16 SAL_CALL getButton() throw (RuntimeException);
69     virtual Reference< XEventTarget > SAL_CALL getRelatedTarget()  throw(RuntimeException);
70 
71     virtual void SAL_CALL initMouseEvent(
72                         const OUString& typeArg,
73                         sal_Bool canBubbleArg,
74                         sal_Bool cancelableArg,
75                         const Reference< XAbstractView >& viewArg,
76                         sal_Int32 detailArg,
77                         sal_Int32 screenXArg,
78                         sal_Int32 screenYArg,
79                         sal_Int32 clientXArg,
80                         sal_Int32 clientYArg,
81                         sal_Bool ctrlKeyArg,
82                         sal_Bool altKeyArg,
83                         sal_Bool shiftKeyArg,
84                         sal_Bool metaKeyArg,
85                         sal_Int16 buttonArg,
86                         const Reference< XEventTarget >& relatedTargetArg)
87         throw(RuntimeException);
88 
89     // delegate to CUIevent
90     virtual Reference< XAbstractView > SAL_CALL getView() throw (RuntimeException);
91     virtual sal_Int32 SAL_CALL getDetail() throw (RuntimeException);
92     virtual void SAL_CALL initUIEvent(const OUString& typeArg,
93                      sal_Bool canBubbleArg,
94                      sal_Bool cancelableArg,
95                      const Reference< XAbstractView >& viewArg,
96                      sal_Int32 detailArg) throw (RuntimeException);
97     virtual OUString SAL_CALL getType() throw (RuntimeException);
98     virtual Reference< XEventTarget > SAL_CALL getTarget() throw (RuntimeException);
99     virtual Reference< XEventTarget > SAL_CALL getCurrentTarget() throw (RuntimeException);
100     virtual PhaseType SAL_CALL getEventPhase() throw (RuntimeException);
101     virtual sal_Bool SAL_CALL getBubbles() throw (RuntimeException);
102     virtual sal_Bool SAL_CALL getCancelable() throw (RuntimeException);
103     virtual com::sun::star::util::Time SAL_CALL getTimeStamp() throw (RuntimeException);
104     virtual void SAL_CALL stopPropagation() throw (RuntimeException);
105     virtual void SAL_CALL preventDefault() throw (RuntimeException);
106     virtual void SAL_CALL initEvent(
107         const OUString& eventTypeArg,
108         sal_Bool canBubbleArg,
109         sal_Bool cancelableArg)
110         throw (RuntimeException);
111 };
112 }}
113 #endif
114