javaextensions/pim/agnadapter/inc.s60/cpimagnserverwait.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14: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:  Synchronizes operations with Agenda server
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMAGNSERVERWAIT_H
       
    20 #define CPIMAGNSERVERWAIT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <calprogresscallback.h>
       
    25 
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  *  Waits for completion of current Agenda operation on request.
       
    31  */
       
    32 class CPIMAgnServerWait: public CTimer, public MCalProgressCallBack
       
    33 {
       
    34 public:
       
    35     // Constructors and destructor
       
    36 
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      */
       
    40     static CPIMAgnServerWait* NewL();
       
    41 
       
    42     /**
       
    43      * Two-phased constructor. Puts the object to cleanup stack.
       
    44      */
       
    45     static CPIMAgnServerWait* NewLC();
       
    46 
       
    47     /**
       
    48      * Destructor.
       
    49      */
       
    50     virtual ~CPIMAgnServerWait();
       
    51 
       
    52 public:
       
    53     // New functions
       
    54 
       
    55     /**
       
    56      * Waits for Agenda server to notify that current operation is
       
    57      * completed.
       
    58      *
       
    59      *
       
    60      * @param aTimeout Maximum time to wait, or 0 for no timeout.
       
    61      *        Optional, defaults to 0.
       
    62      *
       
    63      * @return KErrNone on success, one of systemwide error codes on error.
       
    64      */
       
    65     TInt WaitCompleteL(TTimeIntervalMicroSeconds32 aTimeout);
       
    66     inline TInt WaitCompleteL();
       
    67 
       
    68 public:
       
    69     // Functions from MCalProgressCallBack
       
    70 
       
    71     void Progress(TInt aPercentageCompleted);
       
    72     void Completed(TInt aError);
       
    73     TBool NotifyProgress();
       
    74 
       
    75     //Timer
       
    76 
       
    77     void RunL();
       
    78     TInt RunError(TInt error);
       
    79 
       
    80 private:
       
    81 
       
    82     /**
       
    83      * C++ default constructor.
       
    84      */
       
    85     CPIMAgnServerWait();
       
    86 
       
    87     void ConstructL();
       
    88 
       
    89 
       
    90 };
       
    91 
       
    92 // INLINE FUNCTIONS
       
    93 inline TInt CPIMAgnServerWait::WaitCompleteL()
       
    94 {
       
    95     return WaitCompleteL(0);
       
    96 }
       
    97 
       
    98 #endif // CPIMAGNSERVERWAIT_H
       
    99 // End of File