Planeshift

pstoggle.h

Go to the documentation of this file.
00001 /*
00002  * pstoggle.h
00003  *
00004  * Copyright (C) 2001-2010 Atomic Blue ([email protected], http://www.planeshift.it)
00005  *
00006  * Credits : Saul Leite <[email protected]>
00007  *           Mathias 'AgY' Voeroes <[email protected]>
00008  *           and all past and present planeshift coders
00009  *
00010  * This program is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU General Public License
00012  * as published by the Free Software Foundation (version 2 of the License.
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  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021  *
00022  */
00023  
00024 
00025 #ifndef PSTOGGLE_H_
00026 #define PSTOGGLE_H_
00027 
00038 class psToggle
00039 {
00040     public:
00044     psToggle();
00048     ~psToggle();
00049 
00055     void SetCallback(void (*object), void (*function) (void *));
00059     void RemoveCallback();
00064     void SetToggle(bool newstate);
00069     bool GetToggle();
00073     void Activate();
00077     void Deactivate();
00078 
00079     private:
00080     bool        state;                      
00081     void (*callbackobject);                 
00082     void (*callbackfunction) (void *);      
00083     bool hasCallback;                       
00084 
00088     void Callback();
00089 };
00090 
00093 #endif /*PSTOGGLE_H_*/