PECengine/PresenceManager2/SrcSearch/CPEngSearchResultEntry.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:  Search results entry.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CPEngSearchResultEntry.h"
       
    20 #include <CPEngSearchResult2.h>
       
    21 #include <E32Std.h>
       
    22 
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CPEngSearchResultEntry::NewL()
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CPEngSearchResultEntry* CPEngSearchResultEntry::NewL()
       
    33     {
       
    34     CPEngSearchResultEntry* self = CPEngSearchResultEntry::NewLC();
       
    35     CleanupStack::Pop( self );
       
    36     return self;
       
    37     }
       
    38 
       
    39 CPEngSearchResultEntry* CPEngSearchResultEntry::NewLC()
       
    40     {
       
    41     CPEngSearchResultEntry* self = new ( ELeave ) CPEngSearchResultEntry;
       
    42     CleanupStack::PushL( self );
       
    43     self->ConstructL();
       
    44     return self;
       
    45     }
       
    46 
       
    47 
       
    48 
       
    49 
       
    50 // Destructor
       
    51 CPEngSearchResultEntry::~CPEngSearchResultEntry()
       
    52     {
       
    53     delete iInterface;
       
    54     }
       
    55 
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CPEngSearchResultEntry::CPEngSearchResultEntry
       
    59 // C++ default constructor can NOT contain any code, that
       
    60 // might leave.
       
    61 //
       
    62 // UserResults amount can differ a lot, 5 should be quite optimal
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 CPEngSearchResultEntry::CPEngSearchResultEntry()
       
    66         : iUserResults( 5 )
       
    67     {
       
    68     }
       
    69 
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CPEngSearchResultEntry::ConstructL()
       
    73 // Symbian OS constructor.
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 void CPEngSearchResultEntry::ConstructL()
       
    77     {
       
    78     iInterface = new ( ELeave ) CPEngSearchResult2( *this );
       
    79     }
       
    80 
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CPEngSearchResultEntry::Interface()
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 CPEngSearchResult2& CPEngSearchResultEntry::Interface()
       
    87     {
       
    88     return *iInterface;
       
    89     }
       
    90 
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CPEngSearchResultEntry::UserResults()
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 CDesC16Array& CPEngSearchResultEntry::UserResults()
       
    97     {
       
    98     return iUserResults;
       
    99     }
       
   100 
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // CPEngSearchResultEntry::SetDetails()
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 void CPEngSearchResultEntry::SetDetails( TInt aFindingsCount,
       
   107                                          TInt aContinuationIndex,
       
   108                                          TBool aSearchCompleted )
       
   109     {
       
   110     iCurrentFindingsCount = aFindingsCount;
       
   111     iContinuationIndex = aContinuationIndex;
       
   112     iSearchCompleted = aSearchCompleted;
       
   113     }
       
   114 
       
   115 
       
   116 // -----------------------------------------------------------------------------
       
   117 // CPEngSearchResultEntry::Reset()
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 void CPEngSearchResultEntry::Reset()
       
   121     {
       
   122     iCurrentFindingsCount = 0;
       
   123     iContinuationIndex = 0;
       
   124     iSearchCompleted = ETrue;
       
   125     iUserResults.Reset();
       
   126     }
       
   127 
       
   128 
       
   129 
       
   130 //  End of File
       
   131