locationcentre/lcservice/src/lclocationappfilter.cpp
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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 Application Filters
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // SYSTEM INCLUDES
       
    20 
       
    21 // USER INCLUDES
       
    22 #include "lclocationappfilter.h"
       
    23 
       
    24 // CONSTANT DEFINITIONS
       
    25 
       
    26 // This value is obtained by ORing all the System characteristics
       
    27 // available
       
    28 const TUint32   KMaxSystemCharValue = 1;
       
    29 
       
    30 // This value is obtained by ORing all the Application characteristics
       
    31 // available
       
    32 const TUint32   KMaxAppCharValue = 1023;
       
    33 
       
    34 
       
    35 // ----- Member funtions for TLcLocationAppFilter ------------------
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // TUint32 TLcLocationAppFilter::TLcLocationAppFilter
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 EXPORT_C TLcLocationAppFilter::TLcLocationAppFilter()
       
    42     :iSystemChar(0),
       
    43     iSysFilterConfig( TLcLocationAppFilter::EFilterStrict ),
       
    44     iApplicationChar(0),
       
    45     iAppFilterConfig( TLcLocationAppFilter::EFilterStrict )
       
    46     {
       
    47     }
       
    48     
       
    49 // ---------------------------------------------------------------------------
       
    50 // TUint32 TLcLocationAppFilter::GetSystemCharacteristics
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 EXPORT_C TUint32 TLcLocationAppFilter::SystemCharacteristics() const
       
    54     {
       
    55     return iSystemChar;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // TInt TLcLocationAppFilter::AddSystemCharacteristic
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C TInt TLcLocationAppFilter::SetSystemCharacteristic( 
       
    63                                                 TUint32     aSystemChar  )
       
    64     {
       
    65     // Check if the System characteristics value is a valid bit-mask.
       
    66     if( aSystemChar > KMaxSystemCharValue )
       
    67         {
       
    68         return KErrArgument;
       
    69         }
       
    70         
       
    71     iSystemChar = aSystemChar;
       
    72     return KErrNone;
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // TLcLocationAppFilter::TLocationAppFilterConfig TLcLocationAppFilter::
       
    77 //                                                  SysCharFilterConfiguration
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 EXPORT_C TLcLocationAppFilter::TLcFilterConfig 
       
    81                 TLcLocationAppFilter::SysCharFilterConfiguration() const
       
    82     {
       
    83     return iSysFilterConfig;
       
    84     }
       
    85     
       
    86 // ---------------------------------------------------------------------------
       
    87 // void TLcLocationAppFilter::SetSysCharacFilterConfig
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 EXPORT_C void TLcLocationAppFilter::SetSysCharFilterConfiguration( 
       
    91                      TLcLocationAppFilter::TLcFilterConfig   aFilterConfig )
       
    92     {
       
    93     iSysFilterConfig = aFilterConfig;
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // TUint32 TLcLocationAppFilter::GetApplicationCharacteristics
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C TUint32 TLcLocationAppFilter::ApplicationCharacteristics() const
       
   101     {
       
   102     return iApplicationChar;
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------------------------
       
   106 // TInt TLcLocationAppFilter::SetApplicationCharacteristics
       
   107 // ---------------------------------------------------------------------------
       
   108 //
       
   109 EXPORT_C TInt TLcLocationAppFilter::SetApplicationCharacteristics( 
       
   110                                                 TUint32     aAppChar  )
       
   111     {
       
   112     // Check if the Application characteristics value is a valid bit-mask.
       
   113     if( aAppChar > KMaxAppCharValue )
       
   114         {
       
   115         return KErrArgument;
       
   116         }
       
   117         
       
   118     iApplicationChar = aAppChar;
       
   119     return KErrNone;
       
   120     }
       
   121 
       
   122 // ---------------------------------------------------------------------------
       
   123 // TLcLocationAppFilter::TLcFilterConfig AppCharFilterConfiguration
       
   124 // ---------------------------------------------------------------------------
       
   125 //
       
   126 EXPORT_C TLcLocationAppFilter::TLcFilterConfig 
       
   127             TLcLocationAppFilter::AppCharFilterConfiguration() const
       
   128     {
       
   129     return iAppFilterConfig;
       
   130     }
       
   131     
       
   132 // ---------------------------------------------------------------------------
       
   133 // void TLcLocationAppFilter::SetAppCharFilterConfiguration
       
   134 // ---------------------------------------------------------------------------
       
   135 //
       
   136 EXPORT_C void TLcLocationAppFilter::SetAppCharFilterConfiguration( 
       
   137                      TLcLocationAppFilter::TLcFilterConfig   aFilterConfig )
       
   138     {
       
   139     iAppFilterConfig = aFilterConfig;
       
   140     }
       
   141 
       
   142 // End of File
       
   143