tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h
author hgs
Fri, 06 Aug 2010 13:40:46 +0300
changeset 107 b34d53f6acdf
parent 99 7aaf39b772ac
child 112 dbfb5e38438b
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
99
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: tsactivitymodelitem.h
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef TSACTIVITYMODELITEM_H
hgs
parents:
diff changeset
    19
#define TSACTIVITYMODELITEM_H
107
hgs
parents: 99
diff changeset
    20
99
hgs
parents:
diff changeset
    21
#include <qvariant.h>
hgs
parents:
diff changeset
    22
#include <qicon.h>
107
hgs
parents: 99
diff changeset
    23
hgs
parents: 99
diff changeset
    24
#include "tsmodelitem.h"
99
hgs
parents:
diff changeset
    25
/*!
hgs
parents:
diff changeset
    26
    Implements model item which represents Activity entry
hgs
parents:
diff changeset
    27
*/
hgs
parents:
diff changeset
    28
class TsActivityModelItem : public TsModelItem
hgs
parents:
diff changeset
    29
{
hgs
parents:
diff changeset
    30
    Q_OBJECT
hgs
parents:
diff changeset
    31
public:
107
hgs
parents: 99
diff changeset
    32
    TsActivityModelItem(QAbstractListModel &model, 
hgs
parents: 99
diff changeset
    33
                        QObject &service, 
hgs
parents: 99
diff changeset
    34
                        const QVariantHash &activity);
99
hgs
parents:
diff changeset
    35
    ~TsActivityModelItem();
hgs
parents:
diff changeset
    36
    QVariant data(int role) const;
hgs
parents:
diff changeset
    37
    void close();
hgs
parents:
diff changeset
    38
    void open();
hgs
parents:
diff changeset
    39
    static QString applicationKeyword();
hgs
parents:
diff changeset
    40
    static QString screenshotKeyword();
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
private:
hgs
parents:
diff changeset
    43
    QVariant decorationRole() const;
hgs
parents:
diff changeset
    44
    QVariant displayRole() const;
hgs
parents:
diff changeset
    45
    QVariant visibilityRole() const;
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
private slots:
hgs
parents:
diff changeset
    48
    void thumbnailReady(QPixmap, void *);
hgs
parents:
diff changeset
    49
signals:
hgs
parents:
diff changeset
    50
    void entryChanged(TsModelItem *);
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
private:
hgs
parents:
diff changeset
    53
    QObject &mService;
hgs
parents:
diff changeset
    54
    const QVariantHash mActivity;
hgs
parents:
diff changeset
    55
    QIcon mIcon;
107
hgs
parents: 99
diff changeset
    56
    mutable bool mRequestPending;
hgs
parents: 99
diff changeset
    57
    
hgs
parents: 99
diff changeset
    58
    Q_DISABLE_COPY(TsActivityModelItem)
hgs
parents: 99
diff changeset
    59
99
hgs
parents:
diff changeset
    60
};
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
#endif // TSACTIVITYMODELITEM_H