author | Frank Zschockelt <lm@freakysoft.de> |
Sat, 13 Feb 2016 12:16:45 +0100 | |
changeset 705 | 1b455131d0f1 |
parent 690 | 7ccf2113ec5f |
permissions | -rw-r--r-- |
516
4dd3aa6b83e5
Change the tab width to 4 steps in the emacs headers
Mikael Hallendal <micke@imendio.com>
parents:
515
diff
changeset
|
1 |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
1 | 2 |
/* |
99
81e9d035de02
2004-10-05 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
84
diff
changeset
|
3 |
* Copyright (C) 2003 Imendio AB |
1 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU Lesser General Public License as |
|
7 |
* published by the Free Software Foundation; either version 2 of the |
|
8 |
* License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 |
* Lesser General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU Lesser General Public |
|
690
7ccf2113ec5f
Update the postal address of the FSF
Frank Zschockelt <lm@freakysoft.de>
parents:
643
diff
changeset
|
16 |
* License along with this program; if not, see <https://www.gnu.org/licenses> |
1 | 17 |
*/ |
18 |
||
19 |
#ifndef __LM_MESSAGE_H__ |
|
20 |
#define __LM_MESSAGE_H__ |
|
21 |
||
22 |
#if !defined (LM_INSIDE_LOUDMOUTH_H) && !defined (LM_COMPILATION) |
|
23 |
#error "Only <loudmouth/loudmouth.h> can be included directly, this file may disappear or change contents." |
|
24 |
#endif |
|
25 |
||
26 |
#include <loudmouth/lm-message-node.h> |
|
27 |
||
101
a8abfbc8c005
2004-10-22 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
28 |
G_BEGIN_DECLS |
a8abfbc8c005
2004-10-22 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
29 |
|
1 | 30 |
typedef struct LmMessagePriv LmMessagePriv; |
31 |
||
32 |
typedef struct { |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
33 |
LmMessageNode *node; |
1 | 34 |
|
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
35 |
LmMessagePriv *priv; |
1 | 36 |
} LmMessage; |
37 |
||
417
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
38 |
/** |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
39 |
* LmMessageType: |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
40 |
* @LM_MESSAGE_TYPE_MESSAGE: a message, <message/> |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
41 |
* @LM_MESSAGE_TYPE_PRESENCE: a presence element, <presence/> |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
42 |
* @LM_MESSAGE_TYPE_IQ: an info/query element, <iq/> |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
43 |
* @LM_MESSAGE_TYPE_STREAM: the stream:stream element, you probably don't need to create a message of this type. |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
44 |
* @LM_MESSAGE_TYPE_STREAM_ERROR: a stream:error element |
643
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
45 |
* @LM_MESSAGE_TYPE_STREAM_FEATURES: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
46 |
* @LM_MESSAGE_TYPE_AUTH: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
47 |
* @LM_MESSAGE_TYPE_CHALLENGE: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
48 |
* @LM_MESSAGE_TYPE_RESPONSE: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
49 |
* @LM_MESSAGE_TYPE_SUCCESS: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
50 |
* @LM_MESSAGE_TYPE_FAILURE: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
51 |
* @LM_MESSAGE_TYPE_PROCEED: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
52 |
* @LM_MESSAGE_TYPE_STARTTLS: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
53 |
* @LM_MESSAGE_TYPE_UNKNOWN: incoming message is of some unknown type. |
607 | 54 |
* |
417
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
55 |
* Describes what type of message a message is. This maps directly to top level elements in the jabber protocol. |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
56 |
*/ |
1 | 57 |
typedef enum { |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
58 |
LM_MESSAGE_TYPE_MESSAGE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
59 |
LM_MESSAGE_TYPE_PRESENCE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
60 |
LM_MESSAGE_TYPE_IQ, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
61 |
LM_MESSAGE_TYPE_STREAM, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
62 |
LM_MESSAGE_TYPE_STREAM_ERROR, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
63 |
LM_MESSAGE_TYPE_STREAM_FEATURES, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
64 |
LM_MESSAGE_TYPE_AUTH, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
65 |
LM_MESSAGE_TYPE_CHALLENGE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
66 |
LM_MESSAGE_TYPE_RESPONSE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
67 |
LM_MESSAGE_TYPE_SUCCESS, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
68 |
LM_MESSAGE_TYPE_FAILURE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
69 |
LM_MESSAGE_TYPE_PROCEED, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
70 |
LM_MESSAGE_TYPE_STARTTLS, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
71 |
LM_MESSAGE_TYPE_UNKNOWN |
1 | 72 |
} LmMessageType; |
73 |
||
417
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
74 |
/** |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
75 |
* LmMessageSubType: |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
76 |
* @LM_MESSAGE_SUB_TYPE_NOT_SET: the default. No "type" attribute will be sent. |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
77 |
* @LM_MESSAGE_SUB_TYPE_AVAILABLE: presence is available, applies to message type "presence" |
643
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
78 |
* @LM_MESSAGE_SUB_TYPE_NORMAL: |
e7ef923056d7
Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
607
diff
changeset
|
79 |
* @LM_MESSAGE_SUB_TYPE_CHAT: message is a chat message, applies to message type "message" |
417
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
80 |
* @LM_MESSAGE_SUB_TYPE_GROUPCHAT: message is a group chat message, applies to message type "message" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
81 |
* @LM_MESSAGE_SUB_TYPE_HEADLINE: message is a headline message, applies to message type "message" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
82 |
* @LM_MESSAGE_SUB_TYPE_UNAVAILABLE: presence is unavailable, applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
83 |
* @LM_MESSAGE_SUB_TYPE_PROBE: a probe presence, applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
84 |
* @LM_MESSAGE_SUB_TYPE_SUBSCRIBE: try to subscribe to another jids presence, applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
85 |
* @LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE: unsubscribes from another jids presence, applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
86 |
* @LM_MESSAGE_SUB_TYPE_SUBSCRIBED: reply from a subscribe message, informs that the subscription was successful. Applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
87 |
* @LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED: reply from subscribe or unsubscribe message. If it's a reply from a subscribe message it notifies that the subscription failed. Applies to message type "presence" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
88 |
* @LM_MESSAGE_SUB_TYPE_GET: used to get information from an IQ query, applies to message type "iq" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
89 |
* @LM_MESSAGE_SUB_TYPE_SET: used to set information in a IQ call, applised to message type "iq" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
90 |
* @LM_MESSAGE_SUB_TYPE_RESULT: message is an IQ reply, applies to message type "iq" |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
91 |
* @LM_MESSAGE_SUB_TYPE_ERROR: messages is an error, applies to all message types. |
607 | 92 |
* |
417
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
93 |
* Describes the sub type of a message. This is equal to the "type" attribute in the jabber protocol. What sub type a message can have is depending on the type of the message. |
364c17252e5f
Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents:
328
diff
changeset
|
94 |
*/ |
1 | 95 |
typedef enum { |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
96 |
LM_MESSAGE_SUB_TYPE_NOT_SET = -10, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
97 |
LM_MESSAGE_SUB_TYPE_AVAILABLE = -1, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
98 |
LM_MESSAGE_SUB_TYPE_NORMAL = 0, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
99 |
LM_MESSAGE_SUB_TYPE_CHAT, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
100 |
LM_MESSAGE_SUB_TYPE_GROUPCHAT, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
101 |
LM_MESSAGE_SUB_TYPE_HEADLINE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
102 |
LM_MESSAGE_SUB_TYPE_UNAVAILABLE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
103 |
LM_MESSAGE_SUB_TYPE_PROBE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
104 |
LM_MESSAGE_SUB_TYPE_SUBSCRIBE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
105 |
LM_MESSAGE_SUB_TYPE_UNSUBSCRIBE, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
106 |
LM_MESSAGE_SUB_TYPE_SUBSCRIBED, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
107 |
LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
108 |
LM_MESSAGE_SUB_TYPE_GET, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
109 |
LM_MESSAGE_SUB_TYPE_SET, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
110 |
LM_MESSAGE_SUB_TYPE_RESULT, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
111 |
LM_MESSAGE_SUB_TYPE_ERROR |
1 | 112 |
} LmMessageSubType; |
113 |
||
8
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
114 |
LmMessage * lm_message_new (const gchar *to, |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
115 |
LmMessageType type); |
8
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
116 |
LmMessage * lm_message_new_with_sub_type (const gchar *to, |
518
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
117 |
LmMessageType type, |
cdd6a0c5b439
Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents:
516
diff
changeset
|
118 |
LmMessageSubType sub_type); |
8
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
119 |
LmMessageType lm_message_get_type (LmMessage *message); |
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
120 |
LmMessageSubType lm_message_get_sub_type (LmMessage *message); |
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
121 |
LmMessageNode * lm_message_get_node (LmMessage *message); |
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
122 |
LmMessage * lm_message_ref (LmMessage *message); |
33d64cf345be
2003-06-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
7
diff
changeset
|
123 |
void lm_message_unref (LmMessage *message); |
1 | 124 |
|
101
a8abfbc8c005
2004-10-22 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
125 |
G_END_DECLS |
a8abfbc8c005
2004-10-22 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
99
diff
changeset
|
126 |
|
1 | 127 |
#endif /* __LM_MESSAGE_H__ */ |