1 /* 2 * RAL -- Rubrica Addressbook Library 3 * file: net.h 4 * 5 * Copyright (C) Nicola Fragale <nicolafragale@libero.it> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 */ 20 21 #ifndef _R_NET_ADDRESS_H 22 #define _R_NET_ADDRESS_H 23 24 #include <glib.h> 25 #include <glib-object.h> 26 27 28 #define R_NET_ADDRESS_TYPE (r_net_address_get_type()) 29 30 #define R_NET_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ 31 R_NET_ADDRESS_TYPE, RNetAddress)) 32 33 #define R_NET_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ 34 R_NET_ADDRESS_TYPE, RNetAddressClass)) 35 36 #define IS_R_NET_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ 37 R_NET_ADDRESS_TYPE)) 38 39 #define IS_R_NET_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), \ 40 R_NET_ADDRESS_TYPE)) 41 42 #define R_NET_ADDRESS_GET_CLASS(kls) (G_TYPE_INSTANCE_GET_CLASS((kls), \ 43 R_NET_ADDRESS_TYPE, RNetAddressClass)) 44 45 46 typedef struct _RNetAddress RNetAddress; 47 typedef struct _RNetAddressClass RNetAddressClass; 48 typedef struct _RNetAddressPrivate RNetAddressPrivate; 49 50 51 52 typedef enum { 53 R_NET_ADDRESS_WEB = 0, 54 R_NET_ADDRESS_EMAIL, 55 R_NET_ADDRESS_EKIGA, 56 R_NET_ADDRESS_IRC, 57 R_NET_ADDRESS_IRC_AIM, 58 R_NET_ADDRESS_IRC_ICQ, 59 R_NET_ADDRESS_IRC_JABBER, 60 R_NET_ADDRESS_IRC_YAHOO, 61 R_NET_ADDRESS_IRC_MSN, 62 R_NET_ADDRESS_WORK_WEB, 63 R_NET_ADDRESS_WORK_EMAIL, 64 R_NET_ADDRESS_UNKNOWN 65 } RNetAddressType; 66 67 68 69 struct _RNetAddress { 70 GObject parent; 71 72 RNetAddressPrivate* priv; 73 }; 74 75 76 struct _RNetAddressClass { 77 GObjectClass parent; 78 }; 79 80 81 GType r_net_address_get_type (void); 82 83 84 RNetAddress* r_net_address_new (void); 85 void r_net_address_free (RNetAddress *net); 86 87 gboolean r_net_address_check (RNetAddress* net, 88 const gchar* property, 89 gchar** value); 90 gboolean r_net_address_search (RNetAddress *net, const gchar* str); 91 92 RNetAddress* r_net_address_copy (RNetAddress *net); 93 94 gchar* r_net_address_decode_type (RNetAddressType type); 95 RNetAddressType r_net_address_encode_type (gchar* type); 96 97 98 #endif 99