controlpanelplugins/themeplugin/src/cpthemechanger.h
changeset 11 10d0dd0e43f1
child 12 624337f114fe
equal deleted inserted replaced
10:0a74be98a8bc 11:10d0dd0e43f1
       
     1 /*
       
     2 * Copyright (c) 2008-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:  HbThemeChanger class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPTHEMECHANGER_H
       
    20 #define CPTHEMECHANGER_H
       
    21 
       
    22 #include <QStringList>
       
    23 #include <hbicon.h>
       
    24 #include <hbglobal.h>
       
    25 
       
    26 class CpThemeChangerPrivate;
       
    27 
       
    28 QT_BEGIN_NAMESPACE
       
    29 class QAbstractItemModel;
       
    30 QT_END_NAMESPACE
       
    31 
       
    32 class CpThemeChanger : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36 public:
       
    37      explicit CpThemeChanger(QObject* parent=0);
       
    38     ~CpThemeChanger();
       
    39 
       
    40     struct ThemeInfo 
       
    41     {
       
    42         QString name;
       
    43         HbIcon  icon;
       
    44         bool operator < (const struct ThemeInfo &other) const   {			
       
    45             return name.localeAwareCompare(other.name) < 0;
       
    46         }		
       
    47     };
       
    48 
       
    49     const QList<ThemeInfo> themes() const;
       
    50     QAbstractItemModel& model();
       
    51 
       
    52     const ThemeInfo& currentTheme() const;
       
    53 
       
    54     bool changeTheme(const QString& newtheme);
       
    55 	
       
    56 	bool connectToServer();
       
    57 	bool isConnected() const;
       
    58 
       
    59 private:
       
    60     CpThemeChangerPrivate* d_ptr;
       
    61     Q_DECLARE_PRIVATE(CpThemeChanger)
       
    62     Q_PRIVATE_SLOT(d_func(), void _q_themeDirectoryChanged(const QString&))
       
    63 };
       
    64 
       
    65 #endif /* CPTHEMECHANGER_H */