libtelepathy/tsrc/inc/telepathy-presence.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2 * Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Used for Presence related Test Cases.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __TELEPATHY_PRESENCE_H__
       
    21 #define __TELEPATHY_PRESENCE_H__
       
    22 
       
    23 #include <glib-object.h>
       
    24 
       
    25 G_BEGIN_DECLS
       
    26 
       
    27 #define TELEPATHY_TYPE_PRESENCE         (telepathy_presence_get_type ())
       
    28 #define TELEPATHY_PRESENCE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TELEPATHY_TYPE_PRESENCE, TelepathyPresence))
       
    29 #define TELEPATHY_PRESENCE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), TELEPATHY_TYPE_PRESENCE, TelepathyPresenceClass))
       
    30 #define TELEPATHY_IS_PRESENCE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TELEPATHY_TYPE_PRESENCE))
       
    31 #define TELEPATHY_IS_PRESENCE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), TELEPATHY_TYPE_PRESENCE))
       
    32 #define TELEPATHY_PRESENCE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TELEPATHY_TYPE_PRESENCE, TelepathyPresenceClass))
       
    33 
       
    34 #ifdef __cplusplus
       
    35 extern "C"
       
    36 {
       
    37 #endif
       
    38 
       
    39 typedef struct _TelepathyPresence      TelepathyPresence;
       
    40 typedef struct _TelepathyPresenceClass TelepathyPresenceClass;
       
    41 
       
    42 #ifdef __cplusplus
       
    43 }
       
    44 #endif
       
    45 
       
    46 struct _TelepathyPresence {
       
    47 	GObject parent;
       
    48 };
       
    49 
       
    50 struct _TelepathyPresenceClass {
       
    51 	GObjectClass parent_class;
       
    52 };
       
    53 
       
    54 #ifdef __cplusplus
       
    55 extern "C"
       
    56 {
       
    57 #endif
       
    58 typedef enum {
       
    59 	TELEPATHY_PRESENCE_STATE_AVAILABLE,
       
    60 	TELEPATHY_PRESENCE_STATE_BUSY,
       
    61 	TELEPATHY_PRESENCE_STATE_AWAY,
       
    62 	TELEPATHY_PRESENCE_STATE_EXT_AWAY,
       
    63 	TELEPATHY_PRESENCE_STATE_HIDDEN,      /* When you appear offline to others */
       
    64 	TELEPATHY_PRESENCE_STATE_UNAVAILABLE,
       
    65 } TelepathyPresenceState;
       
    66 
       
    67 #ifdef __cplusplus
       
    68 }
       
    69 #endif
       
    70 GType               telepathy_presence_get_type                 (void) G_GNUC_CONST;
       
    71 
       
    72 TelepathyPresence *    telepathy_presence_new                      (void);
       
    73 TelepathyPresence *    telepathy_presence_new_full                 (TelepathyPresenceState  state,
       
    74 							      const gchar         *status);
       
    75 
       
    76 const gchar *       telepathy_presence_get_resource             (TelepathyPresence      *presence);
       
    77 TelepathyPresenceState telepathy_presence_get_state                (TelepathyPresence      *presence);
       
    78 const gchar *       telepathy_presence_get_status               (TelepathyPresence      *presence);
       
    79 gint                telepathy_presence_get_priority             (TelepathyPresence      *presence);
       
    80 
       
    81 void                telepathy_presence_set_resource             (TelepathyPresence      *presence,
       
    82 							      const gchar         *resource);
       
    83 void                telepathy_presence_set_state                (TelepathyPresence      *presence,
       
    84 							      TelepathyPresenceState  state);
       
    85 void                telepathy_presence_set_status               (TelepathyPresence      *presence,
       
    86 							      const gchar         *status);
       
    87 void                telepathy_presence_set_priority             (TelepathyPresence      *presence,
       
    88 							      gint                 priority);
       
    89 gboolean            telepathy_presence_resource_equal           (gconstpointer        a,
       
    90 							      gconstpointer        b);
       
    91 gint                telepathy_presence_sort_func                (gconstpointer        a,
       
    92 							      gconstpointer        b);
       
    93 
       
    94 /*static*/ const gchar *telepathy_presence_state_to_str        (TelepathyPresenceState                   presence_state);
       
    95 
       
    96 
       
    97 
       
    98 G_END_DECLS
       
    99 
       
   100 #endif /* __TELEPATHY_PRESENCE_H__ */
       
   101