classicui_pub/notes_api/tsrc/src/testsdknotesblockseikinfo.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Test EIKINFO.H
       
    15 *
       
    16 */
       
    17 
       
    18 #include <eikinfo.h>
       
    19 
       
    20 #include "testsdknotes.h"
       
    21 
       
    22 const TInt KLength = 10;
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CTestSDKNotes::TestNCEikInfoDialogL
       
    28 // -----------------------------------------------------------------------------
       
    29 TInt CTestSDKNotes::TestNCEikInfoDialogL( CStifItemParser& /*aItem*/ )
       
    30     {
       
    31     _LIT( KTitle, "Title" );
       
    32     _LIT( KMsg, "Msg" );
       
    33     TBuf<KLength> title( KTitle );
       
    34     TBuf<KLength> msg( KMsg );
       
    35     
       
    36     CEikInfoDialog* dialog = new (ELeave) CEikInfoDialog( title, msg );
       
    37     CleanupStack::PushL( dialog );
       
    38     STIF_ASSERT_NOT_NULL( dialog );
       
    39     CleanupStack::PopAndDestroy( dialog );
       
    40     
       
    41     return KErrNone;
       
    42     
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CTestSDKNotes::TestNCEikInfoDialogL
       
    47 // -----------------------------------------------------------------------------
       
    48 TInt CTestSDKNotes::TestNRunDlgLD( CStifItemParser& /*aItem*/ )
       
    49     {
       
    50     _LIT( KTitle, "Title" );
       
    51     _LIT( KMsg, "Msg" );
       
    52     TBuf<KLength> title( KTitle );
       
    53     TBuf<KLength> msg( KMsg );
       
    54     
       
    55     CEikInfoDialog* dialog = new (ELeave) CEikInfoDialog(  title, msg, CEikInfoDialog::EAllowEnter );
       
    56     CleanupStack::PushL( dialog );
       
    57     STIF_ASSERT_NOT_NULL( dialog );
       
    58     CleanupStack::Pop( dialog );
       
    59     TBool flag = dialog->RunDlgLD( title, msg );
       
    60     
       
    61     delete dialog;
       
    62     
       
    63     return KErrNone;
       
    64     
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CTestSDKNotes::TestNHandlePointerEventL
       
    69 // -----------------------------------------------------------------------------
       
    70 TInt CTestSDKNotes::TestNHandlePointerEventL( CStifItemParser& /*aItem*/ )
       
    71     {
       
    72     _LIT( KTitle, "Title" );
       
    73     _LIT( KMsg, "Msg" );
       
    74     TBuf<KLength> title( KTitle );
       
    75     TBuf<KLength> msg( KMsg );
       
    76     
       
    77     CEikInfoDialog* dialog = new (ELeave) CEikInfoDialog( title, msg );
       
    78     CleanupStack::PushL( dialog );
       
    79     STIF_ASSERT_NOT_NULL( dialog );
       
    80     
       
    81     TPointerEvent event;
       
    82     event.iType = TPointerEvent::EButton2Up;
       
    83     dialog->HandlePointerEventL( event );
       
    84     CleanupStack::Pop( dialog );
       
    85     
       
    86     TBool flag = dialog->RunDlgLD( title, msg );
       
    87     delete dialog;
       
    88     
       
    89     return KErrNone;
       
    90     
       
    91     }