epoc32/include/uikon/eiknfysv.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/uikon/eiknfysv.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,423 +0,0 @@
     1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 -// All rights reserved.
     1.6 -// This component and the accompanying materials are made available
     1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -
    1.20 -
    1.21 -/**
    1.22 - @file 
    1.23 - @internalComponent 
    1.24 -*/
    1.25 -
    1.26 -#ifndef __EIKNFYSV_H__
    1.27 -#define __EIKNFYSV_H__
    1.28 -
    1.29 -#include <e32base.h>
    1.30 -#include <w32std.h>
    1.31 -#include <eiknotapi.h>
    1.32 -#include <uikon/eiksvfty.h>
    1.33 -
    1.34 -#include <ecom/ecom.h>
    1.35 -
    1.36 -//
    1.37 -// class CEikServNotifyServer
    1.38 -//
    1.39 -
    1.40 -class CEikSrvNotifierManager;
    1.41 -class CEikServNotifyAlert;
    1.42 -class MEikSrvNotifierBase2;
    1.43 -class CChannelMonitor;
    1.44 -class CActivityMonitor;
    1.45 -class CEikNotifierQueue;
    1.46 -class CEikServNotifySession;
    1.47 -class TNotifierSecureInfo;
    1.48 -
    1.49 -class MEikInfoMsgWin;
    1.50 -
    1.51 -/**
    1.52 -@internalComponent 
    1.53 -*/
    1.54 -NONSHARABLE_CLASS(TNotifierMessageInfo)
    1.55 -	{
    1.56 -public:
    1.57 -	TNotifierMessageInfo(const RMessage2& aMessage, CEikServNotifySession& aEikServNotifySession);
    1.58 -private:
    1.59 -	TNotifierMessageInfo();
    1.60 -public:
    1.61 -	RMessage2 iMessage;
    1.62 -	CEikServNotifySession& iEikServNotifySession;
    1.63 -	};
    1.64 -
    1.65 -/**
    1.66 -@internalComponent 
    1.67 -*/
    1.68 -NONSHARABLE_CLASS(TNotifierSecureInfo)
    1.69 -	{
    1.70 -public:
    1.71 -	TNotifierSecureInfo(const TUid aNotifierUid, const TSecureId aSecureId);
    1.72 -public:
    1.73 -	TUid iNotifierUid;
    1.74 -	TSecureId iSecureId;
    1.75 -	};
    1.76 -
    1.77 -/** @internalComponent */
    1.78 -typedef RArray<const TNotifierMessageInfo> RNotifierMessageInfoQueue;
    1.79 -/** @internalComponent */
    1.80 -typedef RArray<const TNotifierSecureInfo> RNotifierSecureInfoQueue;
    1.81 -				
    1.82 -/** 
    1.83 -@internalComponent 
    1.84 -*/
    1.85 -NONSHARABLE_CLASS(CEikServNotifyServer) : public CPolicyServer
    1.86 -	{
    1.87 -public:
    1.88 -	IMPORT_C static CEikServNotifyServer* NewL(MEikServNotifyAlert* aAlert);
    1.89 -	IMPORT_C ~CEikServNotifyServer();
    1.90 -	IMPORT_C void StartL();
    1.91 -public:
    1.92 -	IMPORT_C void DisplayNotifier(const TDesC& aTitle, const TDesC& aLabel, const TDesC& aBut1, const TDesC& aBut2, MEikNotifyAlertCompletionObserver* aObserver);
    1.93 -	IMPORT_C void DisplayInfoPrint(const TDesC& aDes);
    1.94 -	inline CEikSrvNotifierManager* Manager() const;
    1.95 -	inline RNotifierMessageInfoQueue& AsyncMessageQueue() { return iAsyncMessageQueue; }
    1.96 -	inline RNotifierSecureInfoQueue& AsyncSecureInfoQueue() { return iAsyncSecureInfoQueue; }
    1.97 -public:
    1.98 -	void SetIsExiting();
    1.99 -	TBool IsExiting() const;
   1.100 -private:
   1.101 -	CEikServNotifyServer(TInt aPriority, MEikServNotifyAlert* aAlert);
   1.102 -	void ConstructL();
   1.103 -	TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
   1.104 -private: // from CServer2
   1.105 -	CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
   1.106 -private:
   1.107 -	MEikServNotifyAlert* iAlert;
   1.108 -	MEikInfoMsgWin* iInfoMsg;
   1.109 -	RWindowGroup iInfoMsgGroupWin;
   1.110 -	CEikSrvNotifierManager* iManager;
   1.111 -	TBool iExiting;
   1.112 -	RNotifierMessageInfoQueue iAsyncMessageQueue;
   1.113 -	RNotifierSecureInfoQueue iAsyncSecureInfoQueue;
   1.114 -	};
   1.115 -
   1.116 -//
   1.117 -// class CEikServNotifySession
   1.118 -//
   1.119 -
   1.120 -/**
   1.121 -@internalComponent
   1.122 -*/
   1.123 -NONSHARABLE_CLASS(CEikServNotifySession) : public CSession2, public MEikNotifyAlertCompletionObserver
   1.124 -	{
   1.125 -public:
   1.126 -	static CEikServNotifySession* NewL();
   1.127 -	~CEikServNotifySession();
   1.128 -public: // from CSession
   1.129 -	void HandleAlertCompletion(const TInt aButtonVal);
   1.130 -public: // from CSession2
   1.131 -	void ServiceL(const RMessage2 &aMessage);
   1.132 -private:
   1.133 -	CEikServNotifySession();
   1.134 -	void ConstructL();
   1.135 -	void DisplayAlert(const RMessage2& aMessage);
   1.136 -	void PrepareDisplayAlert();
   1.137 -	void DisplayNextPendingAlert();
   1.138 -	void DisplayInfoMsg(const RMessage2& aMessage);
   1.139 -	void StartNotifierL(const RMessage2& aMessage);
   1.140 -	void UpdateNotifierL(const RMessage2& aMessage);
   1.141 -	void StartNotifierAndGetResponseL(const RMessage2& aMessage,TBool& aCleanupComplete);
   1.142 -	CEikServNotifyServer& Server() const {return *static_cast<CEikServNotifyServer*>( const_cast<CServer2*>(CSession2::Server()) );}
   1.143 -	static HBufC8* GetRemoteInputBufferLC(const RMessage2& aMessage, TInt aSlot);
   1.144 -	void UpdateNotifierAndGetResponseL(const RMessage2& aMessage);
   1.145 -	TInt NotifierCancel(const RMessage2 &aMessage);
   1.146 -private:
   1.147 -	const CEikServNotifyServer* iServer;
   1.148 -	TInt iClientId;
   1.149 -	TInt iLengthOfFirstLineOfMessage;
   1.150 -	TInt iLengthOfSecondLineOfMessage;
   1.151 -	TInt iLengthOfFirstButtonOfMessage;
   1.152 -	TInt iLengthOfSecondButtonOfMessage;
   1.153 -	TInt iLengthOfCombinedBuffer;
   1.154 -	HBufC* iBuffer;
   1.155 -private:
   1.156 -	NONSHARABLE_CLASS(CEikSrvPendingAlert) : public CActive
   1.157 -		{
   1.158 -	public:
   1.159 -		CEikSrvPendingAlert(CEikServNotifySession& aEikServNotifySession);
   1.160 -		~CEikSrvPendingAlert();
   1.161 -	public:
   1.162 -		void TriggerNext();
   1.163 -	private: // from CActive
   1.164 -		void RunL();
   1.165 -		void DoCancel();
   1.166 -	private:
   1.167 -		CEikServNotifySession& iEikServNotifySession;
   1.168 -		};
   1.169 -private:
   1.170 -	CEikSrvPendingAlert* iEikSrvPendingAlert;
   1.171 -public: 
   1.172 -	friend class CEikSrvPendingAlert;
   1.173 -	};
   1.174 -
   1.175 -
   1.176 -//
   1.177 -// class CEikSrvNotifierWrapper
   1.178 -//
   1.179 -
   1.180 -
   1.181 -/**
   1.182 -@internalComponent 
   1.183 -*/
   1.184 -NONSHARABLE_CLASS(CEikSrvNotifierWrapper) : public CBase
   1.185 -	{
   1.186 -public:
   1.187 -	CEikSrvNotifierWrapper(MEikSrvNotifierBase2* aNotifier);
   1.188 -	~CEikSrvNotifierWrapper();
   1.189 -	void RegisterNotifierL();
   1.190 -public:
   1.191 -	MEikSrvNotifierBase2* iNotifier;
   1.192 -	MEikSrvNotifierBase2::TNotifierInfo iInfo;
   1.193 -	TUid iDestructorKey;
   1.194 -	TUid iPlugInDllUid;
   1.195 -	TBool iIsReadyForRemoval;
   1.196 -	};
   1.197 -
   1.198 -//
   1.199 -// class CEikSrvNotifierRemover
   1.200 -//
   1.201 -
   1.202 -/**
   1.203 -@internalComponent 
   1.204 -*/
   1.205 -NONSHARABLE_CLASS(CEikSrvNotifierRemover) : public CActive
   1.206 -	{
   1.207 -public:
   1.208 -	static CEikSrvNotifierRemover* NewL();
   1.209 -	void Start(CEikSrvNotifierManager* aManager, CArrayPtr<CEikSrvNotifierWrapper>* aObservedList);
   1.210 -	~CEikSrvNotifierRemover();
   1.211 -private:
   1.212 -	CEikSrvNotifierRemover();
   1.213 -private:
   1.214 -	// from CActive
   1.215 -	void RunL();
   1.216 -	void DoCancel();
   1.217 -public:
   1.218 -	CEikSrvNotifierManager* iManager;
   1.219 -	CArrayPtr<CEikSrvNotifierWrapper>* iObservedList;
   1.220 -	};
   1.221 -
   1.222 -
   1.223 -/**
   1.224 -@internalComponent 
   1.225 -*/
   1.226 -NONSHARABLE_CLASS(CEikNotifierQueue) : public CBase
   1.227 -	{
   1.228 -public:
   1.229 -	class CQueueItem;
   1.230 -public:
   1.231 -	static CEikNotifierQueue* NewL();
   1.232 -	inline void QueueItemL(CEikNotifierQueue::CQueueItem* aItem);
   1.233 -	CQueueItem* FetchItem(TUid aChannel);
   1.234 -	TBool IsAlreadyQueued(TUid aNotifier,TUid aChannel) const;
   1.235 -	void RemoveClient(TInt aClientId);
   1.236 -	TInt GetHighestQueuePriority(TUid aChannel);
   1.237 -	inline TInt Count() const;
   1.238 -	const CQueueItem& At(TInt aIndex) const;
   1.239 -	void RemoveNotifier(TUid aNotifierUid);
   1.240 -public:
   1.241 -	NONSHARABLE_CLASS(CQueueItem) : public CBase
   1.242 -		{
   1.243 -	public:
   1.244 -		static CQueueItem* NewLC(const MEikSrvNotifierBase2::TNotifierInfo& aInfo, TInt aClientId, const TDesC8& aBuffer, const RMessage2& aMessage, TInt aReplySlot);
   1.245 -		~CQueueItem();
   1.246 -		inline const TDesC8& Buffer() const {return *iBuffer;}
   1.247 -	private:
   1.248 -		CQueueItem(const MEikSrvNotifierBase2::TNotifierInfo& aInfo, TInt aClientId, const RMessage2& aMessage, TInt aReplySlot);
   1.249 -		void ConstructL(const TDesC8& aBuffer);
   1.250 -	public:
   1.251 -		const MEikSrvNotifierBase2::TNotifierInfo iInfo;
   1.252 -		const TInt iClientId;
   1.253 -		const RMessage2 iMessage;
   1.254 -		TInt iReplySlot;
   1.255 -	private:
   1.256 -		HBufC8* iBuffer;
   1.257 -		};
   1.258 -private:
   1.259 -	inline CEikNotifierQueue();
   1.260 -private:
   1.261 -	CArrayPtrFlat<CQueueItem> iQueue;
   1.262 -	};
   1.263 -
   1.264 -class MNotifierStarter;
   1.265 -class MNotifierUpdater;
   1.266 -class CDiscoverNewImplementation;
   1.267 -class CPluginTrack;
   1.268 -
   1.269 -/**
   1.270 -@internalComponent
   1.271 -*/
   1.272 -NONSHARABLE_CLASS(CEikSrvNotifierManager) : public CBase, public MEikSrvNotifierManager
   1.273 -	{
   1.274 -public:
   1.275 -	static CEikSrvNotifierManager* NewL();
   1.276 -	~CEikSrvNotifierManager();
   1.277 -	void NotifierStartL(TUid aNotifierUid,const TDesC8& aBuffer,TDes8* aResponse,TInt aClientId);
   1.278 -	TInt NotifierUpdateL(TUid aNotifierUid,const TDesC8& aBuffer,TDes8* aResponse,TInt aClientId);
   1.279 -	TInt NotifierCancel(TUid aNotifierUid);
   1.280 -	void NotifierStartAndGetResponseL(TUid aNotifierUid,const TDesC8& aBuffer,TInt aReplySlot,
   1.281 -										const RMessage2& aMessage,TInt aClientId,TBool& aCleanupComplete);
   1.282 -	void HandleClientExit(TInt aClientId);
   1.283 -	void NotifierStartAndGetResponseL(TUid aNotifierUid,TUid aChannelUid,const TDesC8& aBuffer,TInt aReplySlot,
   1.284 -										const RMessage2& aMessage,TInt aClientId,TBool& aCleanupComplete);
   1.285 -	void HandleScreenDeviceChangedL();
   1.286 -	void RegisterSingleNotifierFromTransientPlugInL(TUid aPlugInUid, TUid aNotifierUid);
   1.287 -	void NotifierUpdateAndGetResponseL(TUid aNotifierUid,const TDesC8& aBuffer,TInt aReplySlot,
   1.288 -										const RMessage2& aMessage,TInt aClientId);
   1.289 -public:
   1.290 -	void RegisterL();
   1.291 -	void CheckForEcomPluginInstallUninstall();
   1.292 -public: // from MEikSrvNotifierManager 
   1.293 -	void StartNotifierL(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
   1.294 -	void CancelNotifier(TUid aNotifierUid);
   1.295 -	void UpdateNotifierL(TUid aNotifierUid,const TDesC8& aBuffer,TDes8& aResponse);
   1.296 -private:
   1.297 -	void DoAddPlugInL(const TDesC& aPath,const TDesC& aFileName,const TUidType& aUidType);
   1.298 -	void TryAddNotifiersFromNotifierArrayL(CArrayPtr<CEikSrvNotifierWrapper>* aNotifierArray, TInt& aRollBackChannels);
   1.299 -	CEikSrvNotifierManager();
   1.300 -	void ConstructL();
   1.301 -	void StartNextFromQueue(TUid aChannel);
   1.302 -	void DoStartQueuedItemLD(CEikNotifierQueue::CQueueItem* aItem);
   1.303 -	TBool NotifierHandlesScreenMode(MEikSrvNotifierBase2* aNotifier);
   1.304 -	CArrayPtr<CEikSrvNotifierWrapper>* TryLoadPlugInL(TUid aPlugInUid);
   1.305 -	TBool TryLoadPlugInFromSpecifiedDriveL(RFs& aFs, TUid aPlugInUid, TInt aDriveIndex, CArrayPtr<CEikSrvNotifierWrapper>*& aNotifierArray);
   1.306 -	CArrayPtr<CEikSrvNotifierWrapper>* LoadPlugInAndPopulateNotifierArrayL(const TDesC& aPath, const TDesC& aFileName, const TUidType& aUidType);
   1.307 -	TInt QueueNotifierForPossibleRemoval(TUid aNotifierUid);
   1.308 -	CArrayPtr<CEikSrvNotifierWrapper>* CreateNotifierArrayFromPlugInArrayL(CArrayPtr<MEikSrvNotifierBase2>* aPlugInArray, const TUidType& aUidType);
   1.309 -	void UpdateHighestPriorityNotifiersOnThisChannelOfTheirPausingOrResuming(TUid aChannelUid, TUid aHighestPriorityNotifierOnThisChannelUid, const TDesC8& aBuffer);
   1.310 -	void TryFindAndRegisterNotifierFromPlugInDllL(TUid aNotifierUid);
   1.311 -	void LookForNotifierInObservedListL(TUid aNotifierUid, TUid aChannelUid, RArray<TInt>& aNotifierPositions);
   1.312 -	void DoNotifierStartL(MNotifierStarter& aNotifierStarter, TBool& aCleanupComplete, TUid aNotifierUid, TUid aChannelUid, const TDesC8& aBuffer, TDes8* aResponse, TInt aClientId);
   1.313 -	TInt DoNotifierUpdateL(MNotifierUpdater& aNotifierStarter, TUid aNotifierUid, const TDesC8& aBuffer, TDes8* aResponse, TInt aClientId);
   1.314 -private:
   1.315 -	void DoAddPlugInL(TUid aUid);
   1.316 -	CArrayPtr<CEikSrvNotifierWrapper>* LoadPlugInAndPopulateNotifierArrayL(TUid aUid);
   1.317 -	void UnloadEComPlugInImplementation(TInt aIndex);
   1.318 -	TBool IsImplementationRemoved(TUid aImplementationUid, RImplInfoPtrArray& aPlugInArray);
   1.319 -	TBool IsImplementationAdded(TUid aImplementationUid);
   1.320 -private:
   1.321 -	CArrayPtr<CEikSrvNotifierWrapper>* iObservedList;
   1.322 -	CChannelMonitor* iChannelMonitor;
   1.323 -	CActivityMonitor* iActivityMonitor;
   1.324 -	CEikNotifierQueue* iQueue;
   1.325 -	CEikSrvNotifierRemover* iNotifierRemover;
   1.326 -	CDiscoverNewImplementation* iDiscoverNewImplementation;
   1.327 -	RPointerArray <CPluginTrack> iPluginUidList;
   1.328 -	};
   1.329 -
   1.330 -
   1.331 -/**
   1.332 -@internalComponent 
   1.333 -*/
   1.334 -NONSHARABLE_CLASS(CChannelMonitor) : public CBase
   1.335 -	{
   1.336 -public:
   1.337 -	static CChannelMonitor* NewL();
   1.338 -	inline void AddNewChannelL(TUid aChannel);
   1.339 -	void DeleteChannel(TInt aIndex);
   1.340 -	TInt NumberOfChannels() const;
   1.341 -	TBool AlreadyHasChannel(TUid aChannel) const;
   1.342 -	TInt ActivityLevel(TUid aChannel) const;
   1.343 -	void UpdateChannel(TUid aChannel, TInt aLevel);
   1.344 -private:
   1.345 -	CChannelMonitor();
   1.346 -private:
   1.347 -	/**
   1.348 -	@internalComponent
   1.349 -	*/
   1.350 -	NONSHARABLE_CLASS(TChannelActivity)
   1.351 -		{
   1.352 -	public:
   1.353 -		inline TChannelActivity(TUid aChannel, TInt aHighestPriorityRunning);
   1.354 -	public:
   1.355 -		TUid iChannel;
   1.356 -		TInt iHighestPriorityRunning;
   1.357 -		};	
   1.358 -private:
   1.359 -	CArrayFixFlat<TChannelActivity> iMonitor;
   1.360 -	};
   1.361 -
   1.362 -
   1.363 -/**
   1.364 -@internalComponent 
   1.365 -*/
   1.366 -NONSHARABLE_CLASS(CActivityMonitor) : public CBase
   1.367 -	{
   1.368 -public:
   1.369 -	static CActivityMonitor* NewL();
   1.370 -	~CActivityMonitor();
   1.371 -	void AddL(const MEikSrvNotifierBase2::TNotifierInfo& aInfo, TInt aClientId);
   1.372 -	void Remove(TUid aNotifierUid, TInt aClientId);
   1.373 -	void RemoveNotifier(TUid aNotifierUid, TUid aChannel);
   1.374 -	void RemoveClient(TInt aClientId);
   1.375 -	TBool IsNotifierActive(TUid aNotifierUid,TUid aChannel) const;
   1.376 -	TBool IsChannelActive(TUid aChannel, TUid& aNotifier,MEikSrvNotifierBase2::TNotifierPriority& aHighestPriority) const;
   1.377 -	TBool IsClientPresent(TUid aNotifierUid, TUid aChannel, TInt aClientId) const;
   1.378 -	TBool NotifierForClient(TUid& aNotifier, TInt aClientId) const;
   1.379 -private:
   1.380 -	CActivityMonitor();
   1.381 -	TInt Find(TUid aNotifierUid) const;
   1.382 -	TInt Find(TUid aNotifierUid, TUid aChannel) const;
   1.383 -private:
   1.384 -	/**
   1.385 -	@internalComponent 
   1.386 -	*/
   1.387 -	NONSHARABLE_CLASS(CNotifierActivity) : public CBase
   1.388 -		{
   1.389 -	public:
   1.390 -		static CNotifierActivity* NewLC(const MEikSrvNotifierBase2::TNotifierInfo& aInfo, TInt aClientId);
   1.391 -		~CNotifierActivity();
   1.392 -		TInt Find(TInt aClientId) const;
   1.393 -	private:
   1.394 -		CNotifierActivity(const MEikSrvNotifierBase2::TNotifierInfo& aInfo);
   1.395 -		void ConstructL(TInt aClientId);
   1.396 -	public:
   1.397 -		const MEikSrvNotifierBase2::TNotifierInfo iInfo;
   1.398 -		CArrayFixFlat<TInt> iClientArray;
   1.399 -		};	
   1.400 -private:
   1.401 -	CArrayPtrFlat<CNotifierActivity> iMonitor;
   1.402 -	};
   1.403 -	
   1.404 -
   1.405 -inline CChannelMonitor::TChannelActivity::TChannelActivity(TUid aChannel, TInt aHighestPriorityRunning)
   1.406 -	:iChannel(aChannel), iHighestPriorityRunning(aHighestPriorityRunning)
   1.407 -	{}
   1.408 -
   1.409 -inline void CChannelMonitor::AddNewChannelL(TUid aChannel)
   1.410 -	{iMonitor.AppendL(TChannelActivity(aChannel,0));}
   1.411 -
   1.412 -inline CEikSrvNotifierManager* CEikServNotifyServer::Manager() const
   1.413 -	{return iManager;}
   1.414 -
   1.415 -inline void CEikNotifierQueue::QueueItemL(CEikNotifierQueue::CQueueItem* aItem)
   1.416 -	{iQueue.AppendL(aItem);}
   1.417 -	
   1.418 -inline TInt CEikNotifierQueue::Count() const
   1.419 -	{return iQueue.Count();}
   1.420 -	
   1.421 -inline CEikNotifierQueue::CEikNotifierQueue()
   1.422 -	:iQueue(3)
   1.423 -	{}
   1.424 -
   1.425 -
   1.426 -#endif	// __EIKNFYSV_H__