|
1 /* |
|
2 * Copyright (c) 2008 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: Comms server, part of OMJ S60 preinstaller process |
|
15 * When started in 'poll' mode Java Installer connects to |
|
16 * this server to get install commands. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef PREINSTALLCOMMSSERVER_H |
|
22 #define PREINSTALLCOMMSSERVER_H |
|
23 |
|
24 #include <string> |
|
25 #include <vector> |
|
26 |
|
27 #include "commslistener.h" |
|
28 #include "commsserverendpoint.h" |
|
29 #include "commsmessage.h" |
|
30 |
|
31 using namespace java::comms; |
|
32 |
|
33 /** |
|
34 * The messages known by Preinstall Server |
|
35 */ |
|
36 |
|
37 const int GET_NEXT_OPERATION_MESSAGE_ID = 500; |
|
38 const int OPERATION_MESSAGE_ID = 501; |
|
39 const int OPERATION_RESULT_MESSAGE_ID = 502; |
|
40 |
|
41 /** |
|
42 * The known operations inside messages |
|
43 */ |
|
44 |
|
45 const int INSTALL_OPERATION = 0; |
|
46 const int UNINSTALL_OPERATION = 1; |
|
47 const int EXIT_OPERATION = 2; |
|
48 |
|
49 OS_NONSHARABLE_CLASS(PreinstallCommsServer) : public CommsListener |
|
50 { |
|
51 public: |
|
52 PreinstallCommsServer(); |
|
53 virtual ~PreinstallCommsServer(); |
|
54 |
|
55 void setJadFiles(RPointerArray<HBufC> &aJadFiles); |
|
56 |
|
57 // CommsListener methods |
|
58 virtual void processMessage(CommsMessage& aMessage); |
|
59 |
|
60 int start(); |
|
61 int stop(); |
|
62 |
|
63 CommsEndpoint* getComms() |
|
64 { |
|
65 return &mComms; |
|
66 } |
|
67 |
|
68 private: |
|
69 int mRunning; // 1 if running, 0 if not running |
|
70 int mJadIndex; // Index of the next JAD file to be installed |
|
71 std::vector<std::wstring> mJadFiles; // The JAD files to be installer |
|
72 CommsServerEndpoint mComms; |
|
73 }; |
|
74 |
|
75 #endif // PREINSTALLCOMMSSERVER_H |