controlpanelplugins/themeplugin/src/cpthemeclient_p.cpp
changeset 25 19394c261aa5
parent 24 f5dfdd5e4a1b
child 27 848a3adde87f
child 31 e79ce701c376
equal deleted inserted replaced
24:f5dfdd5e4a1b 25:19394c261aa5
     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 #include "cpthemeclient_p.h"
       
    19 #include "cpthemeclient_p_p.h"
       
    20 
       
    21 static CpThemeClient *clientInst=0;
       
    22 
       
    23 /**
       
    24  * Constructor
       
    25  */
       
    26 CpThemeClient::CpThemeClient():d_ptr(new CpThemeClientPrivate)
       
    27 {
       
    28     
       
    29 }
       
    30 
       
    31 /**
       
    32  * CpThemeClient::connectToServer()
       
    33  */
       
    34 bool CpThemeClient::connectToServer()
       
    35 {
       
    36     Q_D(CpThemeClient);
       
    37     
       
    38     return d->connectToServer();
       
    39 }
       
    40 
       
    41 bool CpThemeClient::isConnected()
       
    42 {
       
    43     Q_D(const CpThemeClient);
       
    44     
       
    45     return d->isConnected();
       
    46 }
       
    47 
       
    48 /**
       
    49  * Change a theme
       
    50  */
       
    51 bool CpThemeClient::changeTheme(const QString& newtheme)
       
    52 {
       
    53     Q_D(CpThemeClient);
       
    54     
       
    55     return d->changeTheme(newtheme);
       
    56 }
       
    57 
       
    58 /**
       
    59  * CpThemeClient::~CpThemeClient()
       
    60  */
       
    61 CpThemeClient::~CpThemeClient()
       
    62 {
       
    63     Q_D(CpThemeClient);
       
    64     
       
    65     delete d;
       
    66 }
       
    67 
       
    68 /**
       
    69  * CpThemeClient::global()
       
    70  */
       
    71 CpThemeClient *CpThemeClient::global()
       
    72 {
       
    73     if ( !clientInst ) {
       
    74         clientInst = new CpThemeClient;
       
    75     }
       
    76     return clientInst;
       
    77 }
       
    78 
       
    79 /**
       
    80  * CpThemeClient::releaseInstance()
       
    81  */
       
    82 void CpThemeClient::releaseInstance()
       
    83 {
       
    84     delete clientInst;
       
    85     clientInst = 0;
       
    86 }