examples/ForumNokia/ThreadAndActiveObjectsEx/inc/sharedintermediator.h

00001 /*
00002  * Copyright © 2008 Nokia Corporation.
00003  */
00004 
00005 
00006 #ifndef __SHARED_INTERMEDIATOR_H__
00007 #define __SHARED_INTERMEDIATOR_H__
00008 
00009 #include <e32std.h>
00010 #include <e32base.h>
00011 #include <badesca.h> // CArrayFixFlat
00012 
00013 // FORWARD DECLARATIONS
00014 class TBluetoothInfo;
00015 class CDeviceListContainer;
00016 class CBluetoothRefreshTimer;
00017 class CThreadAOAppUi;
00018 
00019 // CLASS DECLARATION
00020 
00025 class CSharedIntermediator : public CBase
00026         {
00027 public:
00028         
00036         static CSharedIntermediator* NewL(CDeviceListContainer* aView);
00037 
00042         static CSharedIntermediator* NewLC(CDeviceListContainer* aView);
00043 
00050         ~CSharedIntermediator();
00051 
00060         void AddBluetoothInfoL(TBluetoothInfo& aBtInfoElement);
00061 
00067         void ResetArray();
00068 
00076         void GetAddress(TDes& aAddress, TInt aIndex);
00077 
00086         void SetStopSearching(bool aStopSearching);
00087 
00095         TBool StopSearching();
00096 
00104         CBluetoothRefreshTimer* BTRefreshTimerPtr();
00105 
00114         void SetBTRefreshTimerPtr(CBluetoothRefreshTimer* aTimer);
00115 
00123         CDeviceListContainer* DeviceListContainer();
00124 
00131         void SetRefreshTimerInitlVal(TInt aRefreshTime);
00132 
00139         TInt RefreshTimerInitlVal();
00140 
00141 private: // // Basic two-phase Symbian OS constructors
00142 
00149         CSharedIntermediator(CDeviceListContainer* aView);
00150         
00154         void ConstructL();
00155 
00156 private: // data members
00157 
00158         // UI's container, that shows listbox
00159         CDeviceListContainer* iDeviceListContainer;
00160     // True when program should be closed, false otherwise
00161         TBool iStopSearching;
00162     // Pointer to thread's blueetooth discoveryrefresh timer
00163         CBluetoothRefreshTimer* iBTRefreshTimer;
00164     // iBluetoothInfoArray is synchronized i.e. thread safe
00165         RMutex iMutex;
00166         // Contains all found bluetooth devices
00167         CArrayFixFlat <TBluetoothInfo>* iBluetoothInfoArray;
00168         // CBTRefreshTimer initial refresh time
00169         TInt iInititialRefreshTime;
00170         };
00171 
00172 #endif  //__SHARED_INTERMEDIATOR_H__

Generated by  doxygen 1.6.2