jingle/sessions.h
changeset 153 eab91df480d3
parent 152 a8623ca21574
equal deleted inserted replaced
152:a8623ca21574 153:eab91df480d3
    68 
    68 
    69   /* Struct of functions provided by the transport module */
    69   /* Struct of functions provided by the transport module */
    70   JingleTransportFuncs *transfuncs;
    70   JingleTransportFuncs *transfuncs;
    71 } SessionContent;
    71 } SessionContent;
    72 
    72 
       
    73 
       
    74 // Manage sessions:
       
    75 //    Inititiator:
       
    76 void new_session_with_apps(const gchar *recipientjid, const gchar **name,
       
    77                            gconstpointer *datas, const gchar **ns);
       
    78 
       
    79 //    Responder:
       
    80 JingleSession *session_new_from_jinglenode(JingleNode *jn);
       
    81 SessionContent *session_add_content_from_jinglecontent(JingleSession *sess,
       
    82                            JingleContent *cn, SessionState state, GError **err);
       
    83 
       
    84 //    Both:
    73 JingleSession *session_new(const gchar *sid, const gchar *from,
    85 JingleSession *session_new(const gchar *sid, const gchar *from,
    74                            const gchar *to, SessionOrigin origin);
    86                            const gchar *to, SessionOrigin origin);
    75 JingleSession *session_new_from_jinglenode(JingleNode *jn);
    87 void session_delete(JingleSession *sess);
    76 JingleSession *session_find_by_sid(const gchar *sid, const gchar *from);
    88 void session_remove(JingleSession *sess);
    77 JingleSession *session_find(const JingleNode *jn);
    89 void session_free(JingleSession *sess);
    78 SessionContent* session_add_content(JingleSession *sess, const gchar *name,
    90 SessionContent *session_add_content(JingleSession *sess, const gchar *name,
    79                                     SessionState state);
    91                                     SessionState state);
       
    92 
       
    93 // Manage contents:
       
    94 int session_remove_sessioncontent(JingleSession *sess, const gchar *name);
       
    95 void session_changestate_sessioncontent(JingleSession *sess, const gchar *name,
       
    96                                         SessionState state);
    80 void session_add_app(JingleSession *sess, const gchar *name,
    97 void session_add_app(JingleSession *sess, const gchar *name,
    81                            const gchar *xmlns, gconstpointer data);
    98                            const gchar *xmlns, gconstpointer data);
    82 void session_add_trans(JingleSession *sess, const gchar *name,
    99 void session_add_trans(JingleSession *sess, const gchar *name,
    83                            const gchar *xmlns, gconstpointer data);
   100                            const gchar *xmlns, gconstpointer data);
    84 SessionContent* session_add_content_from_jinglecontent(JingleSession *sess,
   101 
    85                            JingleContent *cn, SessionState state, GError **err);
   102 
       
   103 // Search:
       
   104 //   Session:
       
   105 JingleSession *session_find_by_sid(const gchar *sid, const gchar *from);
       
   106 JingleSession *session_find(const JingleNode *jn);
       
   107 JingleSession *session_find_by_sessioncontent(SessionContent *sc);
       
   108 SessionContent *sessioncontent_find_by_app(gconstpointer data);
       
   109 SessionContent *sessioncontent_find_by_transport(gconstpointer data);
       
   110 
       
   111 //   Content:
    86 SessionContent *sessioncontent_find_by_transport(gconstpointer data);
   112 SessionContent *sessioncontent_find_by_transport(gconstpointer data);
    87 SessionContent *sessioncontent_find_by_app(gconstpointer data);
   113 SessionContent *sessioncontent_find_by_app(gconstpointer data);
    88 JingleSession *session_find_by_sessioncontent(SessionContent *sc);
       
    89 SessionContent *session_find_sessioncontent(JingleSession *sess,
   114 SessionContent *session_find_sessioncontent(JingleSession *sess,
    90                                             const gchar *name);
   115                                             const gchar *name);
    91 int session_remove_sessioncontent(JingleSession *sess, const gchar *name);
       
    92 void session_changestate_sessioncontent(JingleSession *sess, const gchar *name,
       
    93                                         SessionState state);
       
    94 void session_delete(JingleSession *sess);
       
    95 void session_remove(JingleSession *sess);
       
    96 void session_free(JingleSession *sess);
       
    97 
   116 
       
   117 // API:
    98 void jingle_handle_app(const gchar *name,
   118 void jingle_handle_app(const gchar *name,
    99                        const gchar *xmlns_app, gconstpointer app,
   119                        const gchar *xmlns_app, gconstpointer app,
   100                        const gchar *to);
   120                        const gchar *to);
   101 LmMessage *lm_message_from_jinglesession(const JingleSession *js,
   121 LmMessage *lm_message_from_jinglesession(const JingleSession *js,
   102                                          JingleAction action);
   122                                          JingleAction action);
   103 
       
   104 void handle_app_data(const gchar *sid, const gchar* from, const gchar *name, gchar *data, gsize size);
   123 void handle_app_data(const gchar *sid, const gchar* from, const gchar *name, gchar *data, gsize size);
   105 
       
   106 void new_session_with_apps(const gchar *recipientjid, const gchar **name, gconstpointer *datas, const gchar **ns);
       
   107 #endif
   124 #endif