javaextensions/wma/sms_cbs/src/smsplatformservice.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     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:
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include<jni.h>
       
    20 #include "serverconnectionbase.h"
       
    21 
       
    22 namespace java
       
    23 {
       
    24 namespace wma
       
    25 {
       
    26 /**
       
    27  *  CJavaMessageConnectionBase abstract class which defines
       
    28  *  the interface method that are to be implemented by the os specific class.
       
    29  */
       
    30 class SmsPlatformService
       
    31 {
       
    32 
       
    33 public:
       
    34     virtual ~SmsPlatformService()
       
    35     {
       
    36 
       
    37     }
       
    38     /**
       
    39      * Gets the Time stamp of the received message.
       
    40      * @return jlong The time value as jlong.
       
    41      */
       
    42     virtual jlong getTimeStamp() = 0;
       
    43     /**
       
    44      * Gets the Remote Host Address.
       
    45      * @param[in]  aJni Jni interface pointer
       
    46      * @return jstring The RemoteHostAddress as jstring.
       
    47      */
       
    48     virtual jstring getHostAddress(JNIEnv& aJni) =0;
       
    49     /**
       
    50      * gets the received message as jobject to java side.
       
    51      * @param[in]  aJni  Jni interface pointer.
       
    52      * @param[in] aMsgType Message type of the received message.
       
    53      * @return jobject The received message as jobject.
       
    54      */
       
    55     virtual jobject getMessageData(JNIEnv& aJni, const int aMessageType) =0;
       
    56     /**
       
    57      * Method to send the message.
       
    58      * @return int The success or Failure value.
       
    59      */
       
    60     virtual int send() =0;
       
    61     /**
       
    62      * Gets the Message type of the received Message
       
    63      * @param[in] aServerConn - server connection object.
       
    64      * @return int The type of the Message either Binary/Text Message.
       
    65      */
       
    66     virtual int receivedMessageType(ServerConnectionBase& aServerConn) =0;
       
    67     /**
       
    68      * function that calculates and returns numberofDataSegments of the Message.
       
    69      * @param[in]  aMesgType  MessageType
       
    70      * @param[in] aLength length of the message
       
    71      * @param[in] aHostPort port number
       
    72      * @param[in] ahostaddress Destination address
       
    73      * @param[in] adata Message data
       
    74      * @return int number of data segments.
       
    75      */
       
    76     virtual int getSmsDataSegments(const int aMesgType, const int aLength,
       
    77                                    const int aHostPort, const char* ahostAddress, const char*) =0;
       
    78     /**
       
    79      * Gets the new instance of OS Specific class which implements this interface
       
    80      * @param aUri - uri on which the connection to be opened.
       
    81      */
       
    82     static SmsPlatformService* getNewInstance(std::wstring aUri);
       
    83 
       
    84 };
       
    85 }
       
    86 }
       
    87