casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PlotEventHandler.h
Go to the documentation of this file.
00001 //# PlotEventHandler.h: Class to handle different types of interaction events.
00002 //# Copyright (C) 2008
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: $
00027 #ifndef PLOTEVENTHANDLER_H_
00028 #define PLOTEVENTHANDLER_H_
00029 
00030 #include <graphics/GenericPlotter/PlotEvent.h>
00031 
00032 #include <casa/namespace.h>
00033 
00034 namespace casa {
00035 
00036 // Base class for a handler for PlotSelectEvent.
00037 class PlotSelectEventHandler {
00038 public:
00039     PlotSelectEventHandler() { }
00040     
00041     virtual ~PlotSelectEventHandler() { }
00042     
00043     // Handle the given event.
00044     virtual void handleSelect(const PlotSelectEvent& event) = 0;
00045 };
00046 
00047 // Base class for a handler for PlotClickEvent.
00048 class PlotClickEventHandler {
00049 public:
00050     PlotClickEventHandler() { }
00051     
00052     virtual ~PlotClickEventHandler() { }
00053     
00054     // Handle the given event.
00055     virtual void handleClick(const PlotClickEvent& event) = 0;
00056 };
00057 
00058 // Base class for a handler for PlotMousePressEvent.
00059 class PlotMousePressEventHandler {
00060 public:
00061     PlotMousePressEventHandler() { }
00062     
00063     virtual ~PlotMousePressEventHandler() { }
00064     
00065     // Handle the given event.
00066     virtual void handleMousePress(const PlotMousePressEvent& event) = 0;
00067 };
00068 
00069 // Base class for a handler for PlotMouseReleaseEvent.
00070 class PlotMouseReleaseEventHandler {
00071 public:
00072     PlotMouseReleaseEventHandler() { }
00073     
00074     virtual ~PlotMouseReleaseEventHandler() { }
00075     
00076     // Handle the given event.
00077     virtual void handleMouseRelease(const PlotMouseReleaseEvent& event) = 0;
00078 };
00079 
00080 // Base class for a handler for PlotMouseDragEvent.
00081 class PlotMouseDragEventHandler {
00082 public:
00083     PlotMouseDragEventHandler() { }
00084     
00085     virtual ~PlotMouseDragEventHandler() { }
00086     
00087     // Handle the given event.
00088     virtual void handleMouseDrag(const PlotMouseDragEvent& event) = 0;
00089 };
00090 
00091 // Base class for a handler for a PlotMouseMoveEvent.
00092 class PlotMouseMoveEventHandler {
00093 public:
00094     PlotMouseMoveEventHandler() { }
00095     
00096     virtual ~PlotMouseMoveEventHandler() { }
00097     
00098     // Handle the given event.
00099     virtual void handleMouseMove(const PlotMouseMoveEvent& event) = 0;
00100 };
00101 
00102 // Base class for a handler for PlotWheelEvent.
00103 class PlotWheelEventHandler {
00104 public:
00105     PlotWheelEventHandler() { }
00106     
00107     virtual ~PlotWheelEventHandler() { }
00108     
00109     // Handle the given event
00110     virtual void handleWheel(const PlotWheelEvent& event) = 0;
00111 };
00112 
00113 // Base class for a handler for PlotKeyEvent.
00114 class PlotKeyEventHandler {
00115 public:
00116     PlotKeyEventHandler() { }
00117     
00118     virtual ~PlotKeyEventHandler() { }
00119     
00120     // Handle the given event.
00121     virtual void handleKey(const PlotKeyEvent& event) = 0;
00122 };
00123 
00124 // Base class for a handler for PlotResizeEvent.
00125 class PlotResizeEventHandler {
00126 public:
00127     PlotResizeEventHandler() { }
00128     
00129     virtual ~PlotResizeEventHandler() { }
00130     
00131     // Handle the given event.
00132     virtual void handleResize(const PlotResizeEvent& event) = 0;
00133 };
00134 
00135 // Base class for a handler for PlotButtonEvent.
00136 class PlotButtonEventHandler {
00137 public:
00138     PlotButtonEventHandler() { }
00139     
00140     virtual ~PlotButtonEventHandler() { }
00141     
00142     // Handle the given event.
00143     virtual void handleButton(const PlotButtonEvent& event) = 0;
00144 };
00145 
00146 // Base class for a handler for PlotCheckboxEvent.
00147 class PlotCheckboxEventHandler {
00148 public:
00149     PlotCheckboxEventHandler() { }
00150     
00151     virtual ~PlotCheckboxEventHandler() { }
00152     
00153     // Handle the given event.
00154     virtual void handleCheckbox(const PlotCheckboxEvent& event) = 0;
00155 };
00156 
00157 
00158 // Smart Pointer Definitions //
00159 
00160 typedef CountedPtr<PlotSelectEventHandler> PlotSelectEventHandlerPtr;
00161 typedef CountedPtr<PlotClickEventHandler> PlotClickEventHandlerPtr;
00162 typedef CountedPtr<PlotMousePressEventHandler> PlotMousePressEventHandlerPtr;
00163 typedef CountedPtr<PlotMouseReleaseEventHandler>
00164         PlotMouseReleaseEventHandlerPtr;
00165 typedef CountedPtr<PlotMouseDragEventHandler> PlotMouseDragEventHandlerPtr;
00166 typedef CountedPtr<PlotMouseMoveEventHandler> PlotMouseMoveEventHandlerPtr;
00167 typedef CountedPtr<PlotWheelEventHandler> PlotWheelEventHandlerPtr;
00168 typedef CountedPtr<PlotKeyEventHandler> PlotKeyEventHandlerPtr;
00169 typedef CountedPtr<PlotResizeEventHandler> PlotResizeEventHandlerPtr;
00170 typedef CountedPtr<PlotButtonEventHandler> PlotButtonEventHandlerPtr;
00171 typedef CountedPtr<PlotCheckboxEventHandler> PlotCheckboxEventHandlerPtr;
00172 
00173 }
00174 
00175 #endif /*PLOTEVENTHANDLER_H_*/