00001
00002
00003
00004
00005
00006
00007 #include "CommonFramework.h"
00008 #include <e32math.h>
00009
00010 #include <Notifier1Uids.h>
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 LOCAL_C void doExampleL()
00022 {
00023 _LIT(KTxtDisplayInfoMsg,"Display InfoMessage \n");
00024 console->Printf(KTxtDisplayInfoMsg);
00025
00026 _LIT(KTxtMsg,"A message");
00027 User::InfoPrint(KTxtMsg);
00028 User::After(4000000);
00029
00030
00031
00032 _LIT(KTxtDisplayDefRnotifier,"Display default RNotifier \n");
00033 console->Printf(KTxtDisplayDefRnotifier);
00034 _LIT(KTxtLine1,"Title (first) line.");
00035 _LIT(KTxtLine2,"Second (message) line. Text wraps and scrolls");
00036 _LIT(KButt1,"Button1");
00037 _LIT(KButt2,"Button2");
00038 TInt whichbutton(-1);
00039 TRequestStatus stat;
00040 RNotifier notifier;
00041 User::LeaveIfError(notifier.Connect());
00042 notifier.Notify(KTxtLine1,KTxtLine2,KButt1,KButt2,whichbutton,stat);
00043 User::WaitForRequest(stat);
00044 if (whichbutton==0)
00045 {
00046
00047 }
00048 if (whichbutton==1)
00049 {
00050
00051 }
00052 notifier.Close();
00053
00054
00055
00056 _LIT(KTxtDisplayCustomRnotifier,"Display custom notifier\n");
00057 console->Printf(KTxtDisplayCustomRnotifier);
00058
00059 RNotifier notifierSession;
00060 User::LeaveIfError(notifierSession.Connect());
00061 CleanupClosePushL(notifierSession);
00062
00063 _LIT8(KNotifier1StartText,"Notifier1 Launched");
00064 TInt err = notifierSession.StartNotifier(KNotifier1Uid, KNotifier1StartText);
00065
00066 User::LeaveIfError(err);
00067 User::After(3000000);
00068 _LIT(KTxtDisplayUpdateRnotifier,"Update custom notifier\n");
00069 console->Printf(KTxtDisplayUpdateRnotifier);
00070
00071 TBuf8<1> dummy;
00072 _LIT8(KNotifier1UpdateText,"Notifier1 Updated");
00073 notifierSession.UpdateNotifier(KNotifier1Uid, KNotifier1UpdateText, dummy);
00074 User::After(4000000);
00075 notifierSession.CancelNotifier(KNotifier1Uid);
00076 CleanupStack::PopAndDestroy(¬ifierSession);
00077 }
00078
00079
00080
00081
00082
00083
00084