/***************************************************************************
 *   Copyright (C) 2005 by Thierry CHARLES   *
 *   thierry@les-charles.net   *
 *                                                                         *
 *   This program 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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program 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 this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef _HELP_PANEL_ELEMENT_H_
#define _HELP_PANEL_ELEMENT_H_

#include <wx/menu.h>
#include <wx/event.h>
#include "lib/commons.h"
#include "components/framework/tpanelelement.h"
#include "components/framework/elementinfo.h"
#include "xpe_components/panelelt/navig_panelelt.h"

#define PELT_TYPE_HELP "PELT_TYPE_HELP"

class wxTextCtrl;

/**
 * @short Un élément de panneau d'application affichant une aide
 * @author Thierry CHARLES <thierry@les-charles.net>
 * @version 0.1
 */
class HelpPanelElement : public TPanelElement, public NavigatorSelectionListener
{
    TRANSLATABLE;
    public:
        HelpPanelElement(TApplicationPanel * _owner, int iID = -1);
        virtual ~HelpPanelElement();

        /** renvoie l'instance du panneau si elle existe */
        static HelpPanelElement * getInstance() { return instance; }

        /** renvoie une constante identifiant le type de cet ï¿½lï¿½ment de maniï¿½re a pouvoir le reconstruire lors du chargement des prï¿½fï¿½rences */
        virtual const char * getElementType() const { return PELT_TYPE_HELP; }

        /** indique si le composant doit etre sauvegardé */
        virtual bool mightBeSaved() const { return true; }

        static TPanelElementInfo getElementInfo() { return TPanelElementInfo(PELT_TYPE_HELP,wxSTr("Help"), getDefaultIcon(), 0, 1); }

        /** renvoie l'icone associée au composant */
        static const TBitmap * getDefaultIcon();

        /** changement de sélection dans le navigateur */
        virtual void selectionChanged(NavigatorPanelElement * navigator, NavigatorItemData * selectedItem);

    protected:
        /** construit le panneau conteneur et son contenu (appellï¿½ automatiquement par getContentPanel et dï¿½truit automatiquement par le destructeur) */
        virtual TPanel * buildContentPanel();

    private:
        wxTextCtrl * help;

        static HelpPanelElement * instance;
};

#endif // _HELP_PANEL_ELEMENT_H_
