Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

gadget_w_event.h

Go to the documentation of this file.
00001 /*
00002     File        : gadget_w_event.h
00003     Date        : 19-Sep-02
00004     Description : Class to represent a toolbox gadget that allows the event
00005                   code to be changed.
00006 
00007     Copyright © 1995-2002 Alexander Thoukydides
00008 
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License
00011     as published by the Free Software Foundation; either version 2
00012     of the License, or (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00022 */
00023 
00024 // Only include header file once
00025 #ifndef gadget_w_event_h
00026 #define gadget_w_event_h
00027 
00028 // Include oslib header files
00029 #include "oslib/types.h"
00030 
00031 // A class to represent a gadget with a selectable event
00032 class gadget_w_event
00033 {
00034 public:
00035 
00036     /*
00037         Parameters  : event      - The toolbox event code.
00038         Returns     : void
00039         Description : Set the toolbox event code which will be raised for this
00040                       gadget.
00041     */
00042     void set_event(bits event);
00043 
00044     /*
00045         Parameters  : void
00046         Returns     : bits  - The toolbox event code.
00047         Description : Get the toolbox event code which will be raised for this
00048                       gadget.
00049     */
00050     bits get_event() const;
00051 
00052 protected:
00053 
00054     /*
00055         Parameters  : event      - The toolbox event code.
00056         Returns     : void
00057         Description : Gadget specific function to set the toolbox event code
00058                       which will be raised for this gadget.
00059     */
00060     virtual void _set_event(bits event) = 0;
00061 
00062     /*
00063         Parameters  : void
00064         Returns     : bits  - The toolbox event code.
00065         Description : Gadget specific function to get the toolbox event code
00066                       which will be raised for this gadget.
00067     */
00068     virtual bits _get_event() const = 0;
00069 };
00070 
00071 /*
00072     Parameters  : event      - The toolbox event code.
00073     Returns     : void
00074     Description : Set the toolbox event code which will be raised for this
00075                   gadget.
00076 */
00077 inline void gadget_w_event::set_event(bits event)
00078 {
00079     _set_event(event);
00080 }
00081 
00082 /*
00083     Parameters  : void
00084     Returns     : bits  - The toolbox event code.
00085     Description : Get the toolbox event code which will be raised for this
00086                   gadget.
00087 */
00088 inline bits gadget_w_event::get_event() const
00089 {
00090     return _get_event();
00091 }
00092 
00093 #endif

Generated on Sun Jan 26 10:18:43 2025 for NBLib by doxygen 1.3.3