videocollection/tsrc/stubs/inc/hbselectiondialog.h
author hgs
Fri, 15 Oct 2010 16:29:10 +0300
changeset 67 72c709219fcd
permissions -rw-r--r--
201041

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  stub HbSelectionDialog
* 
*/

#ifndef HBSELECTIONDIALOG_H
#define HBSELECTIONDIALOG_H

#include <QObject>
#include "hbwidget.h"
#include "hbdialog.h"
#include "hbselectiondialog.h"
#include "hbabstractitemview.h"

class HbListView;
class QGraphicsItem;
class QGraphicsWidget;
class HbAction;
class QAbstractItemModel;


class HbSelectionDialog :  public HbDialog
{
   Q_OBJECT
   
signals:

   void selectionChanged(); 
   
public:

    
    /**
     * contructor
     */
    HbSelectionDialog(QGraphicsItem *parent=0);
    
    /**
     * destructor
     */
    ~HbSelectionDialog();

public:
    
    void setSelectionMode(HbAbstractItemView::SelectionMode mode);
    HbAbstractItemView::SelectionMode selectionMode() const;

    void setModel(QAbstractItemModel* model);
    QAbstractItemModel* model() const;
    QModelIndexList selectedModelIndexes() const;
    void setSelectedModelIndexes(QModelIndexList list);
    QString selectionTitle() const;
    void setSelectionTitle(const QString& title);
    void setListView(HbListView* list);
    virtual QGraphicsItem *primitive(const QString &itemName) const;

    HbAbstractItemView::SelectionMode mSelectionMode;
    QAbstractItemModel* mModel;
    QModelIndexList mModelIndexList;
    HbListView* mListView;
    
    /**
     * address of current instance zeroed during destcructor
     * this is for making sure object is removed correctly
     */
    static HbSelectionDialog *currentInstance;
        
    /**
     * if true, exec returns mPrimaryAction
     */
    static bool execReturnPrimary;
    
    /**
     * if true, primaryAction() -method returns null
     */
    static bool primaryReturnNull;   
    
    /**
     * if true, secondaryAction() -method returns null
     */
    static bool secondaryReturnNull;
    
    /**
     * the amount how many times the open has been called.
     */
    static int openAmount;
    
};

#endif