/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Core Library
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 *
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IOWFUNCTOR_H
#define __IOWFUNCTOR_H

#include <stdio.h>
#include <stdlib.h>

#include <iwear/functor.h>

using namespace std;

namespace iwear {
namespace iowarrior {

// modes of the switch
enum switch_mode {IOW_MODUNDEF, IOW_MOD0, IOW_MOD1, IOW_MOD2, IOW_MOD3, IOW_MOD4, IOW_MOD5};

// what happened with the switch?
enum switch_event {IOW_MODNONE, IOW_MODCHANGED, IOW_MODSELECTED};

// states of the button
enum button_mode {IOW_BUTTONUNDEF, IOW_BUTTONDOWN, IOW_BUTTONUP};

// what happened with the button?
enum button_event {IOW_BUTTONNONE, IOW_BUTTONPRESSED, IOW_BUTTONRELEASED};

struct iow_event {
    switch_mode sm;
    switch_event se;
    button_mode bm;
    button_event be;
};

/**
 *
 *
 */
class IOWFunctor: public Functor<iow_event> {

    public:

	/**
	 *
	 */
	IOWFunctor();
	
	/**
	 *
	 */
	virtual void on_event(switch_mode sm, switch_event se, button_mode bm, button_event be) = 0;
	
	/**
	 *
	 */
	virtual void operator()(const iow_event& iowe) {
	    on_event(iowe.sm, iowe.se, iowe.bm, iowe.be);
	}
};
    
} // namespace iowarrior
} // namespace iwear

#endif // __IOWFUNCTOR_H

