locationsystemui/locationsysui/queryandnotification/src/EPos_CPosRequestHandler.cpp
branchRCL_3
changeset 8 6fcbaa43369c
equal deleted inserted replaced
7:19bff11d6c18 8:6fcbaa43369c
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:   Class for privacy notifier request handling helper.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <EPos_CPosPrivacyNotifier.h>
       
    21 #include "EPos_CPosRequestHandler.h"
       
    22 #include "EPos_CPosPrivacyNotifierExtension.h"
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 // C++ default constructor can NOT contain any code, that
       
    27 // might leave.
       
    28 //
       
    29 CPosRequestHandler::CPosRequestHandler() :
       
    30     CActive(CActive::EPriorityHigh)
       
    31     {
       
    32     }
       
    33 
       
    34 // EPOC default constructor can leave.
       
    35 void CPosRequestHandler::ConstructL(
       
    36     CPosPrivacyNotifier* aNotifier,
       
    37     CPosPrivacyNotifierExtension* aExtension)
       
    38     {
       
    39     iPrivacyNotifier = aNotifier;
       
    40     iExtension = aExtension;
       
    41     CActiveScheduler::Add(this);
       
    42     }
       
    43 
       
    44 // Two-phased constructor.
       
    45 CPosRequestHandler* CPosRequestHandler::NewL(
       
    46     CPosPrivacyNotifier* aNotifier,
       
    47     CPosPrivacyNotifierExtension* aExtension)
       
    48     {
       
    49     CPosRequestHandler* self =
       
    50         new(ELeave) CPosRequestHandler;
       
    51     CleanupStack::PushL(self);
       
    52     self->ConstructL(aNotifier, aExtension);
       
    53     CleanupStack::Pop(self);
       
    54     return self;
       
    55     }
       
    56 
       
    57 // Destructor
       
    58 CPosRequestHandler::~CPosRequestHandler()
       
    59     {
       
    60     Cancel();
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // CPosRequestHandler::ScheduleRequest
       
    65 //
       
    66 // (other items were commented in a header).
       
    67 // ---------------------------------------------------------
       
    68 //
       
    69 void CPosRequestHandler::ScheduleRequest(const TPosQNInputData& aInputData)
       
    70     {
       
    71     iInputData = aInputData;
       
    72 
       
    73     SetActive();
       
    74     TRequestStatus* status = &iStatus;
       
    75     User::RequestComplete(status, KErrNone);
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------
       
    79 // CPosRequestHandler::RunL
       
    80 //
       
    81 // (other items were commented in a header).
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 void CPosRequestHandler::RunL()
       
    85     {
       
    86     iPrivacyNotifier->HandleNewRequestL(iInputData.iId);
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CPosRequestHandler::DoCancel
       
    91 //
       
    92 // (other items were commented in a header).
       
    93 // ---------------------------------------------------------
       
    94 //
       
    95 void CPosRequestHandler::DoCancel()
       
    96     {
       
    97     }
       
    98 
       
    99 // ---------------------------------------------------------
       
   100 // CPosRequestHandler::RunError
       
   101 //
       
   102 // (other items were commented in a header).
       
   103 // ---------------------------------------------------------
       
   104 //
       
   105 TInt CPosRequestHandler::RunError(TInt aError)
       
   106     {
       
   107     iExtension->CompleteRequest(iInputData.iId, aError);
       
   108     return KErrNone;
       
   109     }
       
   110 
       
   111 //  End of File