/* ***********************IMPORTANT *********************************************
 *  Copyright (C) 2004-2007 Thierry Lagarde <tlagarde@users.sourceforge.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.
 *
 *
 *                      ********************
 *
 *
 *  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 Library General Public License for more details.
 *
 *
 *                      ********************
 *
 *
 * You are highly encouraged to send your changes to <tlagarde@users.sourceforge.net>
 * for possible incorporation into the main distribution.
 * By sending these changes to <tlagarde@users.sourceforge.net>,
 * it is assumed that you are offering <tlagarde@users.sourceforge.net>
 * the unlimited, non-exclusive right to reuse, modify, and relicense the code.
 *
 *
 *                      ********************
 *
 *  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         __SETTINGS_PORTS
#define         __SETTINGS_PORTS

#include <libxml/tree.h>
#include <libxml/parser.h>

enum {
	COL_PORT = 0,
	COL_SERVICE,
	COL_DESCRIPTION,
	POINTER_PORTS,	
	NUM_COLS_PORTS
};

enum {
	SERVEUR = 0,
	OTHER
};



struct Struct_Liste_Port {
	GtkTreeIter ID_Arbre_Ligne;
	GtkWidget *toolbutton;
	GtkWidget *Image_Button;
	gint      Nb_Fils;
	gpointer *Port_Pere;

	gchar    *Service;
	gint      Num_Port;
	gchar    *Description;
	gint      Type;	
	gchar    *Icon;	
	GdkPixbuf *icone;
	GdkPixbuf *icone_griser;

	gchar    *Name;
	gchar    *Path;
	gchar    *Param;
	gchar    *Icon_Program;
};

GList    *GList_Program_Associe_Show;
gint 	Num_Port_Ancien;

struct Struct_Liste_Port *Port_Modification, *Port_Selectionner;
GtkWidget *treeview_Liste_Ports;
gboolean  Liste_Port_Modification_Interface;
gboolean  Modification_Port_Program;


void      Afficher_Icone_Program_Associe (gint Num_Port);
gboolean  Port_Avec_Program_Associe (gint Num_Port);
gint      Num_Du_Port (gchar * Nom_Port);
struct Struct_Liste_Port *Pointeur_Du_Port (gint Num_Port);
gchar    *Nom_Du_Port (gint Num_Port);
void      Modifie_Ajoute_Nouveau_Port (void);
void      Supprime_Port_liste (struct Struct_Liste_Port *Port);
void      Liste_Port_Efface_Champs (void);
void      Liste_Port_Sensible (gboolean bool);
void      Liste_Port_Program_Sensible (gboolean bool);
void      Initialisation_Liste_Port (void);
void      Enregistrement_Donnee_Xml_Port (void);
void      Afficher_Liste_Port (void);
void      Create_Liste_Port (void);
void      Lit_Donnee_Xml_Port (xmlNodePtr xmlnode, struct Struct_Liste_Port *Port_Pere);
void      Lit_Xml_Port (xmlDocPtr doc);
gboolean  Lit_Xml_Port_Fichier (char *fname);

#endif
