|
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 HbSelectionDialog |
|
15 * |
|
16 */ |
|
17 #include <QGraphicsWidget> |
|
18 |
|
19 #include "hbaction.h" |
|
20 #include "hblabel.h" |
|
21 #include "hbselectiondialog.h" |
|
22 #include "hbabstractitemview.h" |
|
23 |
|
24 HbSelectionDialog *HbSelectionDialog::currentInstance = 0; |
|
25 bool HbSelectionDialog::execReturnPrimary = true; |
|
26 bool HbSelectionDialog::primaryReturnNull = false; |
|
27 bool HbSelectionDialog::secondaryReturnNull = false; |
|
28 int HbSelectionDialog::openAmount = 0; |
|
29 |
|
30 HbSelectionDialog::HbSelectionDialog(QGraphicsItem *parent) |
|
31 : HbDialog(parent) |
|
32 , mModel(0) |
|
33 , mListView(0) |
|
34 , mSelectionMode(HbAbstractItemView::InvalidSelection) |
|
35 { |
|
36 currentInstance = this; |
|
37 } |
|
38 |
|
39 HbSelectionDialog::~HbSelectionDialog() |
|
40 { |
|
41 mListView = 0; |
|
42 mModel = 0; |
|
43 mSelectionMode = HbAbstractItemView::InvalidSelection; |
|
44 currentInstance = 0; |
|
45 } |
|
46 |
|
47 |
|
48 void HbSelectionDialog::setSelectionMode(HbAbstractItemView::SelectionMode mode) |
|
49 { |
|
50 mSelectionMode = mode; |
|
51 } |
|
52 HbAbstractItemView::SelectionMode HbSelectionDialog::selectionMode() const |
|
53 { |
|
54 return mSelectionMode; |
|
55 } |
|
56 |
|
57 void HbSelectionDialog::setModel(QAbstractItemModel* model) |
|
58 { |
|
59 mModel = model; |
|
60 } |
|
61 QAbstractItemModel* HbSelectionDialog::model() const |
|
62 { |
|
63 return mModel; |
|
64 } |
|
65 QModelIndexList HbSelectionDialog::selectedModelIndexes() const |
|
66 { |
|
67 return mModelIndexList; |
|
68 } |
|
69 |
|
70 void HbSelectionDialog::setSelectedModelIndexes(QModelIndexList list) |
|
71 { |
|
72 mModelIndexList.clear(); |
|
73 mModelIndexList.append(list); |
|
74 } |
|
75 |
|
76 void HbSelectionDialog::setListView(HbListView* list) |
|
77 { |
|
78 mListView = list; |
|
79 } |
|
80 |
|
81 QGraphicsItem* HbSelectionDialog::primitive(const QString &itemName) const |
|
82 { |
|
83 if(itemName == "list") |
|
84 { |
|
85 return (QGraphicsItem*)mListView; |
|
86 } |
|
87 return (QGraphicsItem*)this; |
|
88 } |
|
89 |
|
90 QString HbSelectionDialog::selectionTitle() const |
|
91 { |
|
92 return QString(); |
|
93 } |
|
94 void HbSelectionDialog::setSelectionTitle(const QString& title) |
|
95 { |
|
96 Q_UNUSED(title) |
|
97 } |