wvuing/wvuipresence/src/CCAPresenceErrors.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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:  Container for detailed errors
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "CCAPresenceErrors.h"
       
    22 #include    "CCAPresenceError.h"
       
    23 #include    "ChatDebugPrint.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CCAPresenceErrors::CCAPresenceErrors
       
    29 // C++ default constructor can NOT contain any code, that
       
    30 // might leave.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CCAPresenceErrors::CCAPresenceErrors()
       
    34     {
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CCAPresenceErrors::NewL
       
    39 // Two-phased constructor.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CCAPresenceErrors* CCAPresenceErrors::NewL()
       
    43     {
       
    44     CCAPresenceErrors* self = new( ELeave ) CCAPresenceErrors;
       
    45     return self;
       
    46     }
       
    47 
       
    48 
       
    49 // Destructor
       
    50 CCAPresenceErrors::~CCAPresenceErrors()
       
    51     {
       
    52     CHAT_DP_TXT( "CCAPresenceErrors::~CCAPresenceErrors" );
       
    53     iErrors.ResetAndDestroy();
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CCAPresenceErrors::SetError
       
    58 // (other items were commented in a header).
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 void CCAPresenceErrors::SetError( TInt aError )
       
    62     {
       
    63     iMainError = aError;
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CCAPresenceErrors::Error
       
    68 // (other items were commented in a header).
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 TInt CCAPresenceErrors::Error() const
       
    72     {
       
    73     return iMainError;
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CCAPresenceErrors::AddDetailedErrorL
       
    78 // (other items were commented in a header).
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 void CCAPresenceErrors::AddDetailedErrorL( CCAPresenceError* aError )
       
    82     {
       
    83     CHAT_DP_TXT( "CCAPresenceErrors::AddDetailedErrorL" );
       
    84     User::LeaveIfError( iErrors.Append( aError ) );
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CCAPresenceErrors::RemoveDetailedError
       
    89 // (other items were commented in a header).
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CCAPresenceErrors::RemoveDetailedError( CCAPresenceError* aError )
       
    93     {
       
    94     CHAT_DP_TXT( "CCAPresenceErrors::RemoveDetailedError" );
       
    95 
       
    96     TInt index( iErrors.Find( aError ) );
       
    97 
       
    98     if ( index != KErrNotFound )
       
    99         {
       
   100         delete iErrors[index];
       
   101         iErrors.Remove( index );
       
   102         }
       
   103     }
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // CCAPresenceErrors::Reset
       
   107 // (other items were commented in a header).
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 void CCAPresenceErrors::Reset()
       
   111     {
       
   112     CHAT_DP_TXT( "CCAPresenceErrors::Reset" );
       
   113 
       
   114     iErrors.ResetAndDestroy();
       
   115     iMainError = KErrNone;
       
   116     }
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CCAPresenceErrors::DetailedErrors
       
   120 // (other items were commented in a header).
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 const RPointerArray<MCAPresenceError>& CCAPresenceErrors::DetailedErrors() const
       
   124     {
       
   125     return iErrors;
       
   126     }
       
   127 
       
   128 //  End of File