|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MMSPLATFORMSERVICE_H |
|
19 #define MMSPLATFORMSERVICE_H |
|
20 |
|
21 #include <jni.h> |
|
22 #include "connectionlistener.h" |
|
23 /** |
|
24 * CMMSPlatformService is an abstract method that declares |
|
25 * the interface methods that are defined by the |
|
26 * OS Specific Class. |
|
27 */ |
|
28 namespace java |
|
29 { |
|
30 namespace wma |
|
31 { |
|
32 |
|
33 class MMSPlatformService |
|
34 { |
|
35 |
|
36 public: |
|
37 /** |
|
38 * Virtual Destructor |
|
39 */ |
|
40 virtual ~MMSPlatformService() |
|
41 { |
|
42 } |
|
43 |
|
44 /** |
|
45 * Converts the Message to the Native Format and sends it. |
|
46 * @param aJni - jni interface pointer |
|
47 * @param aJavaBuffer - the serialized message buffer from java side. |
|
48 * @param aOffset - offset |
|
49 * @param aLength - length of the message. |
|
50 * @param aDestination - destination address |
|
51 */ |
|
52 virtual int send(JNIEnv& aJni, jbyteArray aJavaBuffer, jint aOffset, |
|
53 jint aLength, jstring aDestination) = 0; |
|
54 |
|
55 /** |
|
56 * Retrieves the received message. |
|
57 * @param aJni - jni interface pointer. |
|
58 */ |
|
59 virtual jbyteArray retrieveMessage(JNIEnv& aJni) = 0; |
|
60 |
|
61 /** |
|
62 * Closes the connections. |
|
63 * @param aJni - jni interface pointer |
|
64 * @param aPeer - java side object reference. |
|
65 */ |
|
66 virtual void closeConnection(JNIEnv& aJni, jobject aPeer)=0; |
|
67 /** |
|
68 * Gets number of messages |
|
69 */ |
|
70 virtual int getNumberOfMessages() = 0; |
|
71 /** |
|
72 * Gets the instance of OS Specific class which implements this interface |
|
73 * @param aJni - jni interface pointer |
|
74 * @param aPeer - java side peer reference. |
|
75 * @param aServerConnection - boolean value to identify client/server |
|
76 * connection. |
|
77 * @param aUri - uri on which the connection to be opened. |
|
78 * @param aListener - listener to be notified about incoming messages. |
|
79 */ |
|
80 static MMSPlatformService* getInstance(JNIEnv& aJni, jobject aPeer, |
|
81 const bool aServerConnection, |
|
82 const std::wstring& aUri, |
|
83 java::push::ConnectionListener* aListener); |
|
84 }; |
|
85 } //namespace wma |
|
86 } //namespace java |
|
87 #endif // MMSPLATFORMSERVICE_H |