mtc_prof.h
6.84 KB
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
/************************************************************************
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_prof.h
Module : multimedia talk client
Author : leo.lv
Created on : 2011-01-03
Description :
Data structure and function declare required by MTC profile
Modify History:
1. Date: Author: Modification:
*************************************************/
#ifndef _MTC_PROF_H__
#define _MTC_PROF_H__
/**
* @file mtc_prof.h
* @brief MTC Profile Interface Functions.
*
* MTC provides profile management for multi-user environment. Each user will
* have his own configuration, contact and log information. They are stored
* in a sub-directory named with user's name.
*
* To load profile of specific user, invoke @ref Mtc_CliInit and
* @ref Mtc_CliOpen. To load bob's profile in "profiles" directory, use code:
* @code
//initialize the client
Mtc_CliInit("profiles");
// initialize callback functions
Mtc_CliCbSetPrint(print callback);
Mtc_CliCbSetRegOk(register ok callback);
Mtc_CliCbSetRegFailed(register failed callback);
... (other callbacks)
Mtc_CliOpen("bob");
* @endcode
*
* It can also not to use profile management. Just use code:
* @code
//initialize the client
Mtc_CliInit(profile director);
// initialize callback functions
Mtc_CliCbSetPrint(print callback);
Mtc_CliCbSetRegOk(register ok callback);
Mtc_CliCbSetRegFailed(register failed callback);
... (other callbacks)
Mtc_CliOpen(ZNULL);
* @endcode
* Now the configuration is default. It may not work properly. So before
* @ref Mtc_CliStart, GUI should sets configuration using @ref mtc_cli_db.h etc
* "MTC DB Interfaces".
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @brief The profile mode mask */
#define MTC_PROV_MEDIA_MASK 0xFF
#ifndef SDK_ESSENTIAL
#define MTC_PROV_SERVICE_MASK 0xFF00
#endif
/** @brief The profile media mode type. */
typedef enum EN_MTC_PROF_MEDIA_MODE
{
EN_MTC_PROF_MEDIA_BASE = 0x00, /**<@brief Profile media base. */
EN_MTC_PROF_MEDIA_ENHANCE = 0x01 /**<@brief Profile media enhance. */
} EN_MTC_PROF_MEDIA_MODE;
#ifndef SDK_ESSENTIAL
/** @brief The profile service mode type. */
typedef enum EN_MTC_PROF_SERVICE_MODE
{
EN_MTC_PROF_SERVICE_VOIP = 0x0000, /**<@brief Profile service voip. */
EN_MTC_PROF_SERVICE_MMTEL = 0x0100, /**<@brief Profile service MMTEL. */
EN_MTC_PROF_SERVICE_RCSE = 0x0200, /**<@brief Profile service RCSE. */
EN_MTC_PROF_SERVICE_RCS = 0x0400, /**<@brief Profile service RCS. */
EN_MTC_PROF_SERVICE_RCS5 = 0x0800, /**<@brief Profile service RCS5. */
} EN_MTC_PROF_SERVICE_MODE;
#endif
/**
* @brief Get user count in profile management.
*
* This interface should be invoke after @ref Mtc_CliInit was called.
*
* @return The profile user size.
*/
MTCFUNC ZINT Mtc_ProfGetUserSize(ZFUNC_VOID);
/**
* @brief MTC profile get user name by index
*
* This interface should be invoke after @ref Mtc_CliInit was called.
*
* @param [in] iIndex The index in profile list, 0 to size - 1.
*
* @return The user name string.
* The caller must copy it, then use.
*/
MTCFUNC ZCHAR * Mtc_ProfGetUser(ZINT iIndex);
/**
* @brief MTC profile get current user.
*
* This interface should be invoke after @ref Mtc_CliInit and
* @ref Mtc_CliOpen was called.
*
* @return The current user string, if client is not open return ZNULL.
*/
MTCFUNC ZCHAR * Mtc_ProfGetCurUser(ZFUNC_VOID);
/**
* @brief MTC profile create a user.
*
* This interface should be invoke after @ref Mtc_CliInit was called.
*
* @param [in] pcUserName The new user name.
*
* @retval ZOK Create a user successfully.
* @retval ZFAILED Create a user failed.
*/
MTCFUNC ZINT Mtc_ProfCreateUser(ZCHAR *pcUserName);
/**
* @brief MTC profile delete a user.
*
* This interface should be invoke after @ref Mtc_CliInit was called.
*
* @param [in] pcUserName The name of the user will be deleted.
*
* @retval ZOK Delete a user successfully.
* @retval ZFAILED Delete a user failed.
*/
MTCFUNC ZINT Mtc_ProfDeleteUser(ZCHAR *pcUserName);
/**
* @brief MTC profile check exist the user.
*
* This interface should be invoke after @ref Mtc_CliInit was called.
*
* @param [in] pcUserName The name of the user will be checked.
*
* @retval ZTRUE The user is exist.
* @retval ZFALSE The user is not exist.
*/
MTCFUNC ZBOOL Mtc_ProfExistUser(ZCHAR *pcUserName);
/**
* @brief MTC profile save configuration of current user.
*
* This interface should be invoke after @ref Mtc_CliInit and
* @ref Mtc_CliOpen was called.
*
* @retval ZOK Save provision successfully.
* @retval ZFAILED Save provision failed.
*/
MTCFUNC ZINT Mtc_ProfSaveProvision(ZFUNC_VOID);
/**
* @brief MTC profile reset configuration of current user.
*
* This interface should be invoke after @ref Mtc_CliInit and
* @ref Mtc_CliOpen was called.
*
* @retval ZOK Reset provision successfully.
* @retval ZFAILED Reset provision failed.
*/
MTCFUNC ZINT Mtc_ProfResetProvision(ZFUNC_VOID);
/**
* @brief MTC profile restore configuration of current user for speicifc mode.
*
* @param [in] iMode The combination of @ref EN_MTC_PROF_SERVICE_MODE
and @ref EN_MTC_PROF_MEDIA_MODE.
*
* This interface should be invoke after @ref Mtc_CliInit and
* @ref Mtc_CliOpen was called.
*
* @retval ZOK Restore provision successfully.
* @retval ZFAILED Restore provision failed.
*/
MTCFUNC ZINT Mtc_ProfRestoreProvision(ZUINT iMode);
#ifdef __cplusplus
}
#endif
#endif /* _MTC_PROF_H__ */