videocollection/tsrc/stubs/src/hbstackedwidget.h
changeset 36 8aed59de29f9
parent 35 3738fe97f027
child 37 4eb2df7f7cbe
equal deleted inserted replaced
35:3738fe97f027 36:8aed59de29f9
     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:  stub HbStackedWidget for testing video list selection dialog
       
    15 * 
       
    16 */
       
    17 
       
    18 #ifndef HBSTACKEDWIDGET
       
    19 #define HBSTACKEDWIDGET
       
    20 
       
    21 #include <qpointer.h>
       
    22 #include <QGraphicsWidget>
       
    23 #include "hbwidget.h"
       
    24 
       
    25 class HbStackedWidget : public HbWidget
       
    26 {
       
    27     Q_OBJECT
       
    28 public:
       
    29     /**
       
    30      * constructor
       
    31      */
       
    32     HbStackedWidget(QGraphicsItem *parent = 0) : HbWidget(parent), mCurrentWidget(0){initializeCount++;}
       
    33     
       
    34     /**
       
    35      * destructor
       
    36      */
       
    37     ~HbStackedWidget(){initializeCount--; delete mCurrentWidget;}
       
    38     
       
    39     /**
       
    40      * dummey member
       
    41      */
       
    42     int addWidget(QObject *widget){mCurrentWidget = widget; return 0;}
       
    43     
       
    44     /**
       
    45      * dummy member
       
    46      */
       
    47     QObject* currentWidget(){ return mCurrentWidget;}
       
    48     
       
    49     /**
       
    50      * dummy member
       
    51      */
       
    52     QObject *removeAt(int index){Q_UNUSED(index); QObject *tmp = mCurrentWidget; mCurrentWidget = 0;   return tmp;}
       
    53     
       
    54     /**
       
    55      * counter to make sure alloc dealloc match
       
    56      */
       
    57     static int initializeCount;
       
    58     
       
    59     QPointer<QObject> mCurrentWidget;
       
    60 };
       
    61 
       
    62 #endif