cellular/telephonysettings/xqbindings/psetwrapper/src/psetwrapper.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2  * Copyright (c) 2009 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 
       
    19 #include <psetcontainer.h>
       
    20 #include "psetwrapper.h"
       
    21 #include "psetcliwrapper.h"
       
    22 #include "psetcallwaitingwrapper.h"
       
    23 #include "psetcalldivertingwrapper.h"
       
    24 #include "psetnetworkwrapper.h"
       
    25 #include "psetcallbarringwrapper.h"
       
    26 #include "logging.h"
       
    27 
       
    28 /*!
       
    29   PSetWrapper::PSetWrapper
       
    30  */
       
    31 PSetWrapper::PSetWrapper(QObject *parent) : 
       
    32     QObject(parent),
       
    33         m_psetContainer(NULL),
       
    34         m_wrapperCli(NULL),
       
    35         m_callWaitingWrapper(NULL),
       
    36         m_callDivertingWrapper(NULL),
       
    37         m_networkWrapper(NULL),
       
    38         m_callBarringWrapper(NULL)
       
    39 {
       
    40     DPRINT << ": IN ";
       
    41     
       
    42     QT_TRAP_THROWING(m_psetContainer = CPsetContainer::NewL()); 
       
    43 
       
    44     DPRINT << ": OUT ";
       
    45 }
       
    46 
       
    47 /*!
       
    48   PSetWrapper::~PSetWrapper
       
    49  */
       
    50 PSetWrapper::~PSetWrapper()
       
    51 {
       
    52     DPRINT << ": IN ";
       
    53     
       
    54     delete m_wrapperCli;
       
    55     delete m_callWaitingWrapper;
       
    56     delete m_callDivertingWrapper;
       
    57     delete m_networkWrapper;
       
    58     delete m_callBarringWrapper;
       
    59     delete m_psetContainer;
       
    60     
       
    61     DPRINT << ": OUT ";
       
    62 }
       
    63 
       
    64 /*!
       
    65   PSetWrapper::cliWrapper
       
    66  */
       
    67 PSetCliWrapper& PSetWrapper::cliWrapper()
       
    68 {
       
    69     DPRINT;
       
    70     
       
    71     if (!m_wrapperCli) {
       
    72         m_wrapperCli = new PSetCliWrapper(*m_psetContainer, this);
       
    73         Q_CHECK_PTR(m_wrapperCli);
       
    74     }
       
    75     
       
    76     return *m_wrapperCli;
       
    77 }
       
    78 
       
    79 /*!
       
    80   PSetWrapper::callWaitingWrapper
       
    81  */
       
    82 PSetCallWaitingWrapper& PSetWrapper::callWaitingWrapper()
       
    83 {
       
    84     DPRINT;
       
    85     
       
    86     if (!m_callWaitingWrapper) {
       
    87         m_callWaitingWrapper = 
       
    88             new PSetCallWaitingWrapper(*m_psetContainer, this);
       
    89         Q_CHECK_PTR(m_callWaitingWrapper);
       
    90     }
       
    91     
       
    92     return *m_callWaitingWrapper;
       
    93 }
       
    94 
       
    95 /*!
       
    96   PSetWrapper::callDivertingWrapper
       
    97  */
       
    98 PSetCallDivertingWrapper& PSetWrapper::callDivertingWrapper()
       
    99 {
       
   100     DPRINT;
       
   101     
       
   102     if (!m_callDivertingWrapper) {
       
   103         m_callDivertingWrapper = 
       
   104             new PSetCallDivertingWrapper(*m_psetContainer, this);
       
   105         Q_CHECK_PTR(m_callDivertingWrapper);
       
   106     }
       
   107     
       
   108     return *m_callDivertingWrapper;
       
   109 }
       
   110 
       
   111 /*!
       
   112   PSetWrapper::networkWrapper
       
   113  */
       
   114 PSetNetworkWrapper& PSetWrapper::networkWrapper()
       
   115 {
       
   116     DPRINT;
       
   117     
       
   118     if (!m_networkWrapper) {
       
   119         m_networkWrapper = new PSetNetworkWrapper(*m_psetContainer, this);
       
   120         Q_CHECK_PTR(m_networkWrapper);
       
   121     }
       
   122     
       
   123     return *m_networkWrapper;    
       
   124 }
       
   125 
       
   126 /*!
       
   127   PSetWrapper::callBarringWrapper
       
   128  */
       
   129 PSetCallBarringWrapper& PSetWrapper::callBarringWrapper()
       
   130 {
       
   131     DPRINT;
       
   132     
       
   133     if (!m_callBarringWrapper) {
       
   134         m_callBarringWrapper = 
       
   135             new PSetCallBarringWrapper(*m_psetContainer, this);
       
   136     }
       
   137     
       
   138     return *m_callBarringWrapper;    
       
   139 }
       
   140 
       
   141 // End of File.