telepathygabble/inc/handles.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * handles.h - mechanism to store and retrieve handles on a connection
       
     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 __HANDLES_H__
       
    22 #define __HANDLES_H__
       
    23 
       
    24 #include <glib.h>
       
    25 
       
    26 
       
    27 #include "gabble-types.h"
       
    28 #include "telepathy-constants.h"
       
    29 
       
    30 G_BEGIN_DECLS
       
    31 
       
    32 typedef enum
       
    33 {
       
    34   GABBLE_LIST_HANDLE_PUBLISH = 1,
       
    35   GABBLE_LIST_HANDLE_SUBSCRIBE,
       
    36   GABBLE_LIST_HANDLE_KNOWN,
       
    37   GABBLE_LIST_HANDLE_DENY
       
    38 } GabbleListHandle;
       
    39 
       
    40 gboolean gabble_handle_jid_is_valid (TpHandleType type, const gchar *jid, GError **error);
       
    41 gboolean gabble_handle_type_is_valid (TpHandleType type, GError **error);
       
    42 
       
    43 GabbleHandleRepo *gabble_handle_repo_new ();
       
    44 void gabble_handle_repo_destroy (GabbleHandleRepo *repo);
       
    45 
       
    46 gboolean gabble_handle_is_valid (GabbleHandleRepo *repo, TpHandleType type, GabbleHandle handle, GError **error);
       
    47 gboolean gabble_handles_are_valid (GabbleHandleRepo *repo, TpHandleType type, const GArray *array, gboolean allow_zero, GError **error);
       
    48 
       
    49 gboolean gabble_handle_ref (GabbleHandleRepo *repo, TpHandleType type, GabbleHandle handle);
       
    50 gboolean gabble_handle_unref (GabbleHandleRepo *repo, TpHandleType type, GabbleHandle handle);
       
    51 const char *gabble_handle_inspect (GabbleHandleRepo *repo, TpHandleType type, GabbleHandle handle);
       
    52 
       
    53 GabbleHandle gabble_handle_for_contact (GabbleHandleRepo *repo, const char *jid, gboolean with_resource);
       
    54 gboolean gabble_handle_for_room_exists (GabbleHandleRepo *repo, const gchar *jid, gboolean ignore_nick);
       
    55 GabbleHandle gabble_handle_for_room (GabbleHandleRepo *repo, const gchar *jid);
       
    56 GabbleHandle gabble_handle_for_list (GabbleHandleRepo *repo, const gchar *list);
       
    57 
       
    58 gboolean gabble_handle_set_qdata (GabbleHandleRepo *repo, TpHandleType type,
       
    59     GabbleHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy);
       
    60 
       
    61 gpointer gabble_handle_get_qdata (GabbleHandleRepo *repo, TpHandleType type,
       
    62     GabbleHandle handle, GQuark key_id);
       
    63 
       
    64 gboolean gabble_handle_client_hold (GabbleHandleRepo *repo, const gchar *client_name, GabbleHandle handle, TpHandleType type, GError **error);
       
    65 
       
    66 gboolean gabble_handle_client_release (GabbleHandleRepo *repo, const gchar *client_name, GabbleHandle handle, TpHandleType type, GError **error);
       
    67 
       
    68 G_END_DECLS
       
    69 
       
    70 #endif /* #ifndef __HANDLES_H__ */