mediasettings/videosettingsplugin/tsrc/testgroup/stub/inc/cpitemdatahelper.h
changeset 46 adbe7d5ba2f5
equal deleted inserted replaced
28:c48470be1ba7 46:adbe7d5ba2f5
       
     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: CpItemDataHelper stub
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CP_ITEM_DATA_HELPER_H
       
    19 #define CP_ITEM_DATA_HELPER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <qmap.h>
       
    23 
       
    24 class HbWidget;
       
    25 class QModelIndex;
       
    26 class HbDataFormModelItem;
       
    27 
       
    28 struct ConnectionHolder
       
    29 {
       
    30     ConnectionHolder() {}
       
    31     
       
    32     ConnectionHolder(const char* signal, QObject* receiver, const char* method)
       
    33     {
       
    34         this->signal = signal;
       
    35         this->receiver = receiver;
       
    36         this->method = method;
       
    37     }
       
    38     
       
    39     const char* signal;
       
    40     QObject* receiver;
       
    41     const char* method;
       
    42 };
       
    43 
       
    44 class CpItemDataHelper : public QObject
       
    45 {
       
    46     Q_OBJECT
       
    47 public:
       
    48     CpItemDataHelper();
       
    49     virtual ~CpItemDataHelper();
       
    50 
       
    51     void addConnection(HbDataFormModelItem *item,
       
    52         const char *signal,
       
    53         QObject *receiver,
       
    54         const char *method);
       
    55 
       
    56     void connectToForm(const char *signal,
       
    57         QObject *receiver,
       
    58         const char *method);
       
    59 
       
    60     HbWidget *widgetFromModelIndex(const QModelIndex &index);
       
    61     
       
    62     HbDataFormModelItem *modelItemFromModelIndex(const QModelIndex &index);
       
    63 
       
    64 public:
       
    65     
       
    66     HbWidget* mWidgetReturnValue;
       
    67     
       
    68     HbDataFormModelItem* mModelItemReturnValue;
       
    69     
       
    70     ConnectionHolder mFormConnection;
       
    71     
       
    72     QMap<HbDataFormModelItem*, ConnectionHolder> mConnections;
       
    73 };
       
    74 
       
    75 #endif