diff -r a2efdd544abf -r b47902b73a93 datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/inc/lbsbtgpsconfigimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/datasourcemodules/bluetoothgpspositioningmodule/btgpsconfig/inc/lbsbtgpsconfigimpl.h Fri Jun 04 10:34:15 2010 +0100 @@ -0,0 +1,101 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// LBS Bluetooth GPS Configuration API implementation +// + + + +/** + @file + @internalComponent +*/ + +#ifndef LBS_BTGPSCONFIGIMPL_H +#define LBS_BTGPSCONFIGIMPL_H + +#include +#include + +#include +#include "lbsbtgpsdevicerecord.h" + + +/** LBS Bluetooth GPS Configuration API implementation + +@see CLbsBtGpsConfig + +@internalComponent +*/ +class CLbsBtGpsConfigImpl : public CActive + { +public: + + static CLbsBtGpsConfigImpl* NewL(MLbsBtGpsConfigObserver* aObserver); + virtual ~CLbsBtGpsConfigImpl(); + +public: + + // Callled directly from external API: + TInt GetDeviceCount(TInt& aCount); + TInt AddDevice(const TBTDevAddr& aAddress, TInt aPosition, TLbsBtGpsEntryKey& aKey); + TInt RemoveDevice(TLbsBtGpsEntryKey aKey); + TInt EmptyDeviceList(); + TInt ReorderDevice(TLbsBtGpsEntryKey aKey, TInt aNewPosition); + void GetDeviceListL(RPointerArray& aList); + + virtual TAny* ExtendedInterface(TInt aFunctionNumber, TAny* aPtr1, TAny* aPtr2); + + // Called only from internal API: + TInt UpdateDevice(const TLbsBtGpsDeviceRecord& aDeviceRecord); + void GetDeviceRecordListL(RPointerArray& aRecordList); + +protected: + + virtual void DoCancel(); + virtual void RunL(); + + void AddDeviceL(const TBTDevAddr& aAddress, TInt aPosition, TLbsBtGpsEntryKey& aKey); + void RemoveDeviceL(TLbsBtGpsEntryKey aKey); + void EmptyDeviceListL(); + void ReorderDeviceL(TLbsBtGpsEntryKey aKey, TInt aNewPosition); + void UpdateDeviceL(const TLbsBtGpsDeviceRecord& aDeviceRecord); + + TInt StartTransactionL(CRepository::TTransactionMode aMode); + TInt EndTransaction(); + + TInt ReadDeviceRecord(TInt aIndex, TLbsBtGpsDeviceRecord& aDeviceRecord); + TInt WriteDeviceRecord(TInt aIndex, const TLbsBtGpsDeviceRecord& aDeviceRecord); + TInt MoveDeviceRecord(TInt aOldIndex, TInt aNewIndex); + +private: + + CLbsBtGpsConfigImpl(MLbsBtGpsConfigObserver* aObserver); + void ConstructL(); + + /** Prohibit copy constructor */ + CLbsBtGpsConfigImpl(const CLbsBtGpsConfigImpl&); + /** Prohibit assigment operator */ + CLbsBtGpsConfigImpl& operator= (const CLbsBtGpsConfigImpl&); + +private: + + /** Pointer to observer object (optional, can be NULL) */ + MLbsBtGpsConfigObserver* iObserver; + + /** Central repository object */ + CRepository* iRepos; + + }; + +#endif //LBS_BTGPSCONFIGIMPL_H