telepathygabble/inc/capabilities.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * capabilities.h - Connection.Interface.Capabilities constants and utilities
       
     3  * Copyright (C) 2005 Collabora Ltd.
       
     4  * 
       
     5  *
       
     6  * This library is free software; you can redistribute it and/or
       
     7  * modify it under the terms of the GNU Lesser General Public
       
     8  * License as published by the Free Software Foundation; either
       
     9  * version 2.1 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This library 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 GNU
       
    14  * Lesser General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU Lesser General Public
       
    17  * License along with this library; if not, write to the Free Software
       
    18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    19  */
       
    20 
       
    21 #ifndef __GABBLE_CAPABILITIES__H__
       
    22 #define __GABBLE_CAPABILITIES__H__
       
    23 
       
    24 #include <glib-object.h>
       
    25 
       
    26 #include "gabble-presence.h"
       
    27 
       
    28 #define BUNDLE_VOICE_V1         "voice-v1"
       
    29 #define BUNDLE_JINGLE_AUDIO     "jingle-audio"
       
    30 #define BUNDLE_JINGLE_VIDEO     "jingle-video"
       
    31 
       
    32 typedef struct _Feature Feature;
       
    33 
       
    34 struct _Feature
       
    35 {
       
    36   const gchar *bundle;
       
    37   const gchar *ns;
       
    38   GabblePresenceCapabilities caps;
       
    39 };
       
    40 
       
    41 /*
       
    42  * capabilities_get_features
       
    43  *
       
    44  * Return a linked list of const Feature structs corresponding to the given
       
    45  * GabblePresenceCapabilities.
       
    46  */
       
    47 GSList *
       
    48 capabilities_get_features (GabblePresenceCapabilities caps);
       
    49 
       
    50 /*
       
    51  * capabilities_fill_cache
       
    52  *
       
    53  * Fill up the given GabblePresenceCache with known feature nodes
       
    54  */
       
    55 void
       
    56 capabilities_fill_cache (GabblePresenceCache *cache);
       
    57 
       
    58 /*
       
    59  * capabilities_get_initial_caps
       
    60  *
       
    61  * Return the GabblePresenceCapabilities we always have
       
    62  */
       
    63 GabblePresenceCapabilities
       
    64 capabilities_get_initial_caps ();
       
    65 
       
    66 typedef GabblePresenceCapabilities (*TypeFlagsToCapsFunc) (guint typeflags);
       
    67 typedef guint (*CapsToTypeFlagsFunc) (GabblePresenceCapabilities caps);
       
    68 
       
    69 typedef struct _CapabilityConversionData CapabilityConversionData;
       
    70 
       
    71 struct _CapabilityConversionData
       
    72 {
       
    73   const gchar *iface;
       
    74   TypeFlagsToCapsFunc tf2c_fn;
       
    75   CapsToTypeFlagsFunc c2tf_fn;
       
    76 };
       
    77 
       
    78 extern const CapabilityConversionData capabilities_conversions[];
       
    79 
       
    80 #endif  /* __GABBLE_CAPABILITIES__H__ */
       
    81