classicui_pub/notifiers_api/tsrc/src/testsdknotifiersblocksaknglobalnote.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 AknGlobalNote.h
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19  * Include files
       
    20  */
       
    21 	
       
    22 #include <aknglobalnote.h>
       
    23 #include <aknnotifystd.h>
       
    24 
       
    25 #include "testsdknotifiers.hrh"
       
    26 #include "activeexample.h"
       
    27 #include "testsdknotifiers.h"
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CTestSDKNotifiers::TestNotifiersNoteNewLL
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 TInt CTestSDKNotifiers::TestNotifiersNoteNewLL( CStifItemParser& /*aItem*/ )
       
    34     {
       
    35     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
    36     CleanupStack::PushL( note );
       
    37     STIF_ASSERT_NOT_NULL( note );
       
    38     CleanupStack::PopAndDestroy( note );
       
    39     
       
    40     return KErrNone;
       
    41     }
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CTestSDKNotifiers::TestNotifiersNoteNewLCL
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 TInt CTestSDKNotifiers::TestNotifiersNoteNewLCL( CStifItemParser& /*aItem*/ )
       
    48     {
       
    49     CAknGlobalNote* note = CAknGlobalNote::NewLC();
       
    50     STIF_ASSERT_NOT_NULL( note );
       
    51     CleanupStack::PopAndDestroy( note );
       
    52     
       
    53     return KErrNone;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CTestSDKNotifiers::TestNotifiersNoteDestructorL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 TInt CTestSDKNotifiers::TestNotifiersNoteDestructorL( CStifItemParser& /*aItem*/ )
       
    61     {
       
    62     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
    63     CleanupStack::PushL( note );
       
    64     STIF_ASSERT_NOT_NULL( note );
       
    65     CleanupStack::PopAndDestroy( note );
       
    66 
       
    67     return KErrNone;
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CTestSDKNotifiers::TestNotifiersNoteSetTextProcessingL
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 TInt CTestSDKNotifiers::TestNotifiersNoteSetTextProcessingL( CStifItemParser& /*aItem*/ )
       
    75     {
       
    76     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
    77     CleanupStack::PushL( note );
       
    78     
       
    79     note->SetTextProcessing( ETrue );
       
    80     note->SetTextProcessing( EFalse );
       
    81     
       
    82     CleanupStack::PopAndDestroy( note );
       
    83     return KErrNone;
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CTestSDKNotifiers::TestNotifiersNoteShowNoteLL
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 TInt CTestSDKNotifiers::TestNotifiersNoteShowNoteLL( CStifItemParser& /*aItem*/ )
       
    91     {
       
    92     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
    93     CleanupStack::PushL( note );
       
    94     
       
    95     TBuf<KBufSize> text( KTestString );
       
    96     note->ShowNoteL( EAknGlobalInformationNote, text );
       
    97 
       
    98     CleanupStack::PopAndDestroy( note );
       
    99     return KErrNone;
       
   100     }
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // CTestSDKNotifiers::TestNotifiersNoteShowNoteLStatusL
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 TInt CTestSDKNotifiers::TestNotifiersNoteShowNoteLStatusL( CStifItemParser& /*aItem*/ )
       
   107     {
       
   108     TBuf<KBufSize> text( KTestString );
       
   109     CActiveExample* observer = CActiveExample::NewLC();
       
   110     observer->ShowNoteLL( EAknGlobalInformationNote, text );
       
   111     CleanupStack::PopAndDestroy( observer );
       
   112     
       
   113     return KErrNone;
       
   114     }
       
   115 
       
   116 // -----------------------------------------------------------------------------
       
   117 // CTestSDKNotifiers::TestNotifiersNoteCancelNoteLL
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 TInt CTestSDKNotifiers::TestNotifiersNoteCancelNoteLL( CStifItemParser& /*aItem*/ )
       
   121     {
       
   122     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   123     CleanupStack::PushL( note );
       
   124     note->CancelNoteL( KOne );
       
   125     CleanupStack::PopAndDestroy( note );
       
   126     
       
   127     return KErrNone;
       
   128     }
       
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 // CTestSDKNotifiers::TestNotifiersNoteSetPriorityL
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 TInt CTestSDKNotifiers::TestNotifiersNoteSetPriorityL( CStifItemParser& /*aItem*/ )
       
   135     {
       
   136     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   137     CleanupStack::PushL( note );
       
   138     note->SetPriority( KOne );
       
   139     CleanupStack::PopAndDestroy( note );
       
   140         
       
   141     return KErrNone;
       
   142     }
       
   143 
       
   144 // -----------------------------------------------------------------------------
       
   145 // CTestSDKNotifiers::TestNotifiersNoteSetSoftkeysL
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 TInt CTestSDKNotifiers::TestNotifiersNoteSetSoftkeysL( CStifItemParser& /*aItem*/ )
       
   149     {
       
   150     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   151     CleanupStack::PushL( note );
       
   152     note->SetSoftkeys( KOne );
       
   153     CleanupStack::PopAndDestroy( note );
       
   154         
       
   155     return KErrNone;
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CTestSDKNotifiers::TestNotifiersNoteSetGraphicL
       
   160 // -----------------------------------------------------------------------------
       
   161 //
       
   162 TInt CTestSDKNotifiers::TestNotifiersNoteSetGraphicL( CStifItemParser& /*aItem*/ )
       
   163     {
       
   164     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   165     CleanupStack::PushL( note );
       
   166     note->SetGraphic( KOne );
       
   167     CleanupStack::PopAndDestroy( note );
       
   168         
       
   169     return KErrNone;
       
   170     }
       
   171 
       
   172 // -----------------------------------------------------------------------------
       
   173 // CTestSDKNotifiers::TestNotifiersNoteSetAnimationL
       
   174 // -----------------------------------------------------------------------------
       
   175 //
       
   176 TInt CTestSDKNotifiers::TestNotifiersNoteSetAnimationL( CStifItemParser& /*aItem*/ )
       
   177     {
       
   178     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   179     CleanupStack::PushL( note );
       
   180     note->SetAnimation( KOne );
       
   181     CleanupStack::PopAndDestroy( note );
       
   182         
       
   183     return KErrNone;
       
   184     }
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 // CTestSDKNotifiers::TestNotifiersNoteSetToneL
       
   188 // -----------------------------------------------------------------------------
       
   189 //
       
   190 TInt CTestSDKNotifiers::TestNotifiersNoteSetToneL( CStifItemParser& /*aItem*/ )
       
   191     {
       
   192     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   193     CleanupStack::PushL( note );
       
   194     note->SetTone( KOne );
       
   195     CleanupStack::PopAndDestroy( note );
       
   196         
       
   197     return KErrNone;
       
   198     }
       
   199 
       
   200 // -----------------------------------------------------------------------------
       
   201 // CTestSDKNotifiers::TestNotifiersNoteDoGlobaNoteBufferLL
       
   202 // -----------------------------------------------------------------------------
       
   203 //
       
   204 TInt CTestSDKNotifiers::TestNotifiersNoteDoGlobaNoteBufferLL( CStifItemParser& /*aItem*/ )
       
   205     {
       
   206     CAknGlobalNote* note = CAknGlobalNote::NewL();
       
   207     CleanupStack::PushL( note );
       
   208 
       
   209     TBuf<KBufSize> text( KTestString );
       
   210     CBufFlat* buffer = CBufFlat::NewL( KSize );
       
   211     CleanupStack::PushL( buffer );
       
   212     
       
   213     HBufC* buf1 = KTestString().AllocLC();
       
   214     HBufC* buf2 = KTestString().AllocLC();
       
   215     HBufC* buf3 = KTestString().AllocLC();
       
   216     
       
   217     buffer->InsertL( KZero, buf1, buf1->Length() );
       
   218     buffer->InsertL( KZero, buf2, buf2->Length() );
       
   219     buffer->InsertL( KZero, buf3, buf3->Length() );
       
   220     
       
   221     note->DoGlobaNoteBufferL( KShortIntOne, KShortIntOne, KOne, KShortIntOne, KShortIntOne,
       
   222         KOne, KShortIntOne, ETrue, ETrue, text, buffer );
       
   223     
       
   224     CleanupStack::PopAndDestroy( buf3 );
       
   225     CleanupStack::PopAndDestroy( buf2 );
       
   226     CleanupStack::PopAndDestroy( buf1 );
       
   227     CleanupStack::PopAndDestroy( buffer );
       
   228     CleanupStack::PopAndDestroy( note );
       
   229     return KErrNone;
       
   230     }
       
   231 
       
   232 
       
   233 //End file