classicui_pub/notes_api/tsrc/src/testsdknotesblockswd.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 AknWaitDialog.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <aknwaitdialog.h>
       
    20 #include <barsread.h>
       
    21 #include <coeaui.h>
       
    22 #include <testsdknotes.rsg>
       
    23 
       
    24 #include "testsdknotes.h"
       
    25 
       
    26 const TInt KPoint1 = 10;
       
    27 const TInt KPoint2 = 20;
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CTestSDKNotes::TestNWDCAknWaitDialogL
       
    32 // -----------------------------------------------------------------------------
       
    33 TInt CTestSDKNotes::TestNWDCAknWaitDialogL( CStifItemParser& /*aItem*/ )
       
    34     {
       
    35     CEikDialog* dialog = new (ELeave) CEikDialog;
       
    36     CleanupStack::PushL( dialog );
       
    37     STIF_ASSERT_NOT_NULL( dialog );
       
    38     
       
    39     CAknWaitDialog* waitDialog = new (ELeave) CAknWaitDialog( &dialog );
       
    40     CleanupStack::PushL( waitDialog );
       
    41     STIF_ASSERT_NOT_NULL( waitDialog );
       
    42     
       
    43     CleanupStack::Pop( waitDialog );
       
    44     CleanupStack::PopAndDestroy( dialog );
       
    45     
       
    46     return KErrNone;
       
    47     
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CTestSDKNotes::TestNWDCAknWaitDialogBoolL
       
    52 // -----------------------------------------------------------------------------
       
    53 TInt CTestSDKNotes::TestNWDCAknWaitDialogBoolL( CStifItemParser& /*aItem*/ )
       
    54     {
       
    55     CEikDialog* dialog = new (ELeave) CEikDialog;
       
    56     CleanupStack::PushL( dialog );
       
    57     STIF_ASSERT_NOT_NULL( dialog );
       
    58     
       
    59     CAknWaitDialog* waitDialog = new (ELeave) CAknWaitDialog( &dialog, EFalse );
       
    60     CleanupStack::PushL( waitDialog );
       
    61     STIF_ASSERT_NOT_NULL( waitDialog );
       
    62     CleanupStack::Pop( waitDialog );
       
    63     
       
    64     waitDialog = new (ELeave) CAknWaitDialog( &dialog, ETrue );
       
    65     CleanupStack::PushL( waitDialog );
       
    66     STIF_ASSERT_NOT_NULL( waitDialog );
       
    67     CleanupStack::Pop( waitDialog );
       
    68     
       
    69     CleanupStack::PopAndDestroy( dialog );
       
    70     
       
    71     return KErrNone;
       
    72     
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CTestSDKNotes::TestNWDHandlePointerEventL
       
    77 // -----------------------------------------------------------------------------
       
    78 TInt CTestSDKNotes::TestNWDHandlePointerEventL( CStifItemParser& /*aItem*/ )
       
    79     {
       
    80     CEikDialog* dialog = new (ELeave) CEikDialog;
       
    81     CleanupStack::PushL( dialog );
       
    82     STIF_ASSERT_NOT_NULL( dialog );
       
    83     
       
    84     CAknWaitDialog* waitDialog = new (ELeave) CAknWaitDialog( &dialog, EFalse );
       
    85     CleanupStack::PushL( waitDialog );
       
    86     STIF_ASSERT_NOT_NULL( waitDialog );
       
    87     
       
    88     TPointerEvent event;
       
    89     event.iType = TPointerEvent::EButton1Down;
       
    90     event.iModifiers = 0;
       
    91     TPoint eventPos( KPoint1, KPoint2 );
       
    92     event.iPosition = eventPos;
       
    93     event.iParentPosition = eventPos;
       
    94     
       
    95     waitDialog->HandlePointerEventL( event );
       
    96     
       
    97     CleanupStack::Pop( waitDialog );
       
    98     CleanupStack::PopAndDestroy( dialog );
       
    99     
       
   100     return KErrNone;
       
   101     
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CTestSDKNotes::TestNWDGetProgressInfoL
       
   106 // -----------------------------------------------------------------------------
       
   107 TInt CTestSDKNotes::TestNWDGetProgressInfoL( CStifItemParser& /*aItem*/ )
       
   108     {
       
   109     // This function will call panic directly, so no need to test it temporary
       
   110     return KErrNone;
       
   111     
       
   112     }
       
   113