1 /*
2 *  RAL -- Rubrica Addressbook Library
3 *  file: telephone.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_TELEPHONE_H
22 #define _R_TELEPHONE_H
23 
24 #include <glib.h>
25 #include <glib-object.h>
26 
27 
28 #define R_TELEPHONE_TYPE           (r_telephone_get_type())
29 
30 #define R_TELEPHONE(obj)           (G_TYPE_CHECK_INSTANCE_CAST((obj),    \
31                                     R_TELEPHONE_TYPE, RTelephone))
32 
33 #define R_TELEPHONE_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),     \
34                                     R_TELEPHONE_TYPE, RTelephoneClass))
35 
36 #define IS_R_TELEPHONE(obj)        (G_TYPE_CHECK_INSTANCE_TYPE((obj),    \
37                                     R_TELEPHONE_TYPE))
38 
39 #define IS_R_TELEPHONE_CLASS(kls)  (G_TYPE_CHECK_CLASS_TYPE((kls),       \
40                                     R_TELEPHONE_TYPE))
41 
42 #define R_TELEPHONE_GET_CLASS(kls) (G_TYPE_INSTANCE_GET_CLASS((kls),     \
43                                     R_TELEPHONE_TYPE, RTelephoneClass))
44 
45 
46 typedef struct _RTelephone        RTelephone;
47 typedef struct _RTelephoneClass   RTelephoneClass;
48 typedef struct _RTelephonePrivate RTelephonePrivate;
49 
50 
51 typedef enum {
52   R_TELEPHONE_HOME = 0,
53   R_TELEPHONE_WORK,
54   R_TELEPHONE_CELLPHONE,
55   R_TELEPHONE_FAX,
56   R_TELEPHONE_PAGER,
57   R_TELEPHONE_OTHER,
58   R_TELEPHONE_OPERATOR,
59   R_TELEPHONE_GREEN,
60   R_TELEPHONE_CUSTOMER_CARE,
61   R_TELEPHONE_UNKNOWN,
62   R_TELEPHONE_INVALID
63 } RTelephoneType;
64 
65 
66 struct _RTelephone {
67   GObject parent;
68 
69   RTelephonePrivate* priv;
70 };
71 
72 
73 struct _RTelephoneClass {
74   GObjectClass parent;
75 };
76 
77 
78 
79 GType          r_telephone_get_type    (void);
80 
81 
82 RTelephone*    r_telephone_new             (void);
83 void           r_telephone_free            (RTelephone *telephone);
84 
85 gboolean       r_telephone_search          (RTelephone *telephone,
86 					    const gchar* str);
87 gboolean       r_telephone_check           (RTelephone* telephone,
88 					    const gchar* property,
89 					    gchar** value);
90 RTelephone*    r_telephone_copy            (RTelephone *telephone);
91 
92 RTelephoneType r_telephone_lookup_str2enum (gchar* str);
93 gchar*         r_telephone_lookup_enum2str (RTelephoneType type);
94 
95 gchar*         r_telephone_lookup_enum2lbl (RTelephoneType type);
96 gchar*         r_telephone_lookup_str2lbl  (gchar* str);
97 
98 
99 #endif
100