PECengine/PresenceManager2/SrcNWSessionSlot/CPEngNWSessionSlotManager2.cpp
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2004 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:  API to manage NWSessionSlots.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CPEngNWSessionSlotManager2.h"
       
    20 #include "CPEngNWSessionSlotManager2Imp.h"
       
    21 #include "PresenceDebugPrint.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CPEngNWSessionSlotManager2::NewL()
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 EXPORT_C CPEngNWSessionSlotManager2* CPEngNWSessionSlotManager2::NewL( TInt aPriority )
       
    33     {
       
    34     PENG_DP_TXT( "CPEngNWSessionSlotManager2::NewL()" );
       
    35 
       
    36     CPEngNWSessionSlotManager2* self = new ( ELeave ) CPEngNWSessionSlotManager2;
       
    37     CleanupStack::PushL( self );
       
    38     self->iImp = CPEngNWSessionSlotManager2Imp::NewL( *self, aPriority );
       
    39     CleanupStack::Pop( self );
       
    40     return self;
       
    41     }
       
    42 
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CPEngNWSessionSlotManager2::NewLC()
       
    46 // Two-phased constructor.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CPEngNWSessionSlotManager2* CPEngNWSessionSlotManager2::NewLC( TInt aPriority )
       
    50     {
       
    51     PENG_DP_TXT( "CPEngNWSessionSlotManager2::NewLC()" );
       
    52 
       
    53     CPEngNWSessionSlotManager2* self = new ( ELeave ) CPEngNWSessionSlotManager2;
       
    54     CleanupStack::PushL( self );
       
    55     self->iImp = CPEngNWSessionSlotManager2Imp::NewL( *self, aPriority );
       
    56     return self;
       
    57     }
       
    58 
       
    59 
       
    60 
       
    61 // Destructor
       
    62 CPEngNWSessionSlotManager2::~CPEngNWSessionSlotManager2()
       
    63     {
       
    64     PENG_DP_TXT( "CPEngNWSessionSlotManager2::~CPEngNWSessionSlotManager2()" );
       
    65 
       
    66     delete iImp;
       
    67     }
       
    68 
       
    69 
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CPEngNWSessionSlotManager2::CPEngNWSessionSlotManager2
       
    73 // C++ default constructor can NOT contain any code, that
       
    74 // might leave.
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 CPEngNWSessionSlotManager2::CPEngNWSessionSlotManager2()
       
    78     {
       
    79     }
       
    80 
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CPEngNWSessionSlotManager2::CreateNWSessionSlot()
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 EXPORT_C TInt CPEngNWSessionSlotManager2::CreateNWSessionSlot(
       
    87     const CPEngNWSessionSlotID2& aNWSessionSlotID )
       
    88     {
       
    89     PENG_DP_TXT( "CPEngNWSessionSlotManager2::CreateNWSessionSlot()" );
       
    90 
       
    91     return iImp->CreateNWSessionSlot( aNWSessionSlotID );
       
    92     }
       
    93 
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CPEngNWSessionSlotManager2::RemoveNWSessionSlot()
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 EXPORT_C TInt CPEngNWSessionSlotManager2::RemoveNWSessionSlot(
       
   100     const CPEngNWSessionSlotID2& aNWSessionSlotID )
       
   101     {
       
   102     PENG_DP_TXT( "CPEngNWSessionSlotManager2::RemoveNWSessionSlot()" );
       
   103 
       
   104     return iImp->RemoveNWSessionSlot( aNWSessionSlotID );
       
   105     }
       
   106 
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CPEngNWSessionSlotManager2::GetNWSessionSlots()
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 EXPORT_C TInt CPEngNWSessionSlotManager2::GetNWSessionSlots(
       
   113     RPointerArray<CPEngNWSessionSlotID2>& aNWSessionSlotIDs ) const
       
   114     {
       
   115     PENG_DP_TXT( "CPEngNWSessionSlotManager2::GetNWSessionSlots() - requesting all" );
       
   116 
       
   117     TRAPD( err, iImp->GetNWSessionSlotsL( aNWSessionSlotIDs, NULL, NULL ) )
       
   118 
       
   119     PENG_DP( D_PENG_LIT( "CPEngNWSessionSlotManager2::GetNWSessionSlots() - Found: %d, Status: %d" ),
       
   120              aNWSessionSlotIDs.Count(), err );
       
   121 
       
   122     return err;
       
   123     }
       
   124 
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CPEngNWSessionSlotManager2::GetNWSessionSlots()
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 EXPORT_C TInt CPEngNWSessionSlotManager2::GetNWSessionSlots(
       
   131     RPointerArray< CPEngNWSessionSlotID2 >& aNWSessionSlotIDs,
       
   132     const CPEngNWSessionSlotID2& aMatchPattern,
       
   133     TPEngNWSessionSlotState aMatchState ) const
       
   134     {
       
   135     /*
       
   136     PENG_IF_DP(
       
   137         {
       
   138         TDebugSlotIdBuf slotId;
       
   139         TDebugSlotStateBuf slotState;
       
   140         DebugObjectDump::ToBuf( slotId, aMatchPattern );
       
   141         DebugObjectDump::ToBuf( slotState, aMatchState );
       
   142         PENG_DP( D_PENG_LIT( "CPEngNWSessionSlotManager2::GetNWSessionSlots() - Filters: [%S] [%S]" ),
       
   143                               &slotId, &slotState );
       
   144         });
       
   145     */
       
   146     PENG_DP( D_PENG_LIT( "CPEngNWSessionSlotManager2::GetNWSessionSlots() - By filter: %d" ),
       
   147              aMatchState );
       
   148 
       
   149 
       
   150     TRAPD( err, iImp->GetNWSessionSlotsL( aNWSessionSlotIDs, &aMatchPattern, &aMatchState ) );
       
   151 
       
   152 
       
   153     PENG_DP( D_PENG_LIT( "CPEngNWSessionSlotManager2::GetNWSessionSlots() - Found: %d, Status: %d" ),
       
   154              aNWSessionSlotIDs.Count(), err );
       
   155 
       
   156     return err;
       
   157     }
       
   158 
       
   159 
       
   160 // -----------------------------------------------------------------------------
       
   161 // CPEngNWSessionSlotManager2::ExistsNWSessionSlot()
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 EXPORT_C TInt CPEngNWSessionSlotManager2::ExistsNWSessionSlot(
       
   165     const CPEngNWSessionSlotID2& aNWSessionSlotID ) const
       
   166     {
       
   167     PENG_DP_TXT( "CPEngNWSessionSlotManager2::ExistsNWSessionSlot()" );
       
   168 
       
   169     TRAPD( err, iImp->ExistsNWSessionSlotL( aNWSessionSlotID ) );
       
   170 
       
   171     PENG_DP( D_PENG_LIT( "CPEngNWSessionSlotManager2::ExistsNWSessionSlot() - Status: %d" ),
       
   172              err );
       
   173 
       
   174     return err;
       
   175     }
       
   176 
       
   177 
       
   178 
       
   179 // End of File
       
   180 
       
   181