epoc32/include/lbs/lbshostsettings.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file defines the interface to the list of remote hosts used
       
    15 // by the LBS subsystem.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @deprecated 
       
    23 */
       
    24 
       
    25 #ifndef LBSHOSTSETTINGS_H_
       
    26 #define LBSHOSTSETTINGS_H_
       
    27 
       
    28 #include <e32std.h>
       
    29 #include <lbs/lbshostsettingsclasstypes.h>
       
    30 
       
    31 /**
       
    32  * The ID of the Central Repository store used by the Host Settings API
       
    33  */
       
    34 const TLbsHostStoreId KLbsHostSettingsSuplStoreId = {0x10285AA8};
       
    35 
       
    36 /**
       
    37  * The host settings creator UID used by the device provisioning plug-ins.
       
    38  * If host settings have this creator ID they can be used for network initiated location requests
       
    39  */
       
    40 const TLbsHostCreatorId KLbsHostSettingsDevProvCreatorId = {0x10285AA9};
       
    41 
       
    42 /**
       
    43  * A test host settings creator UID
       
    44  */
       
    45 const TLbsHostCreatorId KLbsHostSettingsTestCreatorId = {0x10285AAA};
       
    46 
       
    47 class CLbsHostSettingsStoreImpl;
       
    48 class MLbsHostSettingsStoreImpl;
       
    49 
       
    50 /**
       
    51 Interface that receives notification of changes to a host settings data store.
       
    52 A reference to an object of this class can be passed to CLbsHostSettingsStore::NewL()
       
    53 to register a client as a host settings data store observer.
       
    54 @see CLbsHostSettingsStore
       
    55 @publishedPartner
       
    56 @deprecated
       
    57 */
       
    58 class MLbsHostSettingsStoreObserver
       
    59 	{
       
    60 	
       
    61 public:
       
    62 	IMPORT_C virtual TVersion Version() const;
       
    63 
       
    64 	/**
       
    65 	Receive notification that the contents of the data store have changed.
       
    66 	
       
    67 	This method is called when a host settings entry in the data store been changed by
       
    68 	another client session. It specifies the ID of the entry that has changed
       
    69 	and also which store it belongs to.
       
    70 	
       
    71 	Note: An application will not receive notification updates to changes it
       
    72 	itself has made to the same instance of CLbsHostSettingsStore.
       
    73 	
       
    74 	@param aError		KErrNone if an entry has been changed, otherwise an
       
    75 						error code from CenRep indicating a notification
       
    76 						request failure.
       
    77 	@param aStoreId		Identifies which data store has been updated or
       
    78 						incurred an error.
       
    79 	@param aSettingsId	Contains the ID of the host settings that has changed.
       
    80 						Valid only when aError == KErrNone.
       
    81 	
       
    82 	*/
       
    83 	IMPORT_C virtual void LbsHostSettingsUpdated(TInt aError, TLbsHostStoreId aStoreId, TLbsHostSettingsId aSettingsId) const = 0;
       
    84 
       
    85 
       
    86 protected:						
       
    87 	IMPORT_C virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
       
    88 	};
       
    89 
       
    90 	
       
    91 /**
       
    92 A class that encapsulates a host settings data store. 
       
    93 
       
    94 A host settings data store contains settings that describe the server hosts that the LBS subsystem
       
    95 uses. For example, for the SUPL protocol, the data store contains settings for the SUPL servers that are used
       
    96 for location requests (from local client applications and from the network), settings that define the authentication
       
    97 type that should be used between client and server and the internet access point to use for network connections.
       
    98 This class has methods to create a new host settings store, to create, modify and delete host settings and set the host
       
    99 settings that should be used as defaults.
       
   100 @see MLbsHostSettingsStoreObserver
       
   101 @publishedPartner
       
   102 @deprecated
       
   103 */
       
   104 class CLbsHostSettingsStore : public CBase
       
   105 	{
       
   106 public:
       
   107 	IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId);
       
   108 	
       
   109 	IMPORT_C static CLbsHostSettingsStore* NewL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver& aObserver);
       
   110 
       
   111 
       
   112 	IMPORT_C TInt CreateHostSettings(const TLbsHostSettingsBase& aSettings, TLbsHostCreatorId aCreatorId, TLbsHostSettingsId& aSettingsId);
       
   113 
       
   114 	IMPORT_C TInt UpdateHostSettings(TLbsHostSettingsId aSettingsId, const TLbsHostSettingsBase& aSettings);
       
   115 
       
   116 	IMPORT_C TInt GetHostSettings(TLbsHostSettingsId aSettingsId, TLbsHostSettingsBase& aSettings) const;
       
   117 
       
   118 
       
   119 	IMPORT_C TInt RewindHostSettings();
       
   120 
       
   121 	IMPORT_C TInt GetNextHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
       
   122 
       
   123 	IMPORT_C TInt GetNextHostSettingsByCreator(TLbsHostCreatorId aCreatorId, TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId);
       
   124 	
       
   125 
       
   126 	IMPORT_C TInt SetDefaultHostSettings(TLbsHostSettingsId aSettingsId);
       
   127 	
       
   128 	IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings) const;
       
   129 
       
   130 	IMPORT_C TInt GetDefaultHostSettings(TLbsHostSettingsBase& aSettings, TLbsHostSettingsId& aSettingsId) const;
       
   131 
       
   132 	IMPORT_C TInt DeleteHostSettings(TLbsHostSettingsId aSettingsId);
       
   133 
       
   134 	IMPORT_C ~CLbsHostSettingsStore();
       
   135 
       
   136 protected:
       
   137 	/**
       
   138 	Default constructor for the settings store.
       
   139 	*/  
       
   140 	CLbsHostSettingsStore();
       
   141 	void ConstructL(TLbsHostStoreId aStoreId, MLbsHostSettingsStoreObserver *aObserver);
       
   142 	
       
   143 private:
       
   144 	/**
       
   145 	 * In order to maintain two implementations behind one interface
       
   146 	 * we are holding two different versions of the implementation.
       
   147 	 * The pointer to the C class will only be used for instantiation
       
   148 	 * and destruction, we shall use the pointer to the mixin for
       
   149 	 * everything else.
       
   150 	 */
       
   151 	CLbsHostSettingsStoreImpl* iImplementation;
       
   152 	MLbsHostSettingsStoreImpl* iSettingsStore;
       
   153 
       
   154 private:
       
   155 	};
       
   156 
       
   157 
       
   158 #endif // LBSHOSTSETTINGS_H_
       
   159 
       
   160