javaextensions/pim/agnadapter/src.s60/cpimagnserverwait.cpp
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:  Synchronizes operations with Agenda server
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cpimagnserverwait.h"
       
    21 #include "logger.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CPIMAgnServerWait::CPIMAgnServerWait
       
    27 // C++ default constructor can NOT contain any code, that
       
    28 // might leave.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CPIMAgnServerWait::CPIMAgnServerWait() :
       
    32         CTimer(EPriorityStandard)
       
    33 {
       
    34     JELOG2(EPim);
       
    35     CActiveScheduler::Add(this);
       
    36 }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CPIMAgnServerWait::NewL
       
    40 // Two-phased constructor.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CPIMAgnServerWait* CPIMAgnServerWait::NewL()
       
    44 {
       
    45     JELOG2(EPim);
       
    46     CPIMAgnServerWait* self = NewLC();
       
    47     CleanupStack::Pop(self);
       
    48     return self;
       
    49 }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CPIMAgnServerWait::NewL
       
    53 // Two-phased constructor. Puts the object to cleanup stack.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CPIMAgnServerWait* CPIMAgnServerWait::NewLC()
       
    57 {
       
    58     JELOG2(EPim);
       
    59     CPIMAgnServerWait* self = new(ELeave) CPIMAgnServerWait;
       
    60     CleanupStack::PushL(self);
       
    61     self->ConstructL();
       
    62     return self;
       
    63 }
       
    64 
       
    65 void CPIMAgnServerWait::ConstructL()
       
    66 {
       
    67     JELOG2(EPim);
       
    68     CTimer::ConstructL();
       
    69 }
       
    70 // Destructor
       
    71 CPIMAgnServerWait::~CPIMAgnServerWait()
       
    72 {
       
    73     JELOG2(EPim);
       
    74 }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CPIMAgnServerWait::WaitCompleteL
       
    78 //
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 TInt CPIMAgnServerWait::WaitCompleteL(TTimeIntervalMicroSeconds32 aTimeout)
       
    82 {
       
    83     JELOG2(EPim);
       
    84     After(aTimeout);
       
    85     CActiveScheduler::Start();
       
    86     Cancel();
       
    87     return 0;
       
    88 }
       
    89 void CPIMAgnServerWait::RunL()
       
    90 {
       
    91     JELOG2(EPim);
       
    92     CActiveScheduler::Stop();
       
    93 }
       
    94 
       
    95 TInt CPIMAgnServerWait::RunError(TInt /*aError*/)
       
    96 {
       
    97     JELOG2(EPim);
       
    98     return 0;
       
    99 }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CPIMAgnServerWait::Progress
       
   103 // Handles progress notifications from Agenda server.
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 void CPIMAgnServerWait::Progress(TInt /* aPercentageCompleted */)
       
   107 {
       
   108     JELOG2(EPim);
       
   109     // Ignored.
       
   110 }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CPIMAgnServerWait::Completed
       
   114 // Handles completion notifications from Agenda server.
       
   115 // Completes the request in the synchronizer.
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 void CPIMAgnServerWait::Completed(TInt /*aError*/)
       
   119 {
       
   120     JELOG2(EPim);
       
   121     CActiveScheduler::Stop();
       
   122 }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CPIMAgnServerWait::NotifyProgress
       
   126 // Informs Agenda server that we are not interested in progress notifications.
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 TBool CPIMAgnServerWait::NotifyProgress()
       
   130 {
       
   131     JELOG2(EPim);
       
   132     return EFalse;
       
   133 }
       
   134 
       
   135 //  End of File