os/mm/mmhais/dvbhreceiverhai/hai/dvbh/teststubs/dvbhreceiverinfoobserver.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Declares the internal observer classes used by CDvbhReceiverInfo.
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalComponent
sl@0
    21
 @prototype
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef DVBHRECEIVERINFOOBSERVER_H
sl@0
    25
#define DVBHRECEIVERINFOOBSERVER_H
sl@0
    26
sl@0
    27
#include "dvbhstubcommon.h"
sl@0
    28
#include <e32property.h>
sl@0
    29
#include <e32cons.h>
sl@0
    30
sl@0
    31
class MDvbhStateObserver;
sl@0
    32
class MDvbhSignalQualityObserver;
sl@0
    33
class MDvbhPlatformObserver;
sl@0
    34
class MDvbhNetworkTimeObserver;
sl@0
    35
class MDvbhFrequencyObserver;
sl@0
    36
class MDvbhCellIdObserver;
sl@0
    37
class MDvbhNetworkIdObserver;
sl@0
    38
class MDvbhExtBatteryStateObserver;
sl@0
    39
class MDvbhExtConnectionObserver;
sl@0
    40
class MDvbhExtAntennaConnectionObserver;
sl@0
    41
sl@0
    42
/**
sl@0
    43
* Interface to abstract the callback to be called when an RProperty changes. 
sl@0
    44
*/
sl@0
    45
class MPropertyNotifier
sl@0
    46
	{
sl@0
    47
public:
sl@0
    48
	/**
sl@0
    49
	* Callback to be called when an RProperty changes.
sl@0
    50
	* Implementations will probably want to call the appropriate callback on an external observer object.
sl@0
    51
	* @param aProperty A handle to the RProperty that has just changed.
sl@0
    52
	*/
sl@0
    53
	virtual void NotifyPropertyChanged(RProperty& aProperty) = 0;
sl@0
    54
	
sl@0
    55
	/**
sl@0
    56
	* Called to get the key of the property of interest.
sl@0
    57
	* @return the key value.
sl@0
    58
	*/
sl@0
    59
	virtual TInt GetPropertyKey() const = 0;
sl@0
    60
	};
sl@0
    61
sl@0
    62
/**
sl@0
    63
* CDvbhPropertyObserver is the class used to observer changes to an RProperty.
sl@0
    64
*
sl@0
    65
* To observer changes to a particular RProperty, users must call 
sl@0
    66
* CDvbhPropertyObserver::SetObserver() passing in an MPropertyNotifier 
sl@0
    67
* implementation corresponding to the RProperty of interest.  
sl@0
    68
* When the RProperty changes, CDvbhPropertyObserver::RunL() will call 
sl@0
    69
* MPropertyNotifier::NotifyPropertyChanged() of the implementation. 
sl@0
    70
*/
sl@0
    71
NONSHARABLE_CLASS(CDvbhPropertyObserver) : public CActive
sl@0
    72
	{
sl@0
    73
public:
sl@0
    74
	CDvbhPropertyObserver();
sl@0
    75
	~CDvbhPropertyObserver();
sl@0
    76
	TInt SetObserver(MPropertyNotifier* aPropertyNotifier);
sl@0
    77
sl@0
    78
private: 
sl@0
    79
	void RunL();
sl@0
    80
	void DoCancel();
sl@0
    81
	
sl@0
    82
private:
sl@0
    83
	MPropertyNotifier* iPropertyNotifier; //Not owned
sl@0
    84
	RProperty iProperty;
sl@0
    85
	};
sl@0
    86
sl@0
    87
/**
sl@0
    88
* Thin template base class for the RProperty notifiers.
sl@0
    89
*/
sl@0
    90
NONSHARABLE_CLASS(TDvbhNotifierBase)
sl@0
    91
	{
sl@0
    92
protected:
sl@0
    93
	TDvbhNotifierBase();
sl@0
    94
	void SetExternalObserver(TAny* aObserver);
sl@0
    95
protected:
sl@0
    96
	TAny* iExternalObserver; //Not owned
sl@0
    97
	};
sl@0
    98
sl@0
    99
/**
sl@0
   100
* Template on which RProperty Notifiers are based.  Contains all the
sl@0
   101
* code common to a Notifier for any RProperty.
sl@0
   102
*
sl@0
   103
* The template parameter OBSERVER must be one of the observer M-classes declard in dvbhreceiverinfo.h.
sl@0
   104
*/
sl@0
   105
template<class OBSERVER>
sl@0
   106
NONSHARABLE_CLASS(TDvbhNotifier) : protected TDvbhNotifierBase
sl@0
   107
	{
sl@0
   108
public:
sl@0
   109
	inline void SetExternalObserver(OBSERVER* aObserver);
sl@0
   110
	};
sl@0
   111
	
sl@0
   112
/**
sl@0
   113
* The state notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   114
*/	
sl@0
   115
NONSHARABLE_CLASS(TDvbhStateNotifier) : public TDvbhNotifier<MDvbhStateObserver>,
sl@0
   116
										public MPropertyNotifier
sl@0
   117
	{
sl@0
   118
public:
sl@0
   119
	virtual TInt GetPropertyKey() const;
sl@0
   120
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   121
	};
sl@0
   122
sl@0
   123
/**
sl@0
   124
* The SignalQuality notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   125
*/	
sl@0
   126
NONSHARABLE_CLASS(TDvbhSignalQualityNotifier) : public TDvbhNotifier<MDvbhSignalQualityObserver>,
sl@0
   127
												public MPropertyNotifier
sl@0
   128
	{
sl@0
   129
public:
sl@0
   130
	virtual TInt GetPropertyKey() const;
sl@0
   131
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   132
	};
sl@0
   133
sl@0
   134
/**
sl@0
   135
* The Platform notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   136
*/	
sl@0
   137
NONSHARABLE_CLASS(TDvbhPlatformNotifier) : public TDvbhNotifier<MDvbhPlatformObserver>,
sl@0
   138
										   public MPropertyNotifier
sl@0
   139
	{
sl@0
   140
public:
sl@0
   141
	virtual TInt GetPropertyKey() const;
sl@0
   142
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   143
	};
sl@0
   144
sl@0
   145
/**
sl@0
   146
* The NetworkTime notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   147
*/	
sl@0
   148
NONSHARABLE_CLASS(TDvbhNetworkTimeNotifier) : public TDvbhNotifier<MDvbhNetworkTimeObserver>,
sl@0
   149
											  public MPropertyNotifier
sl@0
   150
	{
sl@0
   151
public:
sl@0
   152
	virtual TInt GetPropertyKey() const;
sl@0
   153
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   154
	};
sl@0
   155
sl@0
   156
/**
sl@0
   157
* The Frequency notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   158
*/	
sl@0
   159
NONSHARABLE_CLASS(TDvbhFrequencyNotifier) : public TDvbhNotifier<MDvbhFrequencyObserver>,
sl@0
   160
											public MPropertyNotifier
sl@0
   161
	{
sl@0
   162
public:
sl@0
   163
	virtual TInt GetPropertyKey() const;
sl@0
   164
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   165
	};
sl@0
   166
sl@0
   167
/**
sl@0
   168
* The CellId notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   169
*/	
sl@0
   170
NONSHARABLE_CLASS(TDvbhCellIdNotifier) : public TDvbhNotifier<MDvbhCellIdObserver>,
sl@0
   171
										 public MPropertyNotifier
sl@0
   172
	{
sl@0
   173
public:
sl@0
   174
	virtual TInt GetPropertyKey() const;
sl@0
   175
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   176
	};
sl@0
   177
sl@0
   178
/**
sl@0
   179
* The NetworkId notifier for CDvbhReceiverInfo::CPrivateData. 
sl@0
   180
*/	
sl@0
   181
NONSHARABLE_CLASS(TDvbhNetworkIdNotifier) : public TDvbhNotifier<MDvbhNetworkIdObserver>,
sl@0
   182
											public MPropertyNotifier
sl@0
   183
	{
sl@0
   184
public:
sl@0
   185
	virtual TInt GetPropertyKey() const;
sl@0
   186
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   187
	};
sl@0
   188
sl@0
   189
/**
sl@0
   190
* The battery state for CDvbhReceiverInfo::CPrivateData. 
sl@0
   191
*/	
sl@0
   192
NONSHARABLE_CLASS(TDvbhExtBatteryStateNotifier) : public TDvbhNotifier<MDvbhExtBatteryStateObserver>,
sl@0
   193
											     public MPropertyNotifier
sl@0
   194
	{
sl@0
   195
public:
sl@0
   196
	virtual TInt GetPropertyKey() const;
sl@0
   197
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   198
	};
sl@0
   199
sl@0
   200
/**
sl@0
   201
* The connection state for CDvbhReceiverInfo::CPrivateData. 
sl@0
   202
*/	
sl@0
   203
NONSHARABLE_CLASS(TDvbhExtConnectionStateNotifier) : public TDvbhNotifier<MDvbhExtConnectionObserver>,
sl@0
   204
											         public MPropertyNotifier
sl@0
   205
	{
sl@0
   206
public:
sl@0
   207
	virtual TInt GetPropertyKey() const;
sl@0
   208
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   209
	};
sl@0
   210
    
sl@0
   211
/**
sl@0
   212
* The connection state for CDvbhReceiverInfo::CPrivateData. 
sl@0
   213
*/	
sl@0
   214
NONSHARABLE_CLASS(TMtvAccConnectionStateNotifier) : public TDvbhNotifier<MDvbhExtConnectionObserver>,
sl@0
   215
											        public MPropertyNotifier
sl@0
   216
	{
sl@0
   217
public:
sl@0
   218
	virtual TInt GetPropertyKey() const;
sl@0
   219
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   220
	};
sl@0
   221
sl@0
   222
/**
sl@0
   223
* The antenna connection state for CDvbhReceiverInfo::CPrivateData. 
sl@0
   224
*/	
sl@0
   225
NONSHARABLE_CLASS(TMtvAccAntennaConnectionStateNotifier) : public TDvbhNotifier<MDvbhExtAntennaConnectionObserver>,
sl@0
   226
											               public MPropertyNotifier
sl@0
   227
	{
sl@0
   228
public:
sl@0
   229
	virtual TInt GetPropertyKey() const;
sl@0
   230
	virtual void NotifyPropertyChanged(RProperty& aProperty);
sl@0
   231
	};
sl@0
   232
sl@0
   233
sl@0
   234
#include "dvbhreceiverinfoobserver.inl"
sl@0
   235
 
sl@0
   236
#endif //DVBHRECEIVERINFOOBSERVER_H
sl@0
   237
sl@0
   238
sl@0
   239
sl@0
   240
sl@0
   241