controlpanelplugins/themeplugin/src/cpthemechanger_p.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:  HbThemeChangerPrivate class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HBTHEMECHANGER_P_H
       
    20 #define HBTHEMECHANGER_P_H
       
    21 
       
    22 #include <hbglobal.h>
       
    23 
       
    24 #include <QObject>
       
    25 
       
    26 #include <QAbstractListModel>
       
    27 #include <QDir>
       
    28 #include <QModelIndex>
       
    29 #include <QString>
       
    30 #include <QStringList>
       
    31 
       
    32 #include "cpthemechanger.h"
       
    33 
       
    34 QT_BEGIN_NAMESPACE
       
    35 class QFileSystemWatcher;
       
    36 QT_END_NAMESPACE
       
    37 
       
    38 class CpThemeClient;
       
    39 
       
    40 class HbThemeListModel : public QAbstractListModel
       
    41 {
       
    42     Q_OBJECT
       
    43 
       
    44 public:
       
    45     HbThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0);
       
    46     virtual ~HbThemeListModel();
       
    47 
       
    48     virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
       
    49     virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
       
    50 
       
    51 public slots:
       
    52     void themeListChanged();
       
    53 
       
    54 private:
       
    55     CpThemeChangerPrivate *mThemeChangerPrivate;
       
    56 };
       
    57 
       
    58 class CpThemeChangerPrivate
       
    59 {
       
    60     CpThemeChanger* q_ptr;
       
    61     Q_DECLARE_PUBLIC(CpThemeChanger)
       
    62 
       
    63 public:
       
    64     CpThemeChangerPrivate(CpThemeChanger* q);
       
    65     ~CpThemeChangerPrivate();
       
    66 
       
    67     bool connectToServer();
       
    68     bool isConnected() const;
       
    69 
       
    70     const QList<CpThemeChanger::ThemeInfo>& themes() const;
       
    71     void updateThemeList(const QString& currentThemeName = QString());
       
    72 
       
    73     const QStringList directories() const;
       
    74 
       
    75     const CpThemeChanger::ThemeInfo& currentTheme() const;
       
    76 
       
    77     const QString& currentThemeName() const;
       
    78     bool changeTheme(const QString& newtheme);
       
    79 
       
    80     void _q_themeDirectoryChanged(const QString&);
       
    81 
       
    82     CpThemeChanger::ThemeInfo mCurrentTheme;
       
    83 
       
    84     QString themeRootPath;
       
    85     QString themeRootPathPostfix;
       
    86 
       
    87     CpThemeClient* themeClient;
       
    88     QFileSystemWatcher* fileWatcher;
       
    89     QList<CpThemeChanger::ThemeInfo> themeList;
       
    90 	HbThemeListModel model;
       
    91 	friend class HbThemeChangerModel;
       
    92 };
       
    93 
       
    94 #endif /* HBTHEMECHANGER_P_H */