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 INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX
25 #define INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX
26 
27 #include <boost/shared_ptr.hpp>
28 
29 namespace com { namespace sun { namespace star { namespace awt
30 {
31     struct MouseEvent;
32 } } } }
33 
34 
35 /* Definition of MouseEventHandler interface */
36 
37 namespace slideshow
38 {
39     namespace internal
40     {
41 
42         /** Interface for handling mouse events.
43 
44         	Classes implementing this interface can be added to an
45         	EventMultiplexer object, and are called from there to
46         	handle mouse events.
47          */
48         class MouseEventHandler
49         {
50         public:
~MouseEventHandler()51             virtual ~MouseEventHandler() {}
52 
53             /** Handle a mouse button pressed event.
54 
55             	@param e
56                 The mouse event that occurred. The x,y coordinates of
57                 the event are already transformed back to user
58                 coordinate space, taking the inverse transform of the
59                 view in which the event occurred.
60 
61             	@return true, if this handler has successfully
62             	processed the mouse event. When this method returns
63             	false, possibly other, less prioritized handlers can be
64             	called, too.
65              */
66             virtual bool handleMousePressed( const ::com::sun::star::awt::MouseEvent& e ) = 0;
67 
68             /** Handle a mouse button released event.
69 
70             	@param e
71                 The mouse event that occurred. The x,y coordinates of
72                 the event are already transformed back to user
73                 coordinate space, taking the inverse transform of the
74                 view in which the event occurred.
75 
76             	@return true, if this handler has successfully
77             	processed the pause event. When this method returns
78             	false, possibly other, less prioritized handlers are
79             	called, too.
80              */
81             virtual bool handleMouseReleased( const ::com::sun::star::awt::MouseEvent& e ) = 0;
82 
83             /** Handle a mouse entered the view event.
84 
85             	@param e
86                 The mouse event that occurred. The x,y coordinates of
87                 the event are already transformed back to user
88                 coordinate space, taking the inverse transform of the
89                 view in which the event occurred.
90 
91             	@return true, if this handler has successfully
92             	processed the pause event. When this method returns
93             	false, possibly other, less prioritized handlers are
94             	called, too.
95              */
96             virtual bool handleMouseEntered( const ::com::sun::star::awt::MouseEvent& e ) = 0;
97 
98             /** Handle a mouse exited the view event.
99 
100             	@param e
101                 The mouse event that occurred. The x,y coordinates of
102                 the event are already transformed back to user
103                 coordinate space, taking the inverse transform of the
104                 view in which the event occurred.
105 
106             	@return true, if this handler has successfully
107             	processed the pause event. When this method returns
108             	false, possibly other, less prioritized handlers are
109             	called, too.
110              */
111             virtual bool handleMouseExited( const ::com::sun::star::awt::MouseEvent& e ) = 0;
112 
113             /** Handle a mouse was moved with a pressed button event.
114 
115             	@param e
116                 The mouse event that occurred. The x,y coordinates of
117                 the event are already transformed back to user
118                 coordinate space, taking the inverse transform of the
119                 view in which the event occurred.
120 
121             	@return true, if this handler has successfully
122             	processed the pause event. When this method returns
123             	false, possibly other, less prioritized handlers are
124             	called, too.
125              */
126             virtual bool handleMouseDragged( const ::com::sun::star::awt::MouseEvent& e ) = 0;
127 
128             /** Handle a mouse was moved event.
129 
130             	@param e
131                 The mouse event that occurred. The x,y coordinates of
132                 the event are already transformed back to user
133                 coordinate space, taking the inverse transform of the
134                 view in which the event occurred.
135 
136             	@return true, if this handler has successfully
137             	processed the pause event. When this method returns
138             	false, possibly other, less prioritized handlers are
139             	called, too.
140              */
141             virtual bool handleMouseMoved( const ::com::sun::star::awt::MouseEvent& e ) = 0;
142         };
143 
144         typedef ::boost::shared_ptr< MouseEventHandler > MouseEventHandlerSharedPtr;
145 
146     }
147 }
148 
149 #endif /* INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX */
150