uifw/AvKon/notifsrc/AknSignalNotifyAddition.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2003-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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <AknNotifyStd.h>
       
    20 #include "AknSignalNotifyAddition.h"
       
    21 #include <avkon.hrh>
       
    22 #include <AknNotifySignature.h>
       
    23 
       
    24 EXPORT_C CAknSignalNotifyAddition::~CAknSignalNotifyAddition()
       
    25     {
       
    26     // only close the connection, notifier is not cancelled.
       
    27     // Assume that it is cancelled by CAknSignalNotify.
       
    28     iNotify.Close();
       
    29     }
       
    30 
       
    31 CAknSignalNotifyAddition::CAknSignalNotifyAddition() 
       
    32     {
       
    33     }
       
    34 
       
    35 EXPORT_C CAknSignalNotifyAddition* CAknSignalNotifyAddition::NewL()
       
    36     {
       
    37     CAknSignalNotifyAddition* self = NewLC();
       
    38     CleanupStack::Pop();    // self
       
    39     return self;
       
    40     }
       
    41 
       
    42 EXPORT_C CAknSignalNotifyAddition* CAknSignalNotifyAddition::NewLC()
       
    43     {
       
    44     CAknSignalNotifyAddition* self = new(ELeave) CAknSignalNotifyAddition;
       
    45     CleanupStack::PushL(self);
       
    46     self->ConstructL();
       
    47     return self;
       
    48     }
       
    49 
       
    50 void CAknSignalNotifyAddition::ConstructL()
       
    51     {
       
    52     Connect();
       
    53     }
       
    54 
       
    55 void CAknSignalNotifyAddition::Connect()
       
    56     {
       
    57     // Only open the connection, notifier is not started.
       
    58     // Assume that it is started by CAknSignalNotify.
       
    59     TInt error = iNotify.Connect();
       
    60     TBuf8<1> dummy;
       
    61     iNotify.StartNotifier(KAknMemoryCardDialogUid,dummy,dummy); // does not exist anymore ...
       
    62     if (error == KErrNone)
       
    63         {
       
    64         iConnected = ETrue;
       
    65         }
       
    66     }
       
    67 
       
    68 
       
    69 void CAknSignalNotifyAddition::UpdateL(const TDesC8& aBuffer,TDes8& aResponse)
       
    70     {
       
    71     if (!iConnected)
       
    72         {
       
    73         Connect(); // try reconnecting
       
    74         }
       
    75     iNotify.UpdateNotifier(KAknSignalNotifierUid, aBuffer, aResponse);
       
    76     }
       
    77 
       
    78 EXPORT_C void CAknSignalNotifyAddition::SetNaviPaneBackgroundTypeL(TInt aType)
       
    79     {
       
    80     TPckgBuf<SAknNotifierPackage<SAknSignalNotifyParams> > pckg;
       
    81     switch (aType)
       
    82         {
       
    83         case EAknNaviPaneBackgroundTypeWipe:
       
    84             {
       
    85             pckg().iParamData.iGprsState = EAknSignalGprsIndicatorBgTypeWipe;
       
    86             break;
       
    87             }
       
    88         case EAknNaviPaneBackgroundTypeSolid:
       
    89             {
       
    90             pckg().iParamData.iGprsState = EAknSignalGprsIndicatorBgTypeSolid;
       
    91             break;
       
    92             }
       
    93         default:
       
    94             {
       
    95             pckg().iParamData.iGprsState = EAknSignalGprsStateNotChanged;
       
    96             }
       
    97         }
       
    98     pckg().iParamData.iValue = EAknSignalStateNotChanged;
       
    99     TBuf8<1> resp;
       
   100     UpdateL(pckg, resp);
       
   101     }
       
   102 
       
   103 // End of File