controlpanel/controlpanel_plat/inc/cpitemdatahelper.h
author hgs
Tue, 25 May 2010 04:13:06 +0800
changeset 38 5a264aaf7677
parent 36 48848d132687
child 52 58cebe0861a8
permissions -rw-r--r--
201019_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     1
/*
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     3
* All rights reserved.
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0""
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     8
*
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
     9
* Initial Contributors:
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    11
*
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    12
* Contributors:
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    13
*
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    14
* Description:  
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    15
*
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    16
*/
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    17
#ifndef CP_ITEM_DATA_HELPER_H
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    18
#define CP_ITEM_DATA_HELPER_H
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    19
32
hgs
parents: 31
diff changeset
    20
#include <QObject>
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    21
#include <cpglobal.h>
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    22
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    23
class QObject;
32
hgs
parents: 31
diff changeset
    24
class HbWidget;
hgs
parents: 31
diff changeset
    25
class QModelIndex;
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    26
class HbDataForm;
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    27
class HbAbstractViewItem;
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    28
class HbDataFormModelItem;
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    29
class CpItemDataHelperPrivate;
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    30
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    31
class CP_EXPORT CpItemDataHelper : public QObject
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    32
{
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    33
	Q_OBJECT
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    34
public:
32
hgs
parents: 31
diff changeset
    35
    explicit CpItemDataHelper(HbDataForm *form = 0);
hgs
parents: 31
diff changeset
    36
    virtual ~CpItemDataHelper();
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    37
32
hgs
parents: 31
diff changeset
    38
	void bindToForm(HbDataForm *form);
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    39
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    40
	void addItemPrototype(HbAbstractViewItem *prototype);
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    41
32
hgs
parents: 31
diff changeset
    42
    void addConnection(HbDataFormModelItem *item,
hgs
parents: 31
diff changeset
    43
        const char *signal,
hgs
parents: 31
diff changeset
    44
        QObject *receiver,
hgs
parents: 31
diff changeset
    45
        const char *method);
hgs
parents: 31
diff changeset
    46
hgs
parents: 31
diff changeset
    47
    void removeConnection(HbDataFormModelItem *item,
hgs
parents: 31
diff changeset
    48
        const char *signal,
hgs
parents: 31
diff changeset
    49
        QObject *receiver,
hgs
parents: 31
diff changeset
    50
        const char *method);
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    51
32
hgs
parents: 31
diff changeset
    52
    void connectToForm(const char *signal,
hgs
parents: 31
diff changeset
    53
        QObject *receiver,
hgs
parents: 31
diff changeset
    54
        const char *method);
hgs
parents: 31
diff changeset
    55
hgs
parents: 31
diff changeset
    56
    void disconnectFromForm(const char *signal,
hgs
parents: 31
diff changeset
    57
        QObject *receiver,
hgs
parents: 31
diff changeset
    58
        const char *method);
hgs
parents: 31
diff changeset
    59
hgs
parents: 31
diff changeset
    60
    HbWidget *widgetFromModelIndex(const QModelIndex &index);
36
hgs
parents: 32
diff changeset
    61
    
hgs
parents: 32
diff changeset
    62
    HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index);
32
hgs
parents: 31
diff changeset
    63
   
31
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    64
private:
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    65
    CpItemDataHelperPrivate *d;
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    66
};
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    67
2c9d3aa5bea2 201003_2
hgs
parents:
diff changeset
    68
#endif