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