PECengine/PresenceManager2/SrcSearch/CPEngSearchCriteria2.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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 criteria.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "CPEngSearchCriteria2.h"
       
    19 #include <PEngPresenceEngineConsts2.h>
       
    20 
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CPEngNWSessionSlot2::NewLC()
       
    26 // Two-phased constructor.
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 EXPORT_C CPEngSearchCriteria2* CPEngSearchCriteria2::NewL()
       
    30     {
       
    31     CPEngSearchCriteria2* self = new( ELeave )CPEngSearchCriteria2;
       
    32     return self;
       
    33     }
       
    34 
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CPEngNWSessionSlot2::NewLC()
       
    38 // Two-phased constructor.
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 EXPORT_C CPEngSearchCriteria2* CPEngSearchCriteria2::NewLC()
       
    42     {
       
    43     CPEngSearchCriteria2* self = new( ELeave )CPEngSearchCriteria2;
       
    44     CleanupStack::PushL( self );
       
    45     return self;
       
    46     }
       
    47 
       
    48 
       
    49 
       
    50 // Destructor
       
    51 CPEngSearchCriteria2::~CPEngSearchCriteria2()
       
    52     {
       
    53     delete iSearchValue;
       
    54     }
       
    55 
       
    56 
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CPEngSearchCriteria2::CPEngSearchCriteria2()
       
    60 // C++ default constructor can NOT contain any code, that
       
    61 // might leave.
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CPEngSearchCriteria2::CPEngSearchCriteria2()
       
    65         : iElement( KPEngNullSearchElement )
       
    66     {
       
    67     }
       
    68 
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CPEngSearchCriteria2::SetSearchL()
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 EXPORT_C void CPEngSearchCriteria2::SetSearchL( TInt aElement,
       
    75                                                 const TDesC& aSearchValue )
       
    76     {
       
    77     HBufC* tmp = aSearchValue.AllocL();
       
    78 
       
    79     delete iSearchValue;
       
    80     iSearchValue = tmp;
       
    81     iElement = aElement;
       
    82     }
       
    83 
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CPEngSearchCriteria2::Element()
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 EXPORT_C TInt CPEngSearchCriteria2::Element() const
       
    90     {
       
    91     return iElement;
       
    92     }
       
    93 
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CPEngSearchCriteria2::SearchValue()
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 EXPORT_C const TDesC& CPEngSearchCriteria2::SearchValue() const
       
   100     {
       
   101     if ( iSearchValue )
       
   102         {
       
   103         return *iSearchValue;
       
   104         }
       
   105 
       
   106     return KNullDesC;
       
   107     }
       
   108 
       
   109 
       
   110 //End of file
       
   111 
       
   112