src/silentmodel_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 model
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <e32base.h>
       
    20 #include <MProfileEngineExtended2.h>
       
    21 
       
    22 // User includes
       
    23 #include "silentmodel_p.h"
       
    24 #include "silentwidgetconsts.h"
       
    25 
       
    26 /*!
       
    27     \class SilentModelPrivate
       
    28     \silent widget model private class
       
    29 
       
    30     This class is used to create silent model
       
    31 */
       
    32 
       
    33 // ======== MEMBER FUNCTIONS ========
       
    34 
       
    35 /*!
       
    36     NewL
       
    37 */
       
    38 SilentModelPrivate *SilentModelPrivate::NewL()
       
    39 {
       
    40     SilentModelPrivate *self = new (ELeave) SilentModelPrivate();
       
    41     CleanupStack::PushL(self);
       
    42     self->ConstructL();
       
    43     CleanupStack::Pop(); //self
       
    44     return self;
       
    45 }
       
    46 
       
    47 /*!
       
    48     Constructor
       
    49 */
       
    50 SilentModelPrivate::SilentModelPrivate()
       
    51 {
       
    52     mEngine = NULL;
       
    53 }
       
    54 
       
    55 /*!
       
    56     ConstructL
       
    57 */
       
    58 void SilentModelPrivate::ConstructL()
       
    59 {
       
    60     mEngine = CreateProfileEngineExtended2L();
       
    61 }
       
    62 
       
    63 /*!
       
    64     Destroyer
       
    65 */
       
    66 SilentModelPrivate::~SilentModelPrivate()
       
    67 {
       
    68     if (mEngine!=0) {
       
    69         mEngine->Release();
       
    70     }
       
    71 }
       
    72 
       
    73 /*
       
    74     Get silent status in master volume
       
    75  */
       
    76 bool SilentModelPrivate::silenceMode() const
       
    77 {
       
    78     bool isSlience = false;
       
    79     TRAP_IGNORE(isSlience = mEngine->SilenceModeL();)
       
    80     return isSlience;
       
    81 }
       
    82 
       
    83 /*
       
    84     Set silent status in master volume
       
    85  */
       
    86 void SilentModelPrivate::setSilenceMode(bool isSilence)
       
    87 {
       
    88     TRAP_IGNORE(mEngine->SetSilenceModeL(isSilence);)    
       
    89 }