locationtriggering/ltcontainer/src/lbtlisttriggerao.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 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:  location triggering server client interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32base.h>
       
    21 #include "lbtlisttriggerao.h"
       
    22 #include "lbtlisttriggerobserver.h"
       
    23 #include "lbtlogger.h"
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // ================= LOCAL FUNCTIONS ========================
       
    30  
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 //
       
    36 
       
    37 CLbtListTriggerAO::CLbtListTriggerAO(MLbtListTriggerObserver& aObserver ):
       
    38 CActive(EPriorityStandard),
       
    39 iClientStatus(NULL),
       
    40 iObserver(aObserver)   
       
    41     
       
    42       {
       
    43    
       
    44     CActiveScheduler::Add(this);
       
    45     
       
    46     }
       
    47 
       
    48 // EPOC default constructor can leave.
       
    49 void CLbtListTriggerAO::ConstructL()
       
    50     {
       
    51 
       
    52     }
       
    53 
       
    54 // Two-phased constructor.
       
    55 CLbtListTriggerAO* CLbtListTriggerAO::NewL(MLbtListTriggerObserver& aObserver)
       
    56     {
       
    57    
       
    58     CLbtListTriggerAO* self = new (ELeave) CLbtListTriggerAO(aObserver);
       
    59     CleanupStack::PushL(self);
       
    60     self->ConstructL();
       
    61     CleanupStack::Pop(self);
       
    62     return self;
       
    63     }
       
    64    
       
    65 
       
    66 // Destructor
       
    67 CLbtListTriggerAO::~CLbtListTriggerAO()
       
    68     {
       
    69    
       
    70 	if (IsActive())      
       
    71       	Cancel();
       
    72     }
       
    73 
       
    74 
       
    75 // ---------------------------------------------------------
       
    76 // CLbtTriggerChangeEventNotifier::Start
       
    77 //
       
    78 // (other items were commented in a header).
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 void CLbtListTriggerAO::Start()
       
    82     {
       
    83  	SetActive();
       
    84     }
       
    85     
       
    86 
       
    87  
       
    88 
       
    89 void CLbtListTriggerAO::ListTriggers(
       
    90     CLbtContainerListOptions* aFilter,
       
    91     RPointerArray < CLbtContainerTriggerEntry >& aTriggers,
       
    92     RPointerArray<MLbtTriggerStore>& aTriggerStores)
       
    93     {
       
    94     TInt error = KErrNone;    
       
    95     TRequestStatus* status=&iStatus;
       
    96     for (TInt i = 0; i < aTriggerStores.Count(); i++)
       
    97         {
       
    98             TRAP(error, aTriggerStores[i]->ListTriggersL(aFilter,aTriggers););
       
    99         if ( error != KErrNotFound )
       
   100             {
       
   101             break;
       
   102             }
       
   103         }
       
   104     SetActive();    
       
   105     User::RequestComplete(status,error);            
       
   106     }
       
   107 // ---------------------------------------------------------
       
   108 // CLbtListTriggerAO::RunL
       
   109 //
       
   110 // (other items were commented in a header).
       
   111 // ---------------------------------------------------------
       
   112 //
       
   113 void CLbtListTriggerAO::RunL()
       
   114     {
       
   115     FUNC_ENTER("CLbtListTriggerAO::RunL");
       
   116    	TInt error=iStatus.Int();
       
   117    	iObserver.ListTriggerOpComplete(error);       
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // CLbtListTriggerAO::RunError
       
   122 //
       
   123 // (other items were commented in a header).
       
   124 // ---------------------------------------------------------
       
   125 //
       
   126 TInt CLbtListTriggerAO::RunError(TInt /*aError*/)
       
   127     {
       
   128    
       
   129     return KErrNone;
       
   130     }
       
   131 
       
   132 // ---------------------------------------------------------
       
   133 // CLbtListTriggerAO::DoCancel
       
   134 //
       
   135 // (other items were commented in a header).
       
   136 // ---------------------------------------------------------
       
   137 //
       
   138 void CLbtListTriggerAO::DoCancel()
       
   139     {
       
   140 
       
   141     
       
   142     }
       
   143 
       
   144 
       
   145  
       
   146     
       
   147 //  End of File