uifw/AknGlobalUI/ECOM/AknNotifyEcomEntry.cpp
changeset 0 2f259fa3e83a
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 notifier wrappers.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <uikon/eiksrvui.h> 
       
    20 #include <AknNotifierWrapper.h>
       
    21 #include <ecom/implementationproxy.h>
       
    22 #include <eiknotapi.h>
       
    23 #include <AknNotifierControllerPlugin.h>
       
    24 
       
    25 #include <AknNotifyStd.h>
       
    26 #include <eikenv.h>
       
    27 #include <eikspane.h>
       
    28 #include <avkon.hrh>
       
    29 #include <eikspane.h>
       
    30 #include <aknappui.h>
       
    31 
       
    32 #include <bautils.h> // For NearestLanguageFile
       
    33 #include <aknnotpi.rsg>
       
    34 
       
    35 #include <AknNotifySignature.h>
       
    36 #include <AknNotifierControllerPlugin.h>
       
    37 #include <AknCapServerDefs.h> 
       
    38 
       
    39 const TInt KReplyBufSize = 200;
       
    40 const TInt KArrayGranularity = 3;
       
    41 
       
    42 // All our notifiers are derived from CBase so safe.
       
    43 void CleanupArray(TAny* aArray)
       
    44     {
       
    45     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    46         static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
       
    47         
       
    48     subjects->ResetAndDestroy();
       
    49     delete subjects;
       
    50     }
       
    51 
       
    52 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    53     {
       
    54     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    55         new (ELeave) CArrayPtrFlat<MEikSrvNotifierBase2>(KArrayGranularity);
       
    56         
       
    57     CleanupStack::PushL(TCleanupItem(CleanupArray, subjects));
       
    58 
       
    59     // -------------------------------------------------------------------------
       
    60     // Create master wrapper. 
       
    61     // -------------------------------------------------------------------------
       
    62     CAknNotifierWrapper* master = CAknNotifierWrapper::NewL( 
       
    63         KAknKeyLockNotifierUid,
       
    64         KAknKeyLockNotifierUid,
       
    65         MEikSrvNotifierBase2::ENotifierPriorityVHigh,
       
    66         KAknCapServerUid,
       
    67         KReplyBufSize);
       
    68 
       
    69     CleanupStack::PushL(master);
       
    70     subjects->AppendL(master);
       
    71     CleanupStack::Pop(master);
       
    72     
       
    73     // -------------------------------------------------------------------------
       
    74     // Notifiers using master's session.
       
    75     // -------------------------------------------------------------------------
       
    76     CAknNotifierWrapperLight* light1 = new (ELeave) CAknNotifierWrapperLight(
       
    77         *master, 
       
    78         KAknPopupNotifierUid,
       
    79         KAknPopupNotifierUid,
       
    80         MEikSrvNotifierBase2::ENotifierPriorityLow);
       
    81 
       
    82     CleanupStack::PushL(light1);
       
    83     subjects->AppendL(light1);
       
    84     CleanupStack::Pop(light1);
       
    85 
       
    86     // -------------------------------------------------------------------------
       
    87     // Notifiers using master's session.
       
    88     // -------------------------------------------------------------------------
       
    89     CAknNotifierWrapperLight* light2 = new (ELeave) CAknNotifierWrapperLight(
       
    90         *master, 
       
    91         KAknSignalNotifierUid,
       
    92         KAknSignalNotifierUid,
       
    93         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
    94         
       
    95     CleanupStack::PushL(light2);
       
    96     subjects->AppendL(light2);
       
    97     CleanupStack::Pop(light2);
       
    98         
       
    99     // -------------------------------------------------------------------------
       
   100     // Notifiers using master's session.
       
   101     // -------------------------------------------------------------------------
       
   102     CAknNotifierWrapperLight* light3 = new (ELeave) CAknNotifierWrapperLight(
       
   103         *master, 
       
   104         KAknBatteryNotifierUid,
       
   105         KAknBatteryNotifierUid,
       
   106         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   107         
       
   108     CleanupStack::PushL(light3);
       
   109     subjects->AppendL(light3);
       
   110     CleanupStack::Pop(light3);        
       
   111         
       
   112     // -------------------------------------------------------------------------
       
   113     // Notifiers using master's session.
       
   114     // -------------------------------------------------------------------------
       
   115     CAknNotifierWrapperLight* light4 = new (ELeave) CAknNotifierWrapperLight(
       
   116         *master, 
       
   117         KAknSmallIndicatorUid,
       
   118         KAknSmallIndicatorUid,
       
   119         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   120         
       
   121     CleanupStack::PushL(light4);
       
   122     subjects->AppendL(light4);
       
   123     CleanupStack::Pop(light4);        
       
   124     
       
   125     // -------------------------------------------------------------------------
       
   126     // Notifiers using master's session.
       
   127     // -------------------------------------------------------------------------
       
   128     CAknNotifierWrapperLight* light5 = new (ELeave) CAknNotifierWrapperLight(
       
   129         *master, 
       
   130         KAknGlobalNoteUid,
       
   131         KAknGlobalNoteUid,
       
   132         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   133         
       
   134     CleanupStack::PushL(light5);
       
   135     subjects->AppendL(light5);
       
   136     CleanupStack::Pop(light5);        
       
   137     
       
   138     // -------------------------------------------------------------------------
       
   139     // Notifiers using master's session.
       
   140     // -------------------------------------------------------------------------
       
   141     CAknNotifierWrapperLight* light6 = new (ELeave) CAknNotifierWrapperLight(
       
   142         *master, 
       
   143         KAknSoftNotificationUid,
       
   144         KAknSoftNotificationUid, // Separate channel from global notes, new in S60 3.0.
       
   145         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   146 
       
   147     CleanupStack::PushL(light6);
       
   148     subjects->AppendL(light6);
       
   149     CleanupStack::Pop(light6);        
       
   150 
       
   151     // -------------------------------------------------------------------------
       
   152     // Notifiers using master's session.
       
   153     // -------------------------------------------------------------------------
       
   154     CAknNotifierWrapperLight* light7 = new (ELeave) CAknNotifierWrapperLight(
       
   155         *master, 
       
   156         KAknIncallBubbleUid,
       
   157         KAknIncallBubbleUid,
       
   158         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   159         
       
   160     CleanupStack::PushL(light7);
       
   161     subjects->AppendL(light7);
       
   162     CleanupStack::Pop(light7);        
       
   163 
       
   164     // -------------------------------------------------------------------------
       
   165     // Notifiers using master's session.
       
   166     // -------------------------------------------------------------------------
       
   167     CAknNotifierWrapperLight* light8 = new (ELeave) CAknNotifierWrapperLight(
       
   168         *master, 
       
   169         KAknGlobalListQueryUid,
       
   170         KAknGlobalListQueryUid,
       
   171         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   172         
       
   173     CleanupStack::PushL(light8);
       
   174     subjects->AppendL(light8);
       
   175     CleanupStack::Pop(light8);        
       
   176     
       
   177     // -------------------------------------------------------------------------
       
   178     // Notifiers using master's session.
       
   179     // -------------------------------------------------------------------------
       
   180     CAknNotifierWrapperLight* light9 = new (ELeave) CAknNotifierWrapperLight(
       
   181         *master, 
       
   182         KAknGlobalMsgQueryUid,
       
   183         KAknGlobalMsgQueryUid,
       
   184         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   185         
       
   186     CleanupStack::PushL(light9);
       
   187     subjects->AppendL(light9);
       
   188     CleanupStack::Pop(light9);        
       
   189     
       
   190     // -------------------------------------------------------------------------
       
   191     // Notifiers using master's session.
       
   192     // -------------------------------------------------------------------------
       
   193     CAknNotifierWrapperLight* light10 = new (ELeave) CAknNotifierWrapperLight(
       
   194         *master, 
       
   195         KAknGlobalConfirmationQueryUid,
       
   196         KAknGlobalConfirmationQueryUid,
       
   197         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   198         
       
   199     CleanupStack::PushL(light10);
       
   200     subjects->AppendL(light10);
       
   201     CleanupStack::Pop(light10);        
       
   202     
       
   203     // -------------------------------------------------------------------------
       
   204     // Notifiers using master's session.
       
   205     // -------------------------------------------------------------------------
       
   206     CAknNotifierWrapperLight* light11 = new (ELeave) CAknNotifierWrapperLight(
       
   207         *master, 
       
   208         KAknGlobalProgressDialogUid,
       
   209         KAknGlobalProgressDialogUid,
       
   210         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   211         
       
   212     CleanupStack::PushL(light11);
       
   213     subjects->AppendL(light11);
       
   214     CleanupStack::Pop(light11);        
       
   215     
       
   216     // -------------------------------------------------------------------------
       
   217     // Notifiers using master's session.
       
   218     // -------------------------------------------------------------------------
       
   219     CAknNotifierWrapperLight* light12 = new (ELeave) CAknNotifierWrapperLight(
       
   220         *master, 
       
   221         KAknGlobalListMsgQueryUid,
       
   222         KAknGlobalListMsgQueryUid,
       
   223         MEikSrvNotifierBase2::ENotifierPriorityVHigh);
       
   224         
       
   225     CleanupStack::PushL(light12);
       
   226     subjects->AppendL(light12);
       
   227     CleanupStack::Pop(light12);        
       
   228 
       
   229     CleanupStack::Pop(subjects);
       
   230     return subjects;
       
   231     }
       
   232 
       
   233 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
   234     {
       
   235     CArrayPtr<MEikSrvNotifierBase2>* subjects = NULL;
       
   236     TRAP_IGNORE(subjects = DoCreateNotifierArrayL());
       
   237     return subjects;
       
   238     }
       
   239 
       
   240 const TImplementationProxy ImplementationTable[] =
       
   241     {
       
   242 #ifdef __EABI__
       
   243     {{0x1020721A},(TFuncPtr)NotifierArray}
       
   244 #else
       
   245     {{0x1020721A},NotifierArray}
       
   246 #endif
       
   247     };
       
   248 
       
   249 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   250     {
       
   251     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   252     return ImplementationTable;
       
   253     }