|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This header contains constants that are used in various places in IM |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CHATDEFINITIONS_H |
|
20 #define CHATDEFINITIONS_H |
|
21 |
|
22 #include "impsbuilddefinitions.h" |
|
23 |
|
24 #include <ApEngineConsts.h> |
|
25 #include <eikapp.h> |
|
26 #include <eikappui.h> |
|
27 #include <eikenv.h> |
|
28 |
|
29 |
|
30 class MCAConversationMessage; |
|
31 |
|
32 // SAP setting store keys for IM settings |
|
33 _LIT( KIMOwnMessageColourKey, "IMOwnMessageColour" ); |
|
34 _LIT( KIMOthersMessageColourKey, "IMOthersMessageColour" ); |
|
35 _LIT( KIMAlertTonePath, "IMAlertTone" ); |
|
36 |
|
37 #ifdef __WINS__ |
|
38 const TInt KIMBearerTypes = EApBearerTypeCSD | EApBearerTypeHSCSD | EApBearerTypeGPRS; |
|
39 #else |
|
40 const TInt KIMBearerTypes = EApBearerTypeGPRS; |
|
41 #endif |
|
42 |
|
43 const TInt KServerWVUserIdMaxLength = 50; |
|
44 |
|
45 const TInt KScreenNameMaxLength = 50; |
|
46 const TInt KNicknameMaxLength = 50; |
|
47 |
|
48 // maximum length in chars in query dialog |
|
49 const TInt KScreenNameQueryMaxLength = 10; |
|
50 |
|
51 // maximum length in chars for alias |
|
52 const TInt KAliasMaxLength = 50; |
|
53 |
|
54 // default maximum length in chars for message |
|
55 const TInt KDefaultMsgLength = 400; |
|
56 |
|
57 // Contact size estimate in bytes for low disk checking, |
|
58 // estimate based on member variables of CCAContact |
|
59 const TInt KContactSizeEstimate = 210; |
|
60 |
|
61 _LIT( KEmptyDesC, " " ); |
|
62 _LIT( KTab, "\t" ); |
|
63 _LIT( KEmptyCharacters, " \t" ); |
|
64 |
|
65 const TInt KFriendsListMaxIdentificationLength = 50; |
|
66 |
|
67 // chat list icons |
|
68 _LIT( KUserCreatedActiveTab, "0\t" ); |
|
69 _LIT( KUserCreatedInActiveTab, "1\t" ); |
|
70 _LIT( KNonUserCreatedActiveTab, "2\t" ); |
|
71 _LIT( KNonUserCreatedInActiveTab, "3\t" ); |
|
72 _LIT( KJoinedNotSavedTab, "4\t" ); |
|
73 #ifdef RD_CHAT_GROUP_MESSAGE_INDICATION_NEW |
|
74 _LIT( KUserCreatedActiveUnreadTab, "5\t" ); |
|
75 _LIT( KNonUserCreatedActiveUnreadTab, "6\t" ); |
|
76 _LIT( KJoinedNotSavedUnreadTab, "7\t" ); |
|
77 #endif // RD_CHAT_GROUP_MESSAGE_INDICATION_NEW |
|
78 |
|
79 //Chat list constants |
|
80 const TInt KArrayGranularity( 5 ); |
|
81 _LIT( KSpace, " " ); |
|
82 const TInt KMaxWVIDLength( 50 ); |
|
83 const TInt KMaxChatGroupLenght( 50 ); |
|
84 const TInt KMaxTabLength( 3 ); |
|
85 |
|
86 //Chat view |
|
87 _LIT( KSemicolon, ": " ); |
|
88 _LIT( KIconTabulator, "1\t" ); |
|
89 _LIT( KArabicSign, "\x200f" ); |
|
90 const TInt KChatSmileyLength( 3 ); |
|
91 const TUint KColon( ':' ); |
|
92 |
|
93 _LIT( KIMHTTPPREFIX, "http://" ); |
|
94 _LIT( KIMRTSP, "rtsp" ); |
|
95 |
|
96 //Used In Chat View |
|
97 //Length of "http" |
|
98 const TInt KHttpLength( 4 ); |
|
99 |
|
100 //Group properties dialog |
|
101 |
|
102 _LIT( KAt, "@" ); |
|
103 _LIT( KWV, "wv:" ); |
|
104 |
|
105 //Used in Chat/Conversation Container |
|
106 const TInt KHashKey = 127; |
|
107 const TInt KMaxLines = 2; |
|
108 const TInt KPictureChar = 2;//2 is for space and semicolon |
|
109 const TInt KControlCount = 2; |
|
110 //Fadecontlor constants |
|
111 const TInt KTimerInterval( 100000 ); |
|
112 |
|
113 //Main view |
|
114 const TInt KMaxListboxTitleLength( 50 ); |
|
115 //Friend list view |
|
116 const TInt KTextLimit( 40 ); // Text-limit for find-field |
|
117 |
|
118 //Search |
|
119 const TInt KMaxSearchStringLength( 50 ); |
|
120 const TInt KMaxFirstNameLength( 50 ); |
|
121 const TInt KMaxSurnameLength( 50 ); |
|
122 const TInt KMaxSearchResults( 10 ); |
|
123 const TInt KSearchLimit( 100 ); |
|
124 |
|
125 //Access array |
|
126 _LIT( KTabulator, "\t" ); |
|
127 |
|
128 //Chat info array |
|
129 const TInt KMaxLengthOfHBufC( 100 ); |
|
130 |
|
131 //Editor |
|
132 const TInt KTwo( 2 ); |
|
133 const TInt KBackspaceFix ( 1 ); |
|
134 const TInt KInsertSmileyFix( 2 ); |
|
135 const TInt KNewLineFix( 3 ); |
|
136 const TInt KRemoveSmileyFix( 4 ); |
|
137 |
|
138 // "test character identity and accents, ignore case" |
|
139 const TInt KCollationLevel = 1; |
|
140 |
|
141 //Tab format for listbox item with an icon |
|
142 _LIT( KTabFormat, "%d\t" ); |
|
143 const TInt KTabFormatLenght = 4; |
|
144 |
|
145 enum TItem |
|
146 { |
|
147 EConversationItem, |
|
148 EInviteItem, |
|
149 EGroupItem |
|
150 }; |
|
151 |
|
152 //View indexes |
|
153 enum TViewIndexes |
|
154 { |
|
155 EConvViewIndex = 0, |
|
156 EFriendsViewIndex, |
|
157 EChatRoomViewIndex, |
|
158 ERecordedChatListViewIndex, |
|
159 ERecordedChatViewIndex |
|
160 }; |
|
161 //Appui constants |
|
162 const TInt KMaxResourcePathLength = 256; |
|
163 _LIT( KLineFeed, "\n" ); |
|
164 |
|
165 _LIT( KPanicText, "WVUI" ); |
|
166 enum TCAPanics |
|
167 { |
|
168 EChatListArrayIndexOutOfBounds, |
|
169 EPrivateChatListArrayIndexOutOfBounds, |
|
170 EAccessArrayOutOfBounds, |
|
171 EChatInfoArrayNotExists, |
|
172 EChatInfoArrayIndexOutOfBounds, |
|
173 EMainViewListBoxNotExists, |
|
174 EMainViewListArrayNotExists, |
|
175 EMainViewListArrayIndexOutOfBounds, |
|
176 EIconDoesNotExist, |
|
177 EChatColourSettingItemWronglyConstructed |
|
178 }; |
|
179 |
|
180 // Invite message max-length |
|
181 const TInt KInviteMessageMaxLength = 50; |
|
182 |
|
183 |
|
184 //DNL support |
|
185 //Gorupchat |
|
186 struct TCADnlChatView |
|
187 { |
|
188 // WV specification states that GroupID can not be longer than 50 |
|
189 // characters, but since there are servers which are not implemented |
|
190 // that way, we reserve twice the amount of space. |
|
191 TBuf<2 * KMaxWVIDLength> iGroupId; |
|
192 TBuf<KMaxChatGroupLenght> iGroupName; |
|
193 TBool iIsForwarded; // ETrue if the following pointer contains forwarded message |
|
194 const MCAConversationMessage* iForwardedMessage; // pointer to forwarded message |
|
195 TBool iInviteQuery; // ETrue if the invite query should be launched |
|
196 TBool iSwitchTab; |
|
197 TInt iTabId; |
|
198 }; |
|
199 |
|
200 typedef TPckgBuf<TCADnlChatView> TCADnlChatViewBuf; |
|
201 |
|
202 //conversations |
|
203 struct TCADnlConvView |
|
204 { |
|
205 TBuf<KMaxWVIDLength> iWVID; |
|
206 TBuf<KMaxWVIDLength> iListID; |
|
207 TBool iIsForwarded; // ETrue if the following pointer contains forwarded message |
|
208 const MCAConversationMessage* iForwardedMessage; // pointer to forwarded message |
|
209 TBool iSAPChanged; // ETrue if SAP changed in opened conversation |
|
210 TBool iSwitchTab; |
|
211 TInt iTabId; |
|
212 }; |
|
213 |
|
214 typedef TPckgBuf<TCADnlConvView> TCADnlConvViewBuf; |
|
215 |
|
216 //Invitation |
|
217 const TInt KMaxIDNumberLength = 5; //also available in CCAInvitemanager |
|
218 //make sure both are synchronous |
|
219 struct TCADnlInvView |
|
220 { |
|
221 TInt iInvitationIndex; |
|
222 TBuf < KMaxWVIDLength + KMaxIDNumberLength > iInviteID; |
|
223 TBool iSwitchTab; |
|
224 TInt iTabId; |
|
225 }; |
|
226 |
|
227 |
|
228 typedef TPckgBuf<TCADnlInvView> TCADnlInvViewBuf; |
|
229 |
|
230 struct SCADnlSearchView |
|
231 { |
|
232 TBuf< KMaxWVIDLength > iListId; |
|
233 }; |
|
234 |
|
235 typedef TPckgBuf< SCADnlSearchView > TCADnlSearchViewBuf; |
|
236 |
|
237 |
|
238 //conversations |
|
239 struct TCADnlConvInvGroupFocus |
|
240 { |
|
241 TBuf<2 * KMaxWVIDLength> iInvConvGroupID; |
|
242 TBuf<KMaxWVIDLength> iListID; |
|
243 TItem iType; |
|
244 }; |
|
245 typedef TPckgBuf< TCADnlConvInvGroupFocus > TCADnlConvInvGroupFocusBuf; |
|
246 #endif // CHATDEFINITIONS_H |