sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\locale\t_msgtxt.cpp sl@0: // Tests the TLocaleMessageText class sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: sl@0: LOCAL_D TBuf* localeBufs[ELocaleMessages_LastMsg]; sl@0: sl@0: RTest test(_L("T_MSGTXT")); sl@0: sl@0: LOCAL_C void DisplayMessages() sl@0: // sl@0: // Display the locale messages sl@0: // sl@0: { sl@0: sl@0: RNotifier notifier; sl@0: TInt r=notifier.Connect(); sl@0: test(r==KErrNone); sl@0: TRequestStatus status; sl@0: TInt buttonVal=0; sl@0: sl@0: test.Next(_L("Test File Server Error Dialogs")); sl@0: TLocaleMessageText msgTxt; sl@0: msgTxt.Set(EFileServer_Button1); sl@0: TBuf button1(msgTxt); sl@0: msgTxt.Set(EFileServer_Button2); sl@0: TBuf button2(msgTxt); sl@0: sl@0: test.Next(_L("DIALOG1: Displayed if a disk is removed during a write")); sl@0: User::After(300000); sl@0: test.Printf(_L("***Press SHIFT+R or SHIFT+S to confim dialogue***\n")); sl@0: TInt count=2; sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: TBuf line1=msgTxt; sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: TBuf line2=msgTxt; sl@0: notifier.Notify(line1,line2,button1,button2,buttonVal,status); sl@0: User::WaitForRequest(status); sl@0: User::After(300000); sl@0: sl@0: test.Next(_L("DIALOG2: Write failed due to low power")); sl@0: User::After(300000); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: line1=msgTxt; sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: line2=msgTxt; sl@0: notifier.Notify(line1,line2,button1,button2,buttonVal,status); sl@0: User::WaitForRequest(status); sl@0: User::After(300000); sl@0: sl@0: test.Next(_L("DIALOG3: General error message - disk write failed")); sl@0: User::After(300000); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: line1=msgTxt; sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: line2=msgTxt; sl@0: notifier.Notify(line1,line2,button1,button2,buttonVal,status); sl@0: User::WaitForRequest(status); sl@0: User::After(300000); sl@0: test.Printf(_L("***End***\n\n")); sl@0: sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("ALARMNAME: 'Chimes' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("ALARMNAME: 'Rings' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("ALARMNAME: 'Signal' - %S\n"),&msgTxt); sl@0: test.Printf(_L("***Press any key***\n\n")); sl@0: test.Getch(); sl@0: sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'Internal' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External1' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External2' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External3' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External4' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External5' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External6' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External7' - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("DISKNAME: 'External8' - %S\n"),&msgTxt); sl@0: test.Printf(_L("***Press any key***\n\n")); sl@0: test.Getch(); sl@0: sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("SOCKETNAME0: - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("SOCKETNAME1: - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("SOCKETNAME2: - %S\n"),&msgTxt); sl@0: msgTxt.Set((TLocaleMessage)count++); sl@0: test.Printf(_L("SOCKETNAME3: - %S\n"),&msgTxt); sl@0: notifier.Close(); sl@0: } sl@0: sl@0: TInt E32Main() sl@0: // sl@0: // Main sl@0: // sl@0: { sl@0: sl@0: test.Title(); sl@0: // TBuf* localeBufs[ELocaleMessages_LastMsg]; {Too big for local decleration} sl@0: sl@0: test.Start(_L("Constructor")); sl@0: TLocaleMessageText msgTxt; sl@0: msgTxt.Set((TLocaleMessage)4); sl@0: TInt count=0; sl@0: for (count=0;count(msgTxt); sl@0: test(localeBufs[count]!=NULL); sl@0: } sl@0: sl@0: test.Next(_L("Set")); sl@0: for (count=0;count