Blame view

LiveChat/SDK/include/lemon/service/rcs/mtc_d2.h 10.8 KB
9f17d59e   陈明泉   no message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
  /************************************************************************
  
          Copyright (c) 2005-2011 by Juphoon System Software, Inc.
                         All rights reserved.
  
       This software is confidential and proprietary to Juphoon System,
       Inc. No part of this software may be reproduced, stored, transmitted,
       disclosed or used in any form or by any means other than as expressly
       provided by the written license agreement between Juphoon and its
       licensee.
  
       THIS SOFTWARE IS PROVIDED BY JUPHOON "AS IS" AND ANY EXPRESS OR 
       IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
       ARE DISCLAIMED. IN NO EVENT SHALL JUPHOON BE LIABLE FOR ANY DIRECT, 
       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
       (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
       OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
       HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
       STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
       IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE. 
  
                      Juphoon System Software, Inc.
                      Email: support@juphoon.com
                      Web: http://www.juphoon.com
  
  ************************************************************************/
  /*************************************************
    File name     : mtc_doodle.h
    Module        : multimedia talk client
    Author        : xiangbo.hui
    Created on    : 2015-03-27
    Description   :
        Data structure and function declare required by MTC statistics
  
    Modify History:
    1. Date:        Author:         Modification:
  *************************************************/
  #ifndef _MTC_D2_H__
  #define _MTC_D2_H__
  
  /**
   * @file mtc_doodle.h
   * @brief MTC Doodle Interface Functions
   *
   * This file includes doodle interface function.
  */
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @brief Create image object.
   * @return            Image object.
   */
  MTCFUNC MTC_IMG Mtc_D2CreateImage(ZFUNC_VOID);
  
  /**
   * @brief Delete image object.
   * @param  zImage The image object.
   */
  MTCFUNC ZVOID Mtc_D2DeleteImage(MTC_IMG zImage);
  
  /**
   * @brief Create image object from text.
   * @param  pcMsg The text.
   * @return       The Image object.
   */
  MTCFUNC MTC_IMG Mtc_D2ParseImage(ZCONST ZCHAR *pcMsg);
  
  /**
   * @brief Save image object to text.
   * @param  zImage The image object.
   * @return        The text string.
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2PrintImage(MTC_IMG zImage);
  
  /**
   * @brief Set image parameters.
   * @param  zImage The image object.
   * @param  pcInfo The parameters in JSON format which contains
   *                @ref MtcDoodlePageIdKey
   *                @ref MtcDoodleImageTypeKey
   *                @ref MtcDoodleImageNameKey
   *                @ref MtcDoodleImageUriKey
   *                @ref MtcDoodleResolutionKey
   *                @ref MtcDoodlePositionKey
   * @return        ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SetImageParms(MTC_IMG zImage,
      ZCONST ZCHAR *pcInfo);
  
  /**
   * @brief Get image parameters.
   * @param  zImage The image object.
   * @return        The parameters in JSON format which contains
   *                @ref MtcDoodlePageIdKey
   *                @ref MtcDoodleImageTypeKey
   *                @ref MtcDoodleImageNameKey
   *                @ref MtcDoodleImageUriKey
   *                @ref MtcDoodleResolutionKey
   *                @ref MtcDoodlePositionKey
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2GetImageParms(MTC_IMG zImage);
  
  /**
   * @brief Create action object.
   * @return            The action object.
   */
  MTCFUNC MTC_ACT Mtc_D2CreateAction(ZFUNC_VOID);
  
  /**
   * @brief Delete action object.
   * @param  zAction The action object.
   */
  MTCFUNC ZVOID Mtc_D2DeleteAction(MTC_IMG zAction);
  
  /**
   * @brief Create action object from text.
   * @param  pcMsg The text.
   * @return       The action object.
   */
  MTCFUNC MTC_ACT Mtc_D2ParseAction(ZCONST ZCHAR *pcMsg);
  
  /**
   * @brief Save action object to text.
   * @param  zAction The action object.
   * @return         The text string.
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2PrintAction(MTC_IMG zAction);
  
  /**
   * @brief Set action parameters.
   * @param  zAction The action object.
   * @param  pcInfo  The parameters in JSON format which contains
   *                 @ref MtcDoodleActionTypeKey
   *                 @ref MtcDoodleSeqNoKey
   *                 @ref MtcDoodleBrushKey
   *                 @ref MtcDoodlePageIdKey
   *                 @ref MtcDoodleContentKey
   * @return         ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SetActionParms(MTC_IMG zAction,
      ZCONST ZCHAR *pcInfo);
  
  /**
   * @brief Get action parameters.
   * @param  zAction The action object.
   * @return         The parameters in JSON format which contains
   *                 @ref MtcDoodleActionTypeKey
   *                 @ref MtcDoodleSeqNoKey
   *                 @ref MtcDoodleBrushKey
   *                 @ref MtcDoodlePageIdKey
   *                 @ref MtcDoodleContentKey
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2GetActionParms(MTC_IMG zAction);
  
  /**
   * @brief Add action position.
   * @param  zAction The action object.
   * @param  fX      The X value from -1.0 to 1.0.
   * @param  fY      The Y value from -1.0 to 1.0.
   * @return         ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2AddActionPosition(MTC_ACT zAction,
      ZFLOAT fX, ZFLOAT fY);
  
  /**
   * @brief Set action positions.
   * @param  zAction The action object.
   * @param  fX      The value from -1.0 to 1.0.
   * @param  fY      The value from -1.0 to 1.0.
   * @param  iIntVal The interval.
   * @return         ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2AddActionPositionX(MTC_ACT zAction,
      ZFLOAT fX, ZFLOAT fY, ZUINT iIntVal);
  
  /**
   * @brief Get count of positions in action object.
   * @param  zAction The action object.
   * @return         The count of positions.
   */
  MTCFUNC ZUINT Mtc_D2GetActionPositionCount(MTC_ACT zAction);
  
  /**
   * @brief Get the interval of position.
   * @param  zAction The action object.
   * @param  iIndex  The index of position, from 0 to count-1.
   * @return         The interval in milliseconds.
   */
  MTCFUNC ZINT Mtc_D2GetActionIntval(MTC_ACT zAction, ZUINT iIndex);
  
  /**
   * @brief Get the X value of position.
   * @param  zAction The action object.
   * @param  iIndex  The index of position, from 0 to count-1.
   * @return         The X value of postion.
   */
  MTCFUNC ZFLOAT Mtc_D2GetActionPositionX(MTC_ACT zAction, ZUINT iIndex);
  
  /**
   * @brief Get the Y value of position.
   * @param  zAction The action object.
   * @param  iIndex  The index of position, from 0 to count-1.
   * @return         The Y value of postion.
   */
  MTCFUNC ZFLOAT Mtc_D2GetActionPositionY(MTC_ACT zAction, ZUINT iIndex);
  
  /**
   * @brief Get the path of action.
   * @param  zAction The action object.
   * @return         The path in JSON format which is array contains
   *                 all positions. Each position is array of number.
   *                 First number is interval in milliseoncds.
   *                 Second number is X value of position.
   *                 Third number is Y value of position.
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2GetActionPath(MTC_ACT zAction);
  
  /**
   * @brief Create session object.
   * @return            The session object.
   */
  MTCFUNC MTC_SESS Mtc_D2CreateSession();
  
  /**
   * @brief Delete session object.
   * @param  zSession The session object.
   */
  MTCFUNC ZVOID Mtc_D2DeleteSession(MTC_SESS zSession);
  
  /**
   * @brief Set session page count.
   * @param  zSession   The session object.
   * @param  iPageCount The page count.
   * @return          ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SessionSetPageCount(MTC_SESS zSession, ZUINT iPageCount);
  
  /**
   * @brief Add page in session.
   * @param  zSession The session object.
   * @return          ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SessionAddPage(MTC_SESS zSession);
  
  /**
   * @brief Get page count in session.
   * @param  zSession The session object.
   * @return          The page count.
   */
  MTCFUNC ZUINT Mtc_D2SessionGetPageCount(MTC_SESS zSession);
  
  /**
   * @brief Add image object to session.
   *
   * You must not delete image after add this image to the session.
   * The image will replace the exist one with same MtcDoodlePageIdKey.
   * 
   * @param  zSession The session object.
   * @param  zImage   The image object.
   * @return          ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SessionSetImage(MTC_SESS zSession, MTC_IMG zImage);
  
  /**
   * @brief Enumrate the image object.
   * @param  zSession The session object.
   * @param  iIndex   The index of image, from 0 to count-1.
   * @return          The image object.
   */
  MTCFUNC MTC_IMG Mtc_D2SessionGetImage(MTC_SESS zSession, ZUINT iPageId);
  
  /**
   * @brief Set context-free action of session.
   * @param  zSession The session object.
   * @param  pcKey    The key string.
   * @param  zAction  The action object.
   * @return          ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SessionSetCfAction(MTC_SESS zSession,
      ZCONST ZCHAR *pcKey, MTC_ACT zAction);
  
  /**
   * @brief Get context-free action of session.
   * @param  zSession The session object.
   * @param  pcKey    The key string.
   * @return          The action object when found. Otherwise return ZNULL.
   */
  MTCFUNC MTC_ACT Mtc_D2SessionGetCfAction(MTC_SESS zSession, ZCONST ZCHAR *pcKey);
  
  /**
   * @brief Get count of context-free action in session.
   * @param  zSession The session object.
   * @return          The count of context-free actions in session.
   */
  MTCFUNC ZINT Mtc_D2SessionGetCfActionCount(MTC_SESS zSession);
  
  /**
   * @brief Enumrate the key of context-free action in session.
   * @param  zSession The session object.
   * @param  iIndex   The index value, from 0 to count-1.
   * @return          The key of action.
   */
  MTCFUNC ZCONST ZCHAR * Mtc_D2SessionEnumCfActionKey(MTC_SESS zSession, ZUINT iIndex);
  
  /**
   * @brief Enumrate the context-free action in session by index.
   * @param  zSession The session object.
   * @param  iIndex   The index value, from 0 to count-1.
   * @return          The context-free action object.
   */
  MTCFUNC MTC_ACT Mtc_D2SessionEnumCfAction(MTC_SESS zSession, ZUINT iIndex);
  
  /**
   * @brief Add action object to session.
   * @param  zSession The session object.
   * @param  zAction  The action object.
   * @return          ZOK on succeed, otherwise failed.
   */
  MTCFUNC ZINT Mtc_D2SessionAddAction(MTC_SESS zSession, MTC_ACT zAction);
  
  /**
   * @brief Get count of actions.
   * @param  zSession The session object.
   * @return          The count of actions.
   */
  MTCFUNC ZUINT Mtc_D2SessionGetActionCount(MTC_SESS zSession, ZUINT iPageId);
  
  /**
   * @brief Enumrate the actions in session.
   * @param  zSession The session object.
   * @param  iIndex   The index of action, from 0 to count-1.
   * @return          The action object.
   */
  MTCFUNC MTC_ACT Mtc_D2SessionEnumAction(MTC_SESS zSession, ZUINT iPageId,
      ZUINT iIndex);
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* _MTC_D2_H__ */