// File: inputdata.h
// Created by: <Jörn Reimerdes>
// Created on: 22.03.2005

/**
 * inputdata.h - is part of the iwear-framework
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Input 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 __POINTSELECTOR_H
#define __POINTSELECTOR_H

#ifndef __OUTPUTMANAGER_H
#include <iwear_output/outputmanager.h>
#endif

#ifndef __INPUTMANAGER_H
#include <iwear_input/inputmanager.h>
#endif

#ifndef __TEXTDATA_H
#include <iwear_output/textdata.h>
#endif

#ifndef __WELDPOINT_H
#include <iwear_dcag_mark_assistant/weldpoint.h>
#endif

#ifndef __CHECK_H
#include <iwear_dcag_mark_assistant/check.h>
#endif

#ifndef __FUNCTOR_H
#include <iwear/functor.h>
#endif

#ifndef __KEYINPUTDATA_H
#include <iwear_input/keyinputdata.h>
#endif

using namespace iwear::input;
using namespace iwear::output;

namespace iwear {
namespace dcag {


/** TestFunctor stores all data which is common to all TestFunctor
 * subclasses.
 */
class PointSelector : public Functor<KeyInputData>
{
public:

    PointSelector( list<Weldpoint*> &weldpoints, list<Weldpoint*>::iterator &current_weldpoint, TextData &text_data, int list_length);

    /** Delets the TestFunctor.
     */
    ~PointSelector( void );

    void operator()(const KeyInputData& key_input_data);

    inline virtual string get_text_input()
    {
	return string(text_input);
    }

    virtual void add_point( void );
    virtual void delete_point( void );
    inline list<Weldpoint*> get_weldpoints( void ) { return this->new_weldpoints; }
    
protected:

private:
    char text_input[11];
    int input_len;
    list<Weldpoint*> &weldpoints;
    list<Weldpoint*>::iterator &current_weldpoint;
    TextData &text_data;
    list<Weldpoint*> new_weldpoints;
    int list_length;

    virtual void handle_user_input( void );
};

} // dcag
} // iwear
#endif	//__POINTSELECTOR_H

