keepalive/flextimer/server/inc/mflextimerservice.h
changeset 32 5c4486441ae6
equal deleted inserted replaced
31:c16e04725da3 32:5c4486441ae6
       
     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:
       
    15  * This class contains definition of MFlexTimerService
       
    16  *
       
    17  */
       
    18 /*
       
    19  * %version: 1 %
       
    20  */
       
    21 // Protection against nested includes
       
    22 #ifndef MFLEXTIMERSERVICE_H
       
    23 #define MFLEXTIMERSERVICE_H
       
    24 
       
    25 //Forward declarations
       
    26 class TTime;
       
    27 class MFlexTimerServiceCB;
       
    28 
       
    29 // Class declaration
       
    30 /**
       
    31  *  Interface to flexible timer engine. This interface is used by client
       
    32  *  sessions to start and cancel timers.
       
    33  */
       
    34 class MFlexTimerService
       
    35     {
       
    36 public:
       
    37 
       
    38     /** Pure virtual functions*/
       
    39     /**
       
    40      * Function for adding a new timer with specified parameters. 
       
    41      * After timer expires aFlexTimerServiceCB is used to inform a client
       
    42      * session about that. Both parameter times should be in the future
       
    43      * and min should be earlier than max
       
    44      * 
       
    45      * @param aWinStartInterval Time interval from present to left side of the
       
    46      *  window
       
    47      * @param aWinEndInterval Time interval from present to right side of the
       
    48      *  window
       
    49      * @param aCancelAtSystemTimeChange Whether timer should be aborted if
       
    50      *  system time changes.
       
    51      * @param aFlexTimerServiceCB Callback interface for timer
       
    52      *  expiration (also used as an ID)
       
    53      * 
       
    54      * @return KErrNone or some other system wide error code.
       
    55      *
       
    56      */
       
    57     virtual TInt AddTimer(
       
    58             const TTimeIntervalMicroSeconds& aWinStartInterval,
       
    59             const TTimeIntervalMicroSeconds& aWinEndInterval,
       
    60             TBool aCancelAtSystemTimeChange,
       
    61             const MFlexTimerServiceCB* aFlexTimerServiceCB ) = 0;
       
    62 
       
    63     /**
       
    64      * Function for cancellin a running timer. After this function returns,
       
    65      * all references to corresponding timer are deleted and they can not be
       
    66      * referred again.
       
    67      * 
       
    68      * @param aFlexTimerServiceCB ID used when timer was added
       
    69      * @return KErrNone or some other system wide error code.
       
    70      */
       
    71     virtual TInt CancelTimer(
       
    72             const MFlexTimerServiceCB* aFlexTimerServiceCB ) = 0;
       
    73 
       
    74     };
       
    75 
       
    76 #endif  /* MFLEXTIMERSERVICE_H */