commonuisupport/uikon/test/teiksrv/tnotdial/tpluginV2.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #include <techview/eikdialg.h>
       
    23 #include <tnotdial.rsg>
       
    24 #include <bautils.h>
       
    25 #include "tpluginV2.h"
       
    26 #include "tnotdial.h"
       
    27 
       
    28 #include <uikon.hrh>
       
    29 #include <tnotdial.rsg>
       
    30 #include <uikon/eikscchange.h>
       
    31 
       
    32 const TUid KScreenOutputChannel ={0x00000666};
       
    33 const TUid KLEDOutputChannel ={0x00000111};
       
    34 
       
    35 _LIT(KResFileNamePath,"\\system\\test\\tnotdial\\");
       
    36 _LIT(KResFileName1,"tnotdial.rsc");
       
    37 
       
    38 _LIT8(KStartAgendaDialogResponse,"Response: started Agenda dialog (asynch.)");
       
    39 _LIT8(KStartAgendaLEDResponse,"Response: started LED Agenda notifier (asynch.)");
       
    40 _LIT8(KUpdateAgendaDialogResponseAsync,"Response: Updated Agenda dialog (asynch.)");
       
    41 _LIT8(KUpdateAgendaLEDResponseAsync,"Response: Updated LED Agenda notifier (asynch.)");
       
    42 _LIT8(KUpdateAgendaResponse, "Response: Updated Agenda Dialog");
       
    43 _LIT8(KUpdateAgendaLEDResponse,"Response: Updated Agenda LED");
       
    44 _LIT8(KUpdatePhoneResponse, "Response: Updated Phone Dialog");
       
    45 _LIT8(KUpdatePhoneLEDResponse, "Response: Updated Phone LED");
       
    46 _LIT8(KUpdatePhoneResponseAsync, "Response: Updated Phone Dialog (asynch.)");
       
    47 _LIT8(KUpdatePhoneLEDResponseAsync, "Response: Updated Phone LED (asynch.)");
       
    48 _LIT8(KUpdateBatteryResponse, "Response: Updated Battery Dialog");
       
    49 _LIT8(KUpdateBatteryLEDResponse, "Response: Updated Battery LED");
       
    50 _LIT8(KUpdateBatteryResponseAsync, "Response: Updated Battery Dialog (asynch.)");
       
    51 _LIT8(KUpdateBatteryLEDResponseAsync, "Response: Updated Battery LED (asynch.)");
       
    52 
       
    53 EXPORT_C   CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
    54 //
       
    55 // Lib main entry point
       
    56 //
       
    57 	{
       
    58 	//RDebug::Print(_L("\nExported entry point\n"));
       
    59 	CArrayPtrFlat<MEikSrvNotifierBase2>* subjects=new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(6);
       
    60 	CleanupStack::PushL(subjects);
       
    61 	subjects->AppendL(CMyPhoneNotifierSubject::NewLC()); 
       
    62 	subjects->AppendL(CMyLEDPhoneNotifierSubject::NewLC());
       
    63 	subjects->AppendL(CMyLEDLowBatteryNotifierSubject::NewLC());
       
    64 	subjects->AppendL(CMyLowBatteryNotifierSubject::NewLC()); 
       
    65 	subjects->AppendL(CMyAgendaNotifierSubject::NewLC()); 
       
    66 	subjects->AppendL(CMyLEDAgendaNotifierSubject::NewLC());
       
    67 	CleanupStack::Pop(7, subjects);
       
    68 	return subjects;
       
    69 	}
       
    70 
       
    71 GLDEF_C TInt E32Dll(
       
    72 					)
       
    73 //
       
    74 // DLL entry point
       
    75 //
       
    76 	{
       
    77 //	INFO_PRINTF1(_L("\nPlugin E32 Dll entry point\n"));
       
    78     return(KErrNone);
       
    79    	}
       
    80 
       
    81 
       
    82 void CMyPhoneNotifierSubject::Release()
       
    83 	{
       
    84 	delete this;
       
    85 	}
       
    86 
       
    87 CMyPhoneNotifierSubject::TNotifierInfo CMyPhoneNotifierSubject::RegisterL()
       
    88 	{
       
    89 	iInfo.iUid=KMyNewPhoneNotifierUid;
       
    90 	iInfo.iChannel=KScreenOutputChannel;
       
    91 	iInfo.iPriority=ENotifierPriorityVHigh;
       
    92 	return iInfo;
       
    93 	}
       
    94 
       
    95 CMyPhoneNotifierSubject::TNotifierInfo CMyPhoneNotifierSubject::Info() const
       
    96 	{
       
    97 	return iInfo;
       
    98 	}
       
    99 
       
   100 TPtrC8 CMyPhoneNotifierSubject::StartL(const TDesC8& /*aBuffer*/)
       
   101 	{
       
   102 	RDebug::Print(_L("Plugin: Phone notifier started\n"));
       
   103 	RouseSleepingDialog();
       
   104 	return KNullDesC8();
       
   105 	}
       
   106 
       
   107 
       
   108 void CMyPhoneNotifierSubject::StartL(const TDesC8& aBuffer, TInt /*aReplySlot*/, const RMessagePtr2& aMessage)
       
   109 	{
       
   110 	RDebug::Print(_L("Plugin: Phone notifier started\n"));
       
   111 	StartL(aBuffer);
       
   112 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   113 	}
       
   114 
       
   115 void CMyPhoneNotifierSubject::Cancel()
       
   116 	{
       
   117 	RDebug::Print(_L("Plugin: Phone notifier canceled\n"));
       
   118 	ExitSleepingDialog();
       
   119 	}
       
   120 
       
   121 TPtrC8 CMyPhoneNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   122 	{
       
   123 	RDebug::Print(_L("Plugin: Phone notifier updated\n"));
       
   124 	TBuf<100> buffer;
       
   125 	buffer.Copy(aBuffer);
       
   126 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   127 	return KUpdatePhoneResponse();
       
   128 	}
       
   129 
       
   130 void CMyPhoneNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   131 	{
       
   132 	RDebug::Print(_L("Plugin: Phone notifier updated (asynch. call) \n"));
       
   133 	UpdateL(aBuffer);
       
   134 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdatePhoneResponseAsync));
       
   135 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdatePhoneResponseAsync))"),err));
       
   136 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   137 	}
       
   138 
       
   139 CMyPhoneNotifierSubject* CMyPhoneNotifierSubject::NewLC()
       
   140 	{
       
   141 	CMyPhoneNotifierSubject* self=new (ELeave) CMyPhoneNotifierSubject();
       
   142 	CleanupStack::PushL(self);
       
   143 	self->ConstructL();
       
   144 	return self;
       
   145 	}
       
   146 
       
   147 CMyPhoneNotifierSubject::CMyPhoneNotifierSubject()
       
   148 	{
       
   149 	}
       
   150 
       
   151 CMyPhoneNotifierSubject::~CMyPhoneNotifierSubject()
       
   152 	{
       
   153 	}
       
   154 
       
   155 void CMyPhoneNotifierSubject::ConstructL()
       
   156 	{
       
   157 	//Get the system filesession	
       
   158 	RFs& fs = CEikonEnv::Static()->FsSession(); 
       
   159 	//Get the file finder 
       
   160 	TFindFile* findFile=new(ELeave) TFindFile(fs);
       
   161     CleanupStack::PushL(findFile);
       
   162 	//File name parser
       
   163 	TParse* fileNameParser=new(ELeave) TParse;
       
   164     CleanupStack::PushL(fileNameParser);
       
   165 
       
   166 	//search for all rsc files in *\system\libs\plugins\*.rsc
       
   167 	CDir* directory=NULL;
       
   168 	User::LeaveIfError(findFile->FindWildByDir(KResFileName1, KResFileNamePath, directory));
       
   169 	CleanupStack::PushL(directory);
       
   170 
       
   171 	const TEntry& entry=(*directory)[directory->Count()-1];
       
   172 	fileNameParser->Set(entry.iName,&findFile->File(),NULL);
       
   173 	TFileName resourceFileName(fileNameParser->FullName());
       
   174 	
       
   175 	BaflUtils::NearestLanguageFile(iCoeEnv->FsSession(),resourceFileName);
       
   176 	RDebug::Print(_L("Resource file name [%S]"),&resourceFileName);
       
   177 	TInt offset=iEikonEnv->AddResourceFileL(resourceFileName);
       
   178 	CleanupStack::PopAndDestroy(3);
       
   179 
       
   180 	TRAPD(err,ConstructSleepingAlertDialogL(R_PHONE_RINGS));
       
   181 	iEikonEnv->DeleteResourceFile(offset);
       
   182 	User::LeaveIfError(err);
       
   183 	}
       
   184 
       
   185 void CMyPhoneNotifierSubject::PreLayoutDynInitL()
       
   186 	{ // must not fail
       
   187 	}
       
   188 
       
   189 TBool CMyPhoneNotifierSubject::OkToExitL(TInt /*aButtonId*/)
       
   190 	{
       
   191 	iManager->CancelNotifier(iInfo.iUid);
       
   192 	return ETrue;
       
   193 	}
       
   194 
       
   195 void CMyLowBatteryNotifierSubject::Release()
       
   196 	{
       
   197 	delete this;
       
   198 	}
       
   199 
       
   200 CMyLowBatteryNotifierSubject::TNotifierInfo CMyLowBatteryNotifierSubject::RegisterL()
       
   201 	{
       
   202 	iInfo.iUid=KMyNewLowBatteryNotifierUid;
       
   203 	iInfo.iChannel=KScreenOutputChannel;
       
   204 	iInfo.iPriority=ENotifierPriorityAbsolute;
       
   205 	return iInfo;
       
   206 	}
       
   207 
       
   208 CMyLowBatteryNotifierSubject::TNotifierInfo CMyLowBatteryNotifierSubject::Info() const
       
   209 	{
       
   210 	return iInfo;
       
   211 	}
       
   212 
       
   213 TPtrC8 CMyLowBatteryNotifierSubject::StartL(const TDesC8& /*aBuffer*/)
       
   214 	{
       
   215 	RDebug::Print(_L("Plugin: Low battery notifier started\n"));
       
   216 	RouseSleepingDialog();
       
   217 	return KNullDesC8();
       
   218 	}
       
   219 
       
   220 void CMyLowBatteryNotifierSubject::StartL(const TDesC8& aBuffer, TInt /*aReplySlot*/, const RMessagePtr2& aMessage)
       
   221 	{
       
   222 	RDebug::Print(_L("Plugin: Low battery notifier started \n"));
       
   223 	StartL(aBuffer);
       
   224 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   225 	}
       
   226 
       
   227 void CMyLowBatteryNotifierSubject::Cancel()
       
   228 	{
       
   229 	RDebug::Print(_L("Plugin: Low battery notifier canceled\n"));
       
   230 	ExitSleepingDialog();
       
   231 	}
       
   232 
       
   233 TPtrC8 CMyLowBatteryNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   234 	{
       
   235 	RDebug::Print(_L("Plugin: Low battery notifier updated\n"));
       
   236 	TBuf<100> buffer;
       
   237 	buffer.Copy(aBuffer);
       
   238 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   239 	return KUpdateBatteryResponse();
       
   240 	}
       
   241 
       
   242 void CMyLowBatteryNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   243 	{
       
   244 	RDebug::Print(_L("Plugin: Low Battery notifier updated (asynch. call) \n"));
       
   245 	UpdateL(aBuffer);
       
   246 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdateBatteryResponseAsync));
       
   247 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdateBatteryResponseAsync)"),err));
       
   248 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   249 	}
       
   250 
       
   251 CMyLowBatteryNotifierSubject* CMyLowBatteryNotifierSubject::NewLC()
       
   252 	{
       
   253 	CMyLowBatteryNotifierSubject* self=new (ELeave) CMyLowBatteryNotifierSubject();
       
   254 	CleanupStack::PushL(self);
       
   255 	self->ConstructL();
       
   256 	return self;
       
   257 	}
       
   258 
       
   259 CMyLowBatteryNotifierSubject::CMyLowBatteryNotifierSubject()
       
   260 	{
       
   261 	}
       
   262 
       
   263 CMyLowBatteryNotifierSubject::~CMyLowBatteryNotifierSubject()
       
   264 	{
       
   265 	}
       
   266 
       
   267 void CMyLowBatteryNotifierSubject::ConstructL()
       
   268 	{
       
   269 	//Get the system filesession	
       
   270 	RFs& fs = CEikonEnv::Static()->FsSession(); 
       
   271 	//Get the file finder 
       
   272 	TFindFile* findFile=new(ELeave) TFindFile(fs);
       
   273     CleanupStack::PushL(findFile);
       
   274 	//File name parser
       
   275 	TParse* fileNameParser=new(ELeave) TParse;
       
   276     CleanupStack::PushL(fileNameParser);
       
   277 
       
   278 	//search for all rsc files in *\system\libs\plugins\*.rsc
       
   279 	CDir* directory=NULL;
       
   280 	User::LeaveIfError(findFile->FindWildByDir(KResFileName1, KResFileNamePath, directory));
       
   281 	CleanupStack::PushL(directory);
       
   282 
       
   283 	const TEntry& entry=(*directory)[directory->Count()-1];
       
   284 	fileNameParser->Set(entry.iName,&findFile->File(),NULL);
       
   285 	TFileName resourceFileName(fileNameParser->FullName());
       
   286 
       
   287 	BaflUtils::NearestLanguageFile(iCoeEnv->FsSession(),resourceFileName);
       
   288 	RDebug::Print(_L("Resource file name [%S]"),&resourceFileName);
       
   289 	TInt offset=iEikonEnv->AddResourceFileL(resourceFileName);
       
   290 	CleanupStack::PopAndDestroy(3);
       
   291 
       
   292 	TRAPD(err,ConstructSleepingAlertDialogL(R_LOW_BATTERY));
       
   293 	iEikonEnv->DeleteResourceFile(offset);
       
   294 	User::LeaveIfError(err);
       
   295 	}
       
   296 
       
   297 void CMyLowBatteryNotifierSubject::HandleSystemEventL(TUid aEvent)
       
   298 	//Added for flip support GPO 18.05.2001
       
   299 	{
       
   300 	if(aEvent == KUidEventScreenModeChanged)
       
   301 		{
       
   302 		RDebug::Print(_L("MyLowBatteryNotifier had been notified of a EFlipChanged Event.\n"));
       
   303 		}
       
   304 	else
       
   305 		{
       
   306 		ASSERT(EFalse);
       
   307 		}
       
   308 	}
       
   309 
       
   310 TInt CMyLowBatteryNotifierSubject::NotifierCapabilites()
       
   311 	//Added for flip support GPO 18.05.2001
       
   312 	{
       
   313 	TInt capabilities=0;
       
   314 	capabilities |=EScreenDeviceChangeSupported;
       
   315 	return capabilities;
       
   316 	}
       
   317 
       
   318 void CMyLowBatteryNotifierSubject::PreLayoutDynInitL()
       
   319 	{ // must not fail
       
   320 	}
       
   321 
       
   322 TBool CMyLowBatteryNotifierSubject::OkToExitL(TInt /*aButtonId*/)
       
   323 	{
       
   324 	iManager->CancelNotifier(iInfo.iUid);
       
   325 	return ETrue;
       
   326 	}
       
   327 
       
   328 void CMyAgendaNotifierSubject::Release()
       
   329 	{
       
   330 	delete this;
       
   331 	}
       
   332 
       
   333 CMyAgendaNotifierSubject::TNotifierInfo CMyAgendaNotifierSubject::RegisterL()
       
   334 	{
       
   335 	iInfo.iUid=KMyNewAgendaAlarmUid;
       
   336 	iInfo.iChannel=KScreenOutputChannel;
       
   337 	iInfo.iPriority=ENotifierPriorityHigh;
       
   338 	return iInfo;
       
   339 	}
       
   340 CMyAgendaNotifierSubject::TNotifierInfo CMyAgendaNotifierSubject::Info() const
       
   341 	{
       
   342 	return iInfo;
       
   343 	}
       
   344 
       
   345 TPtrC8 CMyAgendaNotifierSubject::StartL(const TDesC8& /*aBuffer*/)
       
   346 	{
       
   347 	RDebug::Print(_L("Plugin: Agenda notifier started\n"));
       
   348 	if (!IsVisible())
       
   349 		{
       
   350 		RouseSleepingDialog();
       
   351 		}
       
   352 	return KNullDesC8();
       
   353 	}
       
   354 
       
   355 void CMyAgendaNotifierSubject::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   356 	{
       
   357 	RDebug::Print(_L("Plugin: Agenda notifier started (asynch.)\n"));
       
   358 	TRAPD(err,aMessage.WriteL(aReplySlot,KStartAgendaDialogResponse));
       
   359 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KStartAgendaDialogResponse)"),err));
       
   360 	StartL(aBuffer);
       
   361 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   362 	}
       
   363 
       
   364 void CMyAgendaNotifierSubject::Cancel()
       
   365 	{
       
   366 	RDebug::Print(_L("Plugin: Agenda notifier canceled"));
       
   367 	ExitSleepingDialog();
       
   368 	}
       
   369 
       
   370 TPtrC8 CMyAgendaNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   371 	{
       
   372 	RDebug::Print(_L("Plugin: Agenda notifier updated\n"));
       
   373 	TBuf<100> buffer;
       
   374 	buffer.Copy(aBuffer);
       
   375 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   376 	return KUpdateAgendaResponse();
       
   377 	}
       
   378 
       
   379 void CMyAgendaNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   380 	{
       
   381 	RDebug::Print(_L("Plugin: Agenda notifier updated (asynch. call) \n"));
       
   382 	UpdateL(aBuffer);
       
   383 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdateAgendaDialogResponseAsync));
       
   384 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdateAgendaDialogResponseAsync)"),err));
       
   385 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   386 	}
       
   387 
       
   388 CMyAgendaNotifierSubject* CMyAgendaNotifierSubject::NewLC()
       
   389 	{
       
   390 	CMyAgendaNotifierSubject* self=new (ELeave) CMyAgendaNotifierSubject();
       
   391 	CleanupStack::PushL(self);
       
   392 	self->ConstructL();
       
   393 	return self;
       
   394 	}
       
   395 
       
   396 CMyAgendaNotifierSubject::CMyAgendaNotifierSubject()
       
   397 	{
       
   398 	}
       
   399 
       
   400 void CMyAgendaNotifierSubject::ConstructL()
       
   401 	{
       
   402 	//Get the system filesession	
       
   403 	RFs& fs = CEikonEnv::Static()->FsSession(); 
       
   404 	//Get the file finder 
       
   405 	TFindFile* findFile=new(ELeave) TFindFile(fs);
       
   406     CleanupStack::PushL(findFile);
       
   407 	//File name parser
       
   408 	TParse* fileNameParser=new(ELeave) TParse;
       
   409     CleanupStack::PushL(fileNameParser);
       
   410 
       
   411 	//search for all rsc files in *\system\libs\plugins\*.rsc
       
   412 	CDir* directory=NULL;
       
   413 	User::LeaveIfError(findFile->FindWildByDir(KResFileName1, KResFileNamePath, directory));
       
   414 	CleanupStack::PushL(directory);
       
   415 
       
   416 	const TEntry& entry=(*directory)[directory->Count()-1];
       
   417 	fileNameParser->Set(entry.iName,&findFile->File(),NULL);
       
   418 	TFileName resourceFileName(fileNameParser->FullName());
       
   419 
       
   420 	BaflUtils::NearestLanguageFile(iCoeEnv->FsSession(),resourceFileName);
       
   421 	RDebug::Print(_L("Resource file name [%S]"),&resourceFileName);
       
   422 	TInt offset=iEikonEnv->AddResourceFileL(resourceFileName);
       
   423 	CleanupStack::PopAndDestroy(3);
       
   424 
       
   425 	TRAPD(err,ConstructSleepingAlertDialogL(R_AGENDA_ALARM));
       
   426 	iEikonEnv->DeleteResourceFile(offset);
       
   427 	User::LeaveIfError(err);
       
   428 	}
       
   429 
       
   430 CMyAgendaNotifierSubject::~CMyAgendaNotifierSubject()
       
   431 	{
       
   432 	}
       
   433 
       
   434 void CMyAgendaNotifierSubject::PreLayoutDynInitL()
       
   435 	{ // must not fail
       
   436 	}
       
   437 
       
   438 TBool CMyAgendaNotifierSubject::OkToExitL(TInt /*aButtonId*/)
       
   439 	{
       
   440 	iManager->CancelNotifier(iInfo.iUid);
       
   441 	return ETrue;
       
   442 	}
       
   443 
       
   444 void CMyLEDAgendaNotifierSubject::Release()
       
   445 	{
       
   446 	delete this;
       
   447 	}
       
   448 
       
   449 CMyLEDAgendaNotifierSubject::TNotifierInfo CMyLEDAgendaNotifierSubject::RegisterL()
       
   450 	{
       
   451 	iInfo.iUid=KMyNewAgendaAlarmUid;
       
   452 	iInfo.iChannel=KLEDOutputChannel;
       
   453 	iInfo.iPriority=ENotifierPriorityHigh;
       
   454 	return iInfo;
       
   455 	}
       
   456 
       
   457 CMyLEDAgendaNotifierSubject::TNotifierInfo CMyLEDAgendaNotifierSubject::Info() const
       
   458 	{
       
   459 	return iInfo;
       
   460 	}
       
   461 
       
   462 TPtrC8 CMyLEDAgendaNotifierSubject::StartL(const TDesC8& aBuffer)
       
   463 	{
       
   464 	RDebug::Print(_L("Plugin: LED Agenda notifier started\n"));
       
   465 	TBuf<100> buffer;
       
   466 	buffer.Copy(aBuffer);
       
   467 	iBusyMsgWin->StartDisplay(buffer,EHLeftVCenter);
       
   468 	return KNullDesC8();
       
   469 	}
       
   470 
       
   471 void CMyLEDAgendaNotifierSubject::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   472 	{
       
   473 	RDebug::Print(_L("Plugin: LED Agenda notifier started (asynch. call) \n"));
       
   474 	StartL(aBuffer);
       
   475 	TRAPD(err,aMessage.WriteL(aReplySlot,KStartAgendaLEDResponse));
       
   476 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KStartAgendaLEDResponse)"),err));
       
   477 //	aMessage.Complete(EEikNotExtRequestCompleted);
       
   478 	}
       
   479 
       
   480 void CMyLEDAgendaNotifierSubject::Cancel()
       
   481 	{
       
   482 	RDebug::Print(_L("Plugin: LED Agenda notifier canceled\n"));
       
   483 	iBusyMsgWin->CancelDisplay();
       
   484 	}
       
   485 
       
   486 TPtrC8 CMyLEDAgendaNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   487 	{
       
   488 	RDebug::Print(_L("Plugin: LED Agenda notifier updated\n"));
       
   489 	TBuf<100> buffer;
       
   490 	buffer.Copy(aBuffer);
       
   491 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   492 	return KUpdateAgendaLEDResponse();
       
   493 	}
       
   494 
       
   495 void CMyLEDAgendaNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   496 	{
       
   497 	RDebug::Print(_L("Plugin: LED Agenda notifier updated (asynch. call) \n"));
       
   498 	UpdateL(aBuffer);
       
   499 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdateAgendaLEDResponseAsync));
       
   500 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdateAgendaLEDResponseAsync)"),err));
       
   501 	}
       
   502 
       
   503 CMyLEDAgendaNotifierSubject* CMyLEDAgendaNotifierSubject::NewLC()
       
   504 	{
       
   505 	CMyLEDAgendaNotifierSubject* self=new (ELeave) CMyLEDAgendaNotifierSubject();
       
   506 	CleanupStack::PushL(self);
       
   507 	self->ConstructL();
       
   508 	return self;
       
   509 	}
       
   510 
       
   511 CMyLEDAgendaNotifierSubject::CMyLEDAgendaNotifierSubject()
       
   512 	{
       
   513 	}
       
   514 
       
   515 void CMyLEDAgendaNotifierSubject::ConstructL()
       
   516 	{
       
   517 	iBusyMsgWin=new(ELeave) CEikBusyMsgWin(*iEikonEnv);
       
   518 	iBusyMsgWin->ConstructL(iEikonEnv->RootWin());
       
   519 	}
       
   520 
       
   521 CMyLEDAgendaNotifierSubject::~CMyLEDAgendaNotifierSubject()
       
   522 	{
       
   523 	delete iBusyMsgWin;
       
   524 	}
       
   525 
       
   526 void CMyLEDLowBatteryNotifierSubject::Release()
       
   527 	{
       
   528 	delete this;
       
   529 	}
       
   530 
       
   531 CMyLEDLowBatteryNotifierSubject::TNotifierInfo CMyLEDLowBatteryNotifierSubject::RegisterL()
       
   532 	{
       
   533 	iInfo.iUid=KMyNewLowBatteryNotifierUid;
       
   534 	iInfo.iChannel=KLEDOutputChannel;
       
   535 	iInfo.iPriority=ENotifierPriorityAbsolute;
       
   536 	return iInfo;
       
   537 	}
       
   538 
       
   539 CMyLEDLowBatteryNotifierSubject::TNotifierInfo CMyLEDLowBatteryNotifierSubject::Info() const
       
   540 	{
       
   541 	return iInfo;
       
   542 	}
       
   543 
       
   544 TPtrC8 CMyLEDLowBatteryNotifierSubject::StartL(const TDesC8& aBuffer)
       
   545 	{
       
   546 	RDebug::Print(_L("Plugin: LED Battery notifier started\n"));
       
   547 	TBuf<100> buffer;
       
   548 	buffer.Copy(aBuffer);
       
   549 	iBusyMsgWin->StartDisplay(buffer,EHLeftVCenter);
       
   550 	return KNullDesC8();
       
   551 	}
       
   552 
       
   553 void CMyLEDLowBatteryNotifierSubject::StartL(const TDesC8& aBuffer, TInt /*aReplySlot*/,const RMessagePtr2& aMessage)
       
   554 	{
       
   555 	RDebug::Print(_L("Plugin: LEDLowBat notifier started\n"));
       
   556 	StartL(aBuffer);
       
   557 	aMessage.Complete(EEikNotExtRequestCompleted); //don't have to complete straight away
       
   558 	}
       
   559 
       
   560 void CMyLEDLowBatteryNotifierSubject::Cancel()
       
   561 	{
       
   562 	RDebug::Print(_L("Plugin: LEDLow battery notifier canceled\n"));
       
   563 	iBusyMsgWin->CancelDisplay();
       
   564 	}
       
   565 
       
   566 TPtrC8 CMyLEDLowBatteryNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   567 	{
       
   568 	RDebug::Print(_L("Plugin: LEDLow battery notifier updated"));
       
   569 	TBuf<100> buffer;
       
   570 	buffer.Copy(aBuffer);
       
   571 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   572 	return KUpdateBatteryLEDResponse();
       
   573 	}
       
   574 
       
   575 void CMyLEDLowBatteryNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   576 	{
       
   577 	RDebug::Print(_L("Plugin: LED Low Battery notifier updated (asynch. call) \n"));
       
   578 	UpdateL(aBuffer);
       
   579 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdateBatteryLEDResponseAsync));
       
   580 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdateBatteryLEDResponseAsync)"),err));
       
   581 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   582 	}
       
   583 
       
   584 CMyLEDLowBatteryNotifierSubject* CMyLEDLowBatteryNotifierSubject::NewLC()
       
   585 	{
       
   586 	CMyLEDLowBatteryNotifierSubject* self=new (ELeave) CMyLEDLowBatteryNotifierSubject();
       
   587 	CleanupStack::PushL(self);
       
   588 	self->ConstructL();
       
   589 	return self;
       
   590 	}
       
   591 
       
   592 CMyLEDLowBatteryNotifierSubject::CMyLEDLowBatteryNotifierSubject()
       
   593 	{
       
   594 	}
       
   595 
       
   596 CMyLEDLowBatteryNotifierSubject::~CMyLEDLowBatteryNotifierSubject()
       
   597 	{
       
   598 	delete iBusyMsgWin;
       
   599 	}
       
   600 
       
   601 void CMyLEDLowBatteryNotifierSubject::ConstructL()
       
   602 	{
       
   603 	iBusyMsgWin=new(ELeave) CEikBusyMsgWin(*iEikonEnv);
       
   604 	iBusyMsgWin->ConstructL(iEikonEnv->RootWin());
       
   605 	}
       
   606 
       
   607 void CMyLEDLowBatteryNotifierSubject::HandleSystemEventL(TUid aEvent)
       
   608 	//Added for flip support GPO 18.05.2001
       
   609 	{
       
   610 	if(aEvent == KUidEventScreenModeChanged)
       
   611 		{
       
   612 		RDebug::Print(_L("MyLEDLowBatteryNotifier had been notified of a EFlipChanged Event.\n"));
       
   613 		}
       
   614 	else
       
   615 		{
       
   616 		ASSERT(EFalse);
       
   617 		}
       
   618 	}
       
   619 
       
   620 TInt CMyLEDLowBatteryNotifierSubject::NotifierCapabilites()
       
   621 	//Added for flip support GPO 18.05.2001
       
   622 	{
       
   623 	TInt capabilities=0;
       
   624 	capabilities |=EScreenDeviceChangeSupported;
       
   625 	return capabilities;
       
   626 	}
       
   627 
       
   628 void CMyLEDPhoneNotifierSubject::Release()
       
   629 	{
       
   630 	delete this;
       
   631 	}
       
   632 
       
   633 CMyLEDPhoneNotifierSubject::TNotifierInfo CMyLEDPhoneNotifierSubject::RegisterL()
       
   634 	{
       
   635 	iInfo.iUid=KMyNewPhoneNotifierUid;
       
   636 	iInfo.iChannel=KLEDOutputChannel;
       
   637 	iInfo.iPriority=ENotifierPriorityVHigh;
       
   638 	return iInfo;
       
   639 	}
       
   640 
       
   641 CMyLEDPhoneNotifierSubject::TNotifierInfo CMyLEDPhoneNotifierSubject::Info() const
       
   642 	{
       
   643 	return iInfo;
       
   644 	}
       
   645 
       
   646 TPtrC8 CMyLEDPhoneNotifierSubject::StartL(const TDesC8& aBuffer)
       
   647 	{
       
   648 	RDebug::Print(_L("Plugin: LED Phone notifier started\n"));
       
   649 	TBuf<100> buffer;
       
   650 	buffer.Copy(aBuffer);
       
   651 	iBusyMsgWin->StartDisplay(buffer,EHLeftVCenter);
       
   652 	return KNullDesC8();
       
   653 	}
       
   654 
       
   655 void CMyLEDPhoneNotifierSubject::StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   656 	{
       
   657 	RDebug::Print(_L("Plugin: Phone notifier started \n"));
       
   658 	TPtrC8 boolDes(_L8("LED Channel: PhoneAsynch"));
       
   659 	TRAPD(err,aMessage.WriteL(aReplySlot,boolDes));
       
   660 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,boolDes)"),err));
       
   661 	StartL(aBuffer);
       
   662 	aMessage.Complete(EEikNotExtRequestCompleted); //don't have to complete straight away
       
   663 	}
       
   664 
       
   665 void CMyLEDPhoneNotifierSubject::Cancel()
       
   666 	{
       
   667 	RDebug::Print(_L("Plugin: LED Phone notifier canceled\n"));
       
   668 	iBusyMsgWin->CancelDisplay();
       
   669 	}
       
   670 
       
   671 TPtrC8 CMyLEDPhoneNotifierSubject::UpdateL(const TDesC8& aBuffer)
       
   672 	{
       
   673 	RDebug::Print(_L("Plugin: LED Phone notifier updated\n"));
       
   674 	TBuf<100> buffer;
       
   675 	buffer.Copy(aBuffer);
       
   676 	CEikonEnv::Static()->InfoMsgWithAlignment(EHLeftVBottom,buffer);
       
   677 	return KUpdatePhoneLEDResponse();
       
   678 	}
       
   679 
       
   680 void CMyLEDPhoneNotifierSubject::UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
       
   681 	{
       
   682 	RDebug::Print(_L("Plugin: LED Phone notifier updated (asynch. call) \n"));
       
   683 	UpdateL(aBuffer);
       
   684 	TRAPD(err,aMessage.WriteL(aReplySlot,KUpdatePhoneLEDResponseAsync));
       
   685 	__ASSERT_ALWAYS(!err,User::Panic(_L("WriteL(aReplySlot,KUpdatePhoneLEDResponseAsync)"),err));
       
   686 	aMessage.Complete(EEikNotExtRequestCompleted);
       
   687 	}
       
   688 
       
   689 CMyLEDPhoneNotifierSubject* CMyLEDPhoneNotifierSubject::NewLC()
       
   690 	{
       
   691 	CMyLEDPhoneNotifierSubject* self=new (ELeave) CMyLEDPhoneNotifierSubject();
       
   692 	CleanupStack::PushL(self);
       
   693 	self->ConstructL();
       
   694 	return self;
       
   695 	}
       
   696 
       
   697 CMyLEDPhoneNotifierSubject::CMyLEDPhoneNotifierSubject()
       
   698 	{
       
   699 	}
       
   700 
       
   701 void CMyLEDPhoneNotifierSubject::ConstructL()
       
   702 	{
       
   703 	iBusyMsgWin=new(ELeave) CEikBusyMsgWin(*iEikonEnv);
       
   704 	iBusyMsgWin->ConstructL(iEikonEnv->RootWin());
       
   705 	}
       
   706 
       
   707 CMyLEDPhoneNotifierSubject::~CMyLEDPhoneNotifierSubject()
       
   708 	{
       
   709 	delete iBusyMsgWin;
       
   710 	}
       
   711 
       
   712 
       
   713 //Adding ECOM SUPPORT
       
   714 #include <ecom/implementationproxy.h>
       
   715 const TImplementationProxy ImplementationTable[] =
       
   716 	{
       
   717 	IMPLEMENTATION_PROXY_ENTRY(0x10022239,NotifierArray)
       
   718 	};
       
   719 
       
   720 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   721 	{
       
   722 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
       
   723 	return ImplementationTable;
       
   724 	}