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 namespace casa { 00033 00034 // Base class for a handler for PlotSelectEvent. 00035 class PlotSelectEventHandler { 00036 public: 00037 PlotSelectEventHandler() { } 00038 00039 virtual ~PlotSelectEventHandler() { } 00040 00041 // Handle the given event. 00042 virtual void handleSelect(const PlotSelectEvent& event) = 0; 00043 }; 00044 00045 // Base class for a handler for PlotClickEvent. 00046 class PlotClickEventHandler { 00047 public: 00048 PlotClickEventHandler() { } 00049 00050 virtual ~PlotClickEventHandler() { } 00051 00052 // Handle the given event. 00053 virtual void handleClick(const PlotClickEvent& event) = 0; 00054 }; 00055 00056 // Base class for a handler for PlotMousePressEvent. 00057 class PlotMousePressEventHandler { 00058 public: 00059 PlotMousePressEventHandler() { } 00060 00061 virtual ~PlotMousePressEventHandler() { } 00062 00063 // Handle the given event. 00064 virtual void handleMousePress(const PlotMousePressEvent& event) = 0; 00065 }; 00066 00067 // Base class for a handler for PlotMouseReleaseEvent. 00068 class PlotMouseReleaseEventHandler { 00069 public: 00070 PlotMouseReleaseEventHandler() { } 00071 00072 virtual ~PlotMouseReleaseEventHandler() { } 00073 00074 // Handle the given event. 00075 virtual void handleMouseRelease(const PlotMouseReleaseEvent& event) = 0; 00076 }; 00077 00078 // Base class for a handler for PlotMouseDragEvent. 00079 class PlotMouseDragEventHandler { 00080 public: 00081 PlotMouseDragEventHandler() { } 00082 00083 virtual ~PlotMouseDragEventHandler() { } 00084 00085 // Handle the given event. 00086 virtual void handleMouseDrag(const PlotMouseDragEvent& event) = 0; 00087 }; 00088 00089 // Base class for a handler for a PlotMouseMoveEvent. 00090 class PlotMouseMoveEventHandler { 00091 public: 00092 PlotMouseMoveEventHandler() { } 00093 00094 virtual ~PlotMouseMoveEventHandler() { } 00095 00096 // Handle the given event. 00097 virtual void handleMouseMove(const PlotMouseMoveEvent& event) = 0; 00098 }; 00099 00100 // Base class for a handler for PlotWheelEvent. 00101 class PlotWheelEventHandler { 00102 public: 00103 PlotWheelEventHandler() { } 00104 00105 virtual ~PlotWheelEventHandler() { } 00106 00107 // Handle the given event 00108 virtual void handleWheel(const PlotWheelEvent& event) = 0; 00109 }; 00110 00111 // Base class for a handler for PlotKeyEvent. 00112 class PlotKeyEventHandler { 00113 public: 00114 PlotKeyEventHandler() { } 00115 00116 virtual ~PlotKeyEventHandler() { } 00117 00118 // Handle the given event. 00119 virtual void handleKey(const PlotKeyEvent& event) = 0; 00120 }; 00121 00122 // Base class for a handler for PlotResizeEvent. 00123 class PlotResizeEventHandler { 00124 public: 00125 PlotResizeEventHandler() { } 00126 00127 virtual ~PlotResizeEventHandler() { } 00128 00129 // Handle the given event. 00130 virtual void handleResize(const PlotResizeEvent& event) = 0; 00131 }; 00132 00133 // Base class for a handler for PlotButtonEvent. 00134 class PlotButtonEventHandler { 00135 public: 00136 PlotButtonEventHandler() { } 00137 00138 virtual ~PlotButtonEventHandler() { } 00139 00140 // Handle the given event. 00141 virtual void handleButton(const PlotButtonEvent& event) = 0; 00142 }; 00143 00144 // Base class for a handler for PlotCheckboxEvent. 00145 class PlotCheckboxEventHandler { 00146 public: 00147 PlotCheckboxEventHandler() { } 00148 00149 virtual ~PlotCheckboxEventHandler() { } 00150 00151 // Handle the given event. 00152 virtual void handleCheckbox(const PlotCheckboxEvent& event) = 0; 00153 }; 00154 00155 00156 // Smart Pointer Definitions // 00157 00158 typedef CountedPtr<PlotSelectEventHandler> PlotSelectEventHandlerPtr; 00159 typedef CountedPtr<PlotClickEventHandler> PlotClickEventHandlerPtr; 00160 typedef CountedPtr<PlotMousePressEventHandler> PlotMousePressEventHandlerPtr; 00161 typedef CountedPtr<PlotMouseReleaseEventHandler> 00162 PlotMouseReleaseEventHandlerPtr; 00163 typedef CountedPtr<PlotMouseDragEventHandler> PlotMouseDragEventHandlerPtr; 00164 typedef CountedPtr<PlotMouseMoveEventHandler> PlotMouseMoveEventHandlerPtr; 00165 typedef CountedPtr<PlotWheelEventHandler> PlotWheelEventHandlerPtr; 00166 typedef CountedPtr<PlotKeyEventHandler> PlotKeyEventHandlerPtr; 00167 typedef CountedPtr<PlotResizeEventHandler> PlotResizeEventHandlerPtr; 00168 typedef CountedPtr<PlotButtonEventHandler> PlotButtonEventHandlerPtr; 00169 typedef CountedPtr<PlotCheckboxEventHandler> PlotCheckboxEventHandlerPtr; 00170 00171 } 00172 00173 #endif /*PLOTEVENTHANDLER_H_*/