javaextensions/midppush/pushregistryplugin/inc/pushconncompletedtimercontainer.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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 #ifndef PUSHCONNCOMPLETEDTIMERCONTAINER_H
       
    20 #define PUSHCONNCOMPLETEDTIMERCONTAINER_H
       
    21 
       
    22 #include <list>
       
    23 #include <string>
       
    24 #include "commsmessage.h"
       
    25 #include "timerserverinterface.h"
       
    26 
       
    27 namespace java
       
    28 {
       
    29 namespace push
       
    30 {
       
    31 
       
    32 class PushConnCompletedTimerListener
       
    33 {
       
    34 public:
       
    35 
       
    36     virtual ~PushConnCompletedTimerListener() {}
       
    37 
       
    38     virtual void connCompletedTimerExpired(const java::comms::CommsMessage& aMsg) = 0;
       
    39 
       
    40 };
       
    41 
       
    42 class PushConnCompletedTimer
       
    43 {
       
    44 public:
       
    45 
       
    46     PushConnCompletedTimer(int aTimerId,const std::wstring& aUri,
       
    47                            const java::comms::CommsMessage& aCommsMsg);
       
    48 
       
    49     virtual ~PushConnCompletedTimer();
       
    50 
       
    51     PushConnCompletedTimer(const PushConnCompletedTimer&);
       
    52 
       
    53     PushConnCompletedTimer& operator=(const PushConnCompletedTimer&);
       
    54 
       
    55     //Datamembers.
       
    56     int mTimerId;
       
    57     std::wstring mUri;
       
    58     java::comms::CommsMessage mCommsMsg;
       
    59 
       
    60 };
       
    61 
       
    62 class PushConnCompletedTimerContainer : public java::captain::TimerServerEventsInterface
       
    63 {
       
    64 public:
       
    65 
       
    66     PushConnCompletedTimerContainer(java::captain::TimerServerInterface& aTimerServer,
       
    67                                     PushConnCompletedTimerListener& aListener);
       
    68 
       
    69     virtual ~PushConnCompletedTimerContainer();
       
    70 
       
    71     /**
       
    72      * Sets timeout timer for IPC_PR_UNREG_COMPLETED comms message.
       
    73      * @param aUri URI of the unregistered push connection.
       
    74      * @param aMsg Comms msg of the IPC_PR_UNREGISTER_DYNAMIC_PUSH_CONN.
       
    75      * @throws This operation does not throw exceptions.
       
    76      */
       
    77     void setTimer(const std::wstring& aUri,const java::comms::CommsMessage& aMsg);
       
    78 
       
    79     /**
       
    80      * Cancels timer. Agter cancellation of the timer this operation
       
    81      * calls unregTimerExpired() operation.
       
    82      * @param aUri URI of the unregistered push connection.
       
    83      * @throws This operation does not throw exceptions.
       
    84      */
       
    85     void cancelTimer(const std::wstring& aUri);
       
    86 
       
    87     //TimerServerEventsInterface
       
    88     virtual void timerTimeout(const int& aTimerId);
       
    89 
       
    90 private:
       
    91 
       
    92     //Datamembers.
       
    93     java::captain::TimerServerInterface& mTimerServer;
       
    94     PushConnCompletedTimerListener& mListener;
       
    95     typedef std::list<PushConnCompletedTimer> TimerList_t;
       
    96     typedef std::list<PushConnCompletedTimer>::iterator TimerListIter_t;
       
    97     TimerList_t mTimerList;
       
    98 
       
    99     //Not implemented.
       
   100     PushConnCompletedTimerContainer(const PushConnCompletedTimerContainer&);
       
   101     PushConnCompletedTimerContainer& operator=(const PushConnCompletedTimerContainer&);
       
   102 
       
   103 };
       
   104 
       
   105 }//end namespace push
       
   106 }//end namespace java
       
   107 
       
   108 #endif // PUSHCONNCOMPLETEDTIMERCONTAINER_H
       
   109