33
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 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: Contains constants (version number, request codes) used by the server.*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
#ifndef CBSSERVERCONSTANTS_H
|
|
19 |
#define CBSSERVERCONSTANTS_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
|
|
23 |
#include <e32base.h>
|
|
24 |
#include "CbsCommon.h"
|
|
25 |
|
|
26 |
// CONSTANTS
|
|
27 |
|
|
28 |
// How long to wait if the server was locked by backup. Time in microseconds.
|
|
29 |
const TInt KTimeToWaitForBackup = 100000;
|
|
30 |
|
|
31 |
// How many times to retry if the server is locked.
|
|
32 |
const TInt KMaxRetryTimes = 50;
|
|
33 |
|
|
34 |
// Name of CbsServer thread
|
|
35 |
_LIT( KCbsServerName, "CbsServer" );
|
|
36 |
|
|
37 |
// Server major version number
|
|
38 |
const TInt KCbsServerVersionMajor = 1;
|
|
39 |
|
|
40 |
// Server minor version number
|
|
41 |
const TInt KCbsServerVersionMinor = 2;
|
|
42 |
|
|
43 |
// Server build number
|
|
44 |
const TInt KCbsServerVersionBuild = 0;
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Enumeration of client requests.
|
|
48 |
*/
|
|
49 |
enum TCbsServerRequest
|
|
50 |
{
|
|
51 |
// RCbs requests
|
|
52 |
ECbsCloseSession,
|
|
53 |
ECbsCreateSettingsSubsession,
|
|
54 |
ECbsCreateTopicListSubsession,
|
|
55 |
ECbsCreateTopicMessagesSubsession,
|
|
56 |
ECbsCreateTopicCollectionSubsession,
|
|
57 |
ECbsShutdown,
|
|
58 |
|
|
59 |
// RCbsSettings subsession requests
|
|
60 |
ECbsCloseSettingsSubsession,
|
|
61 |
ECbsSetReceptionStatus,
|
|
62 |
ECbsGetReceptionStatus,
|
|
63 |
ECbsSetTopicDetectionStatus,
|
|
64 |
ECbsGetTopicDetectionStatus,
|
|
65 |
ECbsGetLanguages,
|
|
66 |
ECbsSetLanguages,
|
|
67 |
ECbsNotifySettingsChanged,
|
|
68 |
ECbsNotifySettingsChangedCancel,
|
|
69 |
|
|
70 |
// RCbsTopicList subsession requests
|
|
71 |
ECbsCloseTopicListSubsession,
|
|
72 |
ECbsGetTopicCount,
|
|
73 |
ECbsGetTopic,
|
|
74 |
ECbsFindTopicByNumber,
|
|
75 |
ECbsDeleteTopic,
|
|
76 |
ECbsAddTopic,
|
|
77 |
ECbsChangeTopicNameAndNumber,
|
|
78 |
ECbsChangeTopicSubscriptionStatus,
|
|
79 |
ECbsChangeTopicHotmarkStatus,
|
|
80 |
ECbsNotifyOnEvent,
|
|
81 |
ECbsNotifyOnEventCancel,
|
|
82 |
ECbsGetNewTopicsCount,
|
|
83 |
ECbsGetLatestTopicNumber,
|
|
84 |
ECbsGetUnreadMessageCount,
|
|
85 |
ECbsGetHotmarkedMessageHandle,
|
|
86 |
ECbsGetUnreadHotmarkedMessageCount,
|
|
87 |
ECbsDeleteAll,
|
|
88 |
ECbsGetNextAndPrevTopicNumber,
|
|
89 |
|
|
90 |
// RCbsTopicMessages subsession requests
|
|
91 |
ECbsCloseTopicMessagesSubsession,
|
|
92 |
ECbsGetMessageCount,
|
|
93 |
ECbsGetMessage,
|
|
94 |
ECbsFindMessageByHandle,
|
|
95 |
ECbsGetMessageIndexByHandle,
|
|
96 |
ECbsDeleteMessage,
|
|
97 |
ECbsSaveMessage,
|
|
98 |
ECbsReadMessage,
|
|
99 |
ECbsLockMessage,
|
|
100 |
ECbsGetMessageContents,
|
|
101 |
ECbsGetNextAndPrevMsgHandle,
|
|
102 |
|
|
103 |
// RCbsTopicCollection subsession requests
|
|
104 |
ECbsCloseTopicCollectionSubsession,
|
|
105 |
ECbsGetTopicInfoCount,
|
|
106 |
ECbsGetTopicInfo,
|
|
107 |
ECbsGetTopicInfoCountNotListed,
|
|
108 |
ECbsTopicInList,
|
|
109 |
ECbsNotifyOnChange,
|
|
110 |
ECbsNotifyOnChangeCancel,
|
|
111 |
ECbsGetUnlistedTopicIndexies,
|
|
112 |
|
|
113 |
// RCbsMcnSession requests
|
|
114 |
EMcnCreateSubsession,
|
|
115 |
EMcnCloseSession,
|
|
116 |
EMcnNotifyOnChange,
|
|
117 |
EMcnNotifyOnChangeCancel,
|
|
118 |
EMcnGetCellInfo,
|
|
119 |
EMcnSubscribeTopic,
|
|
120 |
EMcnClearSubscriptions,
|
|
121 |
EMcnNoMoreSubscriptions,
|
|
122 |
EMcnCloseSubsession,
|
|
123 |
EMcnGetInfoMessage
|
|
124 |
};
|
|
125 |
|
|
126 |
// Number of message slots used in server-client ITC.
|
|
127 |
const TInt KCbsServerDefaultSlots = 4;
|
|
128 |
|
|
129 |
// Header size of a CB message page in bytes.
|
|
130 |
const TInt KCbsCbMsgHeaderSize = 6;
|
|
131 |
|
|
132 |
// Maximum characters in page
|
|
133 |
const TInt KCbsMaxCharsInPage = 93;
|
|
134 |
|
|
135 |
// DATA TYPES
|
|
136 |
|
|
137 |
// Used by RCbs::GetNextAndPrevTopicNumber to transfer request results
|
|
138 |
// from server to client.
|
|
139 |
struct TCbsNextPrevTopicAndPosition
|
|
140 |
{
|
|
141 |
TCbsTopicNumber iPrevTopic;
|
|
142 |
TCbsTopicNumber iNextTopic;
|
|
143 |
TInt iPosition;
|
|
144 |
};
|
|
145 |
|
|
146 |
// Used by RCbs::GetNextAndPrevMsgHandle to transfer request results
|
|
147 |
// from server to client.
|
|
148 |
struct TCbsNextPrevMsgAndPosition
|
|
149 |
{
|
|
150 |
TCbsMessageHandle iPrevMsg;
|
|
151 |
TCbsMessageHandle iNextMsg;
|
|
152 |
TInt iPosition;
|
|
153 |
};
|
|
154 |
|
|
155 |
// Used by active objects to determine the command type.
|
|
156 |
enum TCbsServerEtelCommand
|
|
157 |
{
|
|
158 |
ECbsReceiveMessage,
|
|
159 |
ECbsSetFilterSetting,
|
|
160 |
ECbsGetLanguageFilter,
|
|
161 |
ECbsSetLanguageFilter,
|
|
162 |
ECbsRetrieveBroadcastIdList,
|
|
163 |
ECbsStoreBroadcastIdList,
|
|
164 |
ECbsBroadcastListCancelAll,
|
|
165 |
ECbsCommandTypeNotSet
|
|
166 |
};
|
|
167 |
|
|
168 |
// District info message topic.
|
|
169 |
const TInt KCellInfoTopic = 50;
|
|
170 |
|
|
171 |
// HomeZone message topic.
|
|
172 |
const TInt KHomeZoneTopic = 221;
|
|
173 |
|
|
174 |
#endif // CBSSERVERCONSTANTS_H
|
|
175 |
|
|
176 |
// End of File
|
|
177 |
|
|
178 |
|