1 /*************************************************************************
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * Copyright 2000, 2010 Oracle and/or its affiliates.
5  *
6  * OpenOffice.org - a multi-platform office productivity suite
7  *
8  * This file is part of OpenOffice.org.
9  *
10  * OpenOffice.org is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 3
12  * only, as published by the Free Software Foundation.
13  *
14  * OpenOffice.org is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License version 3 for more details
18  * (a copy is included in the LICENSE file that accompanied this code).
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with OpenOffice.org.  If not, see
22  * <http://www.openoffice.org/license.html>
23  * for a copy of the LGPLv3 License.
24  *
25 ************************************************************************/
26 
27 #ifndef SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
28 #define SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
29 
30 #include <boost/shared_ptr.hpp>
31 
32 class MouseEvent;
33 class KeyEvent;
34 class HelpEvent;
35 class CommandEvent;
36 class NotifyEvent;
37 
38 //........................................................................
39 namespace svt { namespace table
40 {
41 //........................................................................
42 
43     class ITableControl;
44 
45 	//====================================================================
46 	//= ITableInputHandler
47 	//====================================================================
48     /** interface for components handling input in a ->TableControl
49     */
50 	class ITableInputHandler
51 	{
52     public:
53         // all those methods have the same semantics as the equal-named methods of ->Window,
54         // with the additional option to return a boolean value indicating whether
55         // the event should be further processed by the ->Window implementations (<FALSE/>),
56         // or whether it has been sufficiently handled by the ->ITableInputHandler instance
57         // (<FALSE/>).
58 
59         virtual bool    MouseMove       ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
60         virtual bool    MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
61         virtual bool    MouseButtonUp   ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
62         virtual bool    KeyInput        ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
63         virtual bool    GetFocus        ( ITableControl& _rControl ) = 0;
64         virtual bool    LoseFocus       ( ITableControl& _rControl ) = 0;
65         virtual bool    RequestHelp     ( ITableControl& _rControl, const HelpEvent& rHEvt ) = 0;
66         virtual bool    Command         ( ITableControl& _rControl, const CommandEvent& rCEvt ) = 0;
67         virtual bool    PreNotify       ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
68         virtual bool    Notify          ( ITableControl& _rControl, NotifyEvent& rNEvt ) = 0;
69 
70         virtual ~ITableInputHandler() { }
71 	};
72     typedef ::boost::shared_ptr< ITableInputHandler >   PTableInputHandler;
73 
74 //........................................................................
75 } } // namespace svt::table
76 //........................................................................
77 
78 #endif // SVTOOLS_INC_TABLE_TABLEINPUTHANDLER_HXX
79