datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/inc/lbsbtgpsconfigimpl.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2008-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 // LBS Bluetooth GPS Configuration API implementation
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #ifndef LBS_BTGPSCONFIGIMPL_H
       
    25 #define LBS_BTGPSCONFIGIMPL_H
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <centralrepository.h>
       
    29 
       
    30 #include <lbs/lbsbtgpsconfig.h>
       
    31 #include "lbsbtgpsdevicerecord.h"
       
    32 
       
    33 
       
    34 /** LBS Bluetooth GPS Configuration API implementation
       
    35 
       
    36 @see CLbsBtGpsConfig
       
    37 
       
    38 @internalComponent
       
    39 */
       
    40 class CLbsBtGpsConfigImpl : public CActive
       
    41 	{
       
    42 public:
       
    43 
       
    44 	static CLbsBtGpsConfigImpl* NewL(MLbsBtGpsConfigObserver* aObserver);
       
    45 	virtual ~CLbsBtGpsConfigImpl();
       
    46 
       
    47 public:
       
    48 
       
    49 	// Callled directly from external API:
       
    50 	TInt GetDeviceCount(TInt& aCount);
       
    51 	TInt AddDevice(const TBTDevAddr& aAddress, TInt aPosition, TLbsBtGpsEntryKey& aKey);
       
    52 	TInt RemoveDevice(TLbsBtGpsEntryKey aKey);
       
    53 	TInt EmptyDeviceList();
       
    54 	TInt ReorderDevice(TLbsBtGpsEntryKey aKey, TInt aNewPosition);
       
    55 	void GetDeviceListL(RPointerArray<TLbsBtGpsDeviceInfo>& aList);
       
    56 
       
    57 	virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2);
       
    58 	
       
    59 	// Called only from internal API:
       
    60 	TInt UpdateDevice(const TLbsBtGpsDeviceRecord& aDeviceRecord);
       
    61 	void GetDeviceRecordListL(RPointerArray<TLbsBtGpsDeviceRecord>& aRecordList);
       
    62 
       
    63 protected:
       
    64 	
       
    65 	virtual void DoCancel();
       
    66 	virtual void RunL();
       
    67 
       
    68 	void AddDeviceL(const TBTDevAddr& aAddress, TInt aPosition, TLbsBtGpsEntryKey& aKey);
       
    69 	void RemoveDeviceL(TLbsBtGpsEntryKey aKey);
       
    70 	void EmptyDeviceListL();
       
    71 	void ReorderDeviceL(TLbsBtGpsEntryKey aKey, TInt aNewPosition);
       
    72 	void UpdateDeviceL(const TLbsBtGpsDeviceRecord& aDeviceRecord);
       
    73 	
       
    74 	TInt StartTransactionL(CRepository::TTransactionMode aMode);
       
    75 	TInt EndTransaction();
       
    76 
       
    77 	TInt ReadDeviceRecord(TInt aIndex, TLbsBtGpsDeviceRecord& aDeviceRecord);
       
    78 	TInt WriteDeviceRecord(TInt aIndex, const TLbsBtGpsDeviceRecord& aDeviceRecord);
       
    79 	TInt MoveDeviceRecord(TInt aOldIndex, TInt aNewIndex);
       
    80 	
       
    81 private:
       
    82 
       
    83 	CLbsBtGpsConfigImpl(MLbsBtGpsConfigObserver* aObserver);
       
    84 	void ConstructL();
       
    85 
       
    86 	/** Prohibit copy constructor */
       
    87 	 CLbsBtGpsConfigImpl(const CLbsBtGpsConfigImpl&);
       
    88 	/** Prohibit assigment operator */
       
    89 	 CLbsBtGpsConfigImpl& operator= (const CLbsBtGpsConfigImpl&);
       
    90 
       
    91 private:
       
    92 
       
    93 	/** Pointer to observer object (optional, can be NULL) */
       
    94 	MLbsBtGpsConfigObserver* iObserver;
       
    95 	
       
    96 	/** Central repository object */
       
    97 	CRepository* iRepos;
       
    98 	
       
    99 	};
       
   100 
       
   101 #endif //LBS_BTGPSCONFIGIMPL_H