/**
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Test 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 __VOICETRANSAPP_H
#define __VOICETRANSAPP_H

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

#ifndef __AUDIODATA_H
#include <iwear_output/audiodata.h>
#endif

#ifndef __MENUDATA_H
#include <iwear_uiservices/menudata.h>
#endif

#ifndef __APPLICATION_H
#include <iwear_uiservices/application.h>
#endif

#ifndef __VOICE_TRANS_FUNCTOR_H
#include <iwear_voicetrans/voicetransfunctor.h>
#endif

#ifndef __VOICE_TRANS_ENUM_H
#include <iwear_voicetrans/voicetransenum.h>
#endif

#ifndef __AUDIO_DATA_FUNCTOR_H
#include <iwear_voicetrans/audiodatafunctor.h>
#endif

#ifndef VOICETRANS_COMM_H
#include <iwear_voicetrans/kommunikation.h>
#endif

#ifndef __INISAVER_H
#include <iwear/inisaver.h>
#endif

#ifndef __INILOADER_H
#include <iwear/iniloader.h>
#endif

#include <dirent.h>
#include <sys/types.h>
#include <fstream>
#include <stdio.h>

using namespace iwear::output;
using namespace iwear::uiservices;


namespace iwear {
namespace voicetransmission {

// forward declaration
class VoiceTransFunctor;
class AudioDataFunctor;	

class VoiceTransApp : public Application
{
    friend class AudioDataFunctor;
    friend class VoiceTransFunctor;

public:
    
    /**
     * The constructor
     * @param as A pointer to the application service
     */
    VoiceTransApp(ApplicationService* as);

    /**
     * A special constructor which is required to load the voice
     * transmission as a plugin (Development version)
     */
    VoiceTransApp( void );

    /**
     * The Destructor. 
     */
    virtual ~VoiceTransApp(void);

    /** 
     * 
     */
    void Run(void);
    
protected:

    /** 
     * 
     */
    void Init_Application(void);

    /**
     * 
     */
    void build_menu(void);

    /**
     * 
     */
    void display_menu(void);

    /**
     * 
     */
    void server_konf(void);

    /**
     * 
     */
    void sendonly(void);

    /** 
     * 
     */
    void hearonly(void);

    /** 
     * 
     */
    void sendandhear(void);

    /** 
     * 
     */
    void stopsender(void);

     /** 
     * 
     */
    void stopreceiver(void);

     /** 
     * 
     */
    void killvoicetrans(void);

    /** 
     * 
     */
    void Final_Application(void);

      
    VoiceTransFunctor* voice_trans_functor;

    AudioDataFunctor* audio_data_functor;

    /**
     * A pointer to a text data which contains something
     */
    TextData* text_data;
    
    /**
     * A pointer to the audio data 
     */
    AudioData* audio_data;
    
    /**
     * A pointer to a menu data. It's used for Output Manager to
     * display the submenu of the voictransmission.
     */
    MenuData* menu_data;
    
    
    map<const uint32_t, VoiceTransButton> button_id2button_type;
    
private:

};

    } // namespace voiceTransmission
} // namespace iwear

#endif //__VOICETRANSMISSION_H
