src/silentobserver_p_symbian.cpp
changeset 0 6be25656cbbb
equal deleted inserted replaced
-1:000000000000 0:6be25656cbbb
       
     1 /*
       
     2 * Copyright (c) 2010 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: Silent widget observer
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <CProfileChangeNotifyHandler.h>
       
    20 
       
    21 // User includes
       
    22 #include "silentobserver_p.h"
       
    23 #include "silentwidget.h"
       
    24 
       
    25 /*!
       
    26     \class SilentObserverPrivate
       
    27     \Silent observer class
       
    28 
       
    29     This class is used to create silent widget observer
       
    30 */
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 /*!
       
    35     NewL
       
    36 */
       
    37 SilentObserverPrivate *SilentObserverPrivate::NewL(QObject *parent)
       
    38 {
       
    39     SilentObserverPrivate *self = new (ELeave)SilentObserverPrivate();
       
    40     CleanupStack::PushL(self);
       
    41     self->ConstructL(parent);
       
    42     CleanupStack::Pop(); //self
       
    43     return self;
       
    44 }
       
    45 
       
    46 /*!
       
    47     Constructor
       
    48 */
       
    49 SilentObserverPrivate::SilentObserverPrivate()
       
    50 {
       
    51 }
       
    52 
       
    53 /*!
       
    54     ConstructL
       
    55 */
       
    56 void SilentObserverPrivate::ConstructL(QObject *parent)
       
    57 {
       
    58     iHandler = CProfileChangeNotifyHandler::NewL( this );
       
    59     iParent = parent;
       
    60 }
       
    61 
       
    62 /*!
       
    63     Destroyer
       
    64 */
       
    65 SilentObserverPrivate::~SilentObserverPrivate()
       
    66 {
       
    67     if (iHandler) {
       
    68         delete iHandler;
       
    69         iHandler = NULL;
       
    70     }
       
    71 }
       
    72 
       
    73 /*!
       
    74     Handle active profile events
       
    75 */
       
    76 void SilentObserverPrivate::HandleActiveProfileEventL(
       
    77         TProfileEvent /*aProfileEvent*/,
       
    78         TInt /*aProfileId*/ )
       
    79 {
       
    80     // handle event
       
    81     (reinterpret_cast<SilentWidget*>(iParent))->changeIcon();
       
    82     
       
    83 }