xref: /trunk/main/unoxml/source/events/mouseevent.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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();
61     virtual sal_Int32 SAL_CALL getScreenY();
62     virtual sal_Int32 SAL_CALL getClientX();
63     virtual sal_Int32 SAL_CALL getClientY();
64     virtual sal_Bool SAL_CALL getCtrlKey();
65     virtual sal_Bool SAL_CALL getShiftKey();
66     virtual sal_Bool SAL_CALL getAltKey();
67     virtual sal_Bool SAL_CALL getMetaKey();
68     virtual sal_Int16 SAL_CALL getButton();
69     virtual Reference< XEventTarget > SAL_CALL getRelatedTarget();
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 
88     // delegate to CUIevent
89     virtual Reference< XAbstractView > SAL_CALL getView();
90     virtual sal_Int32 SAL_CALL getDetail();
91     virtual void SAL_CALL initUIEvent(const OUString& typeArg,
92                      sal_Bool canBubbleArg,
93                      sal_Bool cancelableArg,
94                      const Reference< XAbstractView >& viewArg,
95                      sal_Int32 detailArg);
96     virtual OUString SAL_CALL getType();
97     virtual Reference< XEventTarget > SAL_CALL getTarget();
98     virtual Reference< XEventTarget > SAL_CALL getCurrentTarget();
99     virtual PhaseType SAL_CALL getEventPhase();
100     virtual sal_Bool SAL_CALL getBubbles();
101     virtual sal_Bool SAL_CALL getCancelable();
102     virtual com::sun::star::util::Time SAL_CALL getTimeStamp();
103     virtual void SAL_CALL stopPropagation();
104     virtual void SAL_CALL preventDefault();
105     virtual void SAL_CALL initEvent(
106         const OUString& eventTypeArg,
107         sal_Bool canBubbleArg,
108         sal_Bool cancelableArg);
109 };
110 }}
111 #endif
112