|
1 /* |
|
2 * Copyright (c) 2010 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: Definition of comms messages used for reporting chages in system |
|
15 * settings. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H |
|
20 #define SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H |
|
21 |
|
22 #include "commsmessage.h" |
|
23 #include "logger.h" |
|
24 |
|
25 namespace java |
|
26 { |
|
27 namespace captain |
|
28 { |
|
29 |
|
30 using namespace java::util; |
|
31 using namespace java::comms; |
|
32 |
|
33 const int SETTINGS_CHANGE_EVENT_MESSAGE_ID_C = 1; |
|
34 |
|
35 const char* const SETTINGS_CHANGE_EVENT_PROVIDER = "settingslistener"; |
|
36 |
|
37 typedef enum |
|
38 { |
|
39 UNDEFINED_CHANGE = 0x00, |
|
40 MIDP_CLASS_PATH_CHANGE = 0x01, |
|
41 |
|
42 } SettingsChangeEventType_t; |
|
43 |
|
44 |
|
45 inline void setSettingsChangeEventMessageParams(CommsMessage& aMessage, |
|
46 const int& aChangeEventType) |
|
47 { |
|
48 aMessage.setMessageId(SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); |
|
49 aMessage << aChangeEventType; |
|
50 } |
|
51 |
|
52 inline void getSettingsChangeEventMessageParams(CommsMessage& aMessage, |
|
53 int& aChangeEventType) |
|
54 { |
|
55 if (aMessage.getMessageId() == SETTINGS_CHANGE_EVENT_MESSAGE_ID_C) |
|
56 { |
|
57 aMessage >> aChangeEventType; |
|
58 } |
|
59 else |
|
60 { |
|
61 ELOG2(EJavaCaptain, "Received Settings Change Event with wrong MessageId!: %d should be %d", |
|
62 aMessage.getMessageId(), SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); |
|
63 aChangeEventType = UNDEFINED_CHANGE; |
|
64 } |
|
65 } |
|
66 |
|
67 } // namespace captain |
|
68 } // namespace java |
|
69 |
|
70 #endif // SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H |