connectionutilities/ConnectionDialogs/ConnectionUiUtilities/NotifSrc/connectingviadiscreetpopupnotif.cpp
branchRCL_3
changeset 58 83ca720e2b9a
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
       
     1 /*
       
     2  * Copyright (c) 2005 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:  Implementation of CConnectingViaDiscreetPopupNotif.
       
    15  *
       
    16  */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <e32property.h>
       
    20 #include <ScreensaverInternalPSKeys.h>
       
    21 #include "connectingviadiscreetpopupnotif.h"
       
    22 #include "connectingviadiscreetpopup.h"
       
    23 #include "ConnUiUtilsNotif.h"
       
    24 #include "ConnectionDialogsUidDefs.h"
       
    25 #include "ConnectionUiUtilitiesCommon.h"
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // CConnectingViaDiscreetPopupNotif::TNotifierInfo 
       
    31 //                               CConnectingViaDiscreetPopupNotif::RegisterL()
       
    32 // ---------------------------------------------------------
       
    33 //
       
    34 CConnectingViaDiscreetPopupNotif::TNotifierInfo CConnectingViaDiscreetPopupNotif::RegisterL()
       
    35     {
       
    36     iInfo.iUid = KUidConnectingViaDiscreetPopup;
       
    37     iInfo.iPriority = ENotifierPriorityVHigh;
       
    38     iInfo.iChannel = KUidConnectingViaDiscreetPopup;
       
    39 
       
    40     return iInfo;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // void CConnectingViaDiscreetPopupNotif::StartL()
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 void CConnectingViaDiscreetPopupNotif::StartL(const TDesC8& aBuffer,
       
    48         TInt aReplySlot, const RMessagePtr2& aMessage)
       
    49     {    
       
    50     TInt screenSaverOn( 0 );
       
    51     RProperty::Get( KPSUidScreenSaver, 
       
    52                     KScreenSaverOn, 
       
    53                     screenSaverOn );
       
    54 
       
    55     if ( iActiveNote || screenSaverOn > 0 )
       
    56         {
       
    57         // Note is already active or Screensaver is on.
       
    58         aMessage.Complete( KErrNone );
       
    59         return;
       
    60         }
       
    61     
       
    62     iReplySlot = aReplySlot;
       
    63     iMessage = aMessage;
       
    64     iCancelled = ETrue;
       
    65     iActiveNote = CConnectingViaDiscreetPopup::NewL(this);
       
    66 
       
    67     TPckgBuf<TConnUiConnectingViaDiscreetPopup> data;
       
    68     data.Copy(aBuffer);
       
    69 
       
    70     iActiveNote->StartL( data().iIapId );
       
    71     iCancelled = EFalse;
       
    72     }
       
    73 
       
    74 // ---------------------------------------------------------
       
    75 // void CConnectingViaDiscreetPopupNotif::CompleteL( TInt aStatus )
       
    76 // ---------------------------------------------------------
       
    77 //
       
    78 void CConnectingViaDiscreetPopupNotif::CompleteL(TInt aStatus)
       
    79     {
       
    80     iCancelled = ETrue;
       
    81     if (!iMessage.IsNull())
       
    82         {
       
    83         iMessage.Complete(aStatus);
       
    84         }
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------
       
    88 // CConnectingViaDiscreetPopupNotif* CConnectingViaDiscreetPopupNotif::NewL()
       
    89 // ---------------------------------------------------------
       
    90 //
       
    91 CConnectingViaDiscreetPopupNotif* CConnectingViaDiscreetPopupNotif::NewL(
       
    92         const TBool aResourceFileResponsible)
       
    93     {
       
    94     CConnectingViaDiscreetPopupNotif* self =
       
    95             new (ELeave) CConnectingViaDiscreetPopupNotif();
       
    96     CleanupStack::PushL(self);
       
    97     self->ConstructL(KResourceFileName, aResourceFileResponsible);
       
    98     CleanupStack::Pop();
       
    99 
       
   100     return self;
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------
       
   104 // CConnectingViaDiscreetPopupNotif::CConnectingViaDiscreetPopupNotif()
       
   105 // ---------------------------------------------------------
       
   106 //
       
   107 CConnectingViaDiscreetPopupNotif::CConnectingViaDiscreetPopupNotif() :
       
   108     CConnectionDialogsNotifBase(), iActiveNote(NULL)
       
   109     {
       
   110     }
       
   111 
       
   112 // ---------------------------------------------------------
       
   113 // void CConnectingViaDiscreetPopupNotif::Cancel()
       
   114 // ---------------------------------------------------------
       
   115 //
       
   116 void CConnectingViaDiscreetPopupNotif::Cancel()
       
   117     {
       
   118     if (!iCancelled)
       
   119         {
       
   120         iCancelled = ETrue;
       
   121         if (!iMessage.IsNull())
       
   122             {
       
   123             iMessage.Complete(KErrCancel);
       
   124             }
       
   125         }
       
   126     if ( iActiveNote )
       
   127         {
       
   128         delete iActiveNote;
       
   129         iActiveNote = NULL;
       
   130         }
       
   131     }
       
   132 
       
   133 // End of File