uifw/AknGlobalUI/OldStyleNotif/Src/OldStylePlugin.cpp
changeset 0 2f259fa3e83a
child 29 a8834a2e9a96
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  Creates Avkon old style notifiers.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <eiknotapi.h>
       
    19 #include <AknNotifyStd.h>
       
    20 #include <MediatorEventProvider.h>
       
    21 #include "AknKeyLockNotifier.h"
       
    22 #include "AknNotifyPlugin.h"
       
    23 #include "AknSystemPopup.h"
       
    24 #include "AknSoftNotificationPlugin.h"
       
    25 #include "AknSystemListPopup.h"
       
    26 #include "aknsystemmsgpopup.h"
       
    27 #include "AknSystemListMsgPopup.h"
       
    28 #include "aknsystemconfirmationpopup.h"
       
    29 #include "aknsystemprogresspopup.h"
       
    30 
       
    31 const TInt KArrayGranularity = 3;
       
    32 
       
    33 GLDEF_C void Panic(TAknPanic aPanic)
       
    34     {
       
    35     _LIT(KPanicCat, "AknNotifyPlugin");
       
    36     User::Panic(KPanicCat, aPanic);
       
    37     }
       
    38 
       
    39 void CleanupArray(TAny* aArray)
       
    40     {
       
    41     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    42         static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
       
    43         
       
    44     subjects->ResetAndDestroy();
       
    45     delete subjects;
       
    46     }
       
    47 
       
    48 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    49     {
       
    50     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    51         new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(KArrayGranularity);
       
    52         
       
    53     CleanupStack::PushL(TCleanupItem(CleanupArray, subjects));
       
    54 
       
    55     // ----------------------------
       
    56     // Key lock notifier.
       
    57     // ----------------------------
       
    58     CAknKeyLockNotifierSubject* keyLockNotifier = CAknKeyLockNotifierSubject::NewL();
       
    59     
       
    60     CleanupStack::PushL(keyLockNotifier);
       
    61     subjects->AppendL(keyLockNotifier);
       
    62     CleanupStack::Pop(keyLockNotifier);
       
    63 
       
    64     // ----------------------------
       
    65     // Global note notifier.
       
    66     // ----------------------------
       
    67     CAknGlobalNoteSubject* globalNoteSubject = CAknGlobalNoteSubject::NewL(keyLockNotifier);
       
    68     
       
    69     CleanupStack::PushL(globalNoteSubject);
       
    70     subjects->AppendL(globalNoteSubject);
       
    71     CleanupStack::Pop(globalNoteSubject);
       
    72     
       
    73     // ----------------------------
       
    74     // Soft note notifier.
       
    75     // ----------------------------
       
    76     CAknSoftNotificationSubject* softNotificationSubject = CAknSoftNotificationSubject::NewL(
       
    77         keyLockNotifier, 
       
    78         globalNoteSubject);
       
    79         
       
    80     CleanupStack::PushL(softNotificationSubject);
       
    81     subjects->AppendL(softNotificationSubject);
       
    82     CleanupStack::Pop(softNotificationSubject);
       
    83 
       
    84     // ----------------------------
       
    85     // Popup notifier.
       
    86     // ----------------------------
       
    87     CAknPopupNotifierSubject* popupNotifierSubject = CAknPopupNotifierSubject::NewL();
       
    88     
       
    89     CleanupStack::PushL(popupNotifierSubject);
       
    90     subjects->AppendL(popupNotifierSubject);
       
    91     CleanupStack::Pop(popupNotifierSubject);
       
    92     
       
    93     // =========================================================================
       
    94     // Notifiers using CAknMediatorEvent.
       
    95     // =========================================================================
       
    96     CAknMediatorEvent* aknEvent = new (ELeave) CAknMediatorEvent();
       
    97     CleanupStack::PushL(aknEvent);
       
    98     
       
    99 #ifdef __COVER_DISPLAY  
       
   100     aknEvent->iImpl = CMediatorEventProvider::NewL();
       
   101 #endif  
       
   102 
       
   103     // ----------------------------
       
   104     // Signal notifier.
       
   105     // ----------------------------
       
   106     CAknSignalNotifierSubject* signalNotifierSubject = CAknSignalNotifierSubject::NewL(aknEvent);
       
   107     
       
   108     CleanupStack::PushL(signalNotifierSubject);
       
   109     subjects->AppendL(signalNotifierSubject);
       
   110     CleanupStack::Pop(signalNotifierSubject);
       
   111     
       
   112     // ----------------------------
       
   113     // Battery notifier.
       
   114     // ----------------------------
       
   115     CAknBatteryNotifierSubject* batteryNotifierSubject = CAknBatteryNotifierSubject::NewL(aknEvent);
       
   116     
       
   117     CleanupStack::PushL(batteryNotifierSubject);
       
   118     subjects->AppendL(batteryNotifierSubject);
       
   119     CleanupStack::Pop(batteryNotifierSubject);
       
   120     
       
   121     // ----------------------------
       
   122     // Small indicator notifier.
       
   123     // ----------------------------
       
   124     CAknSmallIndicatorSubject* smallIndicatorSubject = CAknSmallIndicatorSubject::NewL(aknEvent);
       
   125 
       
   126     CleanupStack::PushL(smallIndicatorSubject);
       
   127     subjects->AppendL(smallIndicatorSubject);
       
   128     CleanupStack::Pop(smallIndicatorSubject);
       
   129     
       
   130     // Mediator event not needed anymore.
       
   131     CleanupStack::Pop(aknEvent); 
       
   132     
       
   133     // ----------------------------
       
   134     // Incall bubble notifier.
       
   135     // ----------------------------
       
   136     CAknIncallBubbleSubject* incallBubbleSubject = CAknIncallBubbleSubject::NewL();
       
   137     
       
   138     CleanupStack::PushL(incallBubbleSubject);
       
   139     subjects->AppendL(incallBubbleSubject);
       
   140     CleanupStack::Pop(incallBubbleSubject);
       
   141 
       
   142     // =========================================================================
       
   143     // Traditional notifiers, moved here because of higher wg-priority (wouldn't
       
   144     // require any capabilities otherwise).
       
   145     // =========================================================================
       
   146     
       
   147     // ----------------------------
       
   148     // Global list query.
       
   149     // ----------------------------
       
   150     CAknGlobalListQuerySubject* listQuerySubject = CAknGlobalListQuerySubject::NewL();
       
   151     
       
   152     CleanupStack::PushL(listQuerySubject);
       
   153     subjects->AppendL(listQuerySubject);
       
   154     CleanupStack::Pop(listQuerySubject);    
       
   155     
       
   156     // ----------------------------
       
   157     // Global msg query.
       
   158     // ----------------------------
       
   159     CAknGlobalMsgQuerySubject* msgQuerySubject = CAknGlobalMsgQuerySubject::NewL();
       
   160     
       
   161     CleanupStack::PushL(msgQuerySubject);
       
   162     subjects->AppendL(msgQuerySubject);
       
   163     CleanupStack::Pop(msgQuerySubject);
       
   164     
       
   165     // ----------------------------
       
   166     // Global confirmation query.
       
   167     // ----------------------------
       
   168     CAknGlobalConfirmationQuerySubject* confirmationQuerySubject = 
       
   169         CAknGlobalConfirmationQuerySubject::NewL();
       
   170     
       
   171     CleanupStack::PushL(confirmationQuerySubject);
       
   172     subjects->AppendL(confirmationQuerySubject);
       
   173     CleanupStack::Pop(confirmationQuerySubject);
       
   174     
       
   175     // ----------------------------
       
   176     // Global progress dialog.
       
   177     // ----------------------------
       
   178     CAknGlobalProgressDialogSubject* progressDialogSubject = 
       
   179         CAknGlobalProgressDialogSubject::NewL();
       
   180     
       
   181     CleanupStack::PushL(progressDialogSubject);
       
   182     subjects->AppendL(progressDialogSubject);
       
   183     CleanupStack::Pop(progressDialogSubject);
       
   184     
       
   185     // ----------------------------
       
   186     // Global list msg query.
       
   187     // ----------------------------
       
   188     CAknGlobalListMsgQuerySubject* listMsgQuerySubject = CAknGlobalListMsgQuerySubject::NewL();
       
   189     
       
   190     CleanupStack::PushL(listMsgQuerySubject);
       
   191     subjects->AppendL(listMsgQuerySubject);
       
   192     CleanupStack::Pop(listMsgQuerySubject);
       
   193 
       
   194     CleanupStack::Pop(subjects);
       
   195     return subjects;
       
   196     }
       
   197 
       
   198 // Lib main entry point
       
   199 EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
   200     {
       
   201     CArrayPtr<MEikSrvNotifierBase2>* subjects = NULL;
       
   202     TRAP_IGNORE(subjects = DoCreateNotifierArrayL());
       
   203     return subjects;
       
   204     }
       
   205 
       
   206 // End of file