|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMMESSAGESEARCHLISTMODEL_H_ |
|
19 #define NMMESSAGESEARCHLISTMODEL_H_ |
|
20 |
|
21 #include <QSortFilterProxyModel> |
|
22 #include <QVector> |
|
23 |
|
24 #include "nmuienginedef.h" // For NMUIENGINE_EXPORT |
|
25 #include "nmcommon.h" |
|
26 |
|
27 |
|
28 class NMUIENGINE_EXPORT NmMessageSearchListModel : public QSortFilterProxyModel |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 public: // Construction and destruction |
|
33 |
|
34 NmMessageSearchListModel(QObject *parent = 0); |
|
35 |
|
36 ~NmMessageSearchListModel(); |
|
37 |
|
38 |
|
39 public: |
|
40 |
|
41 void clearSearchResults(); |
|
42 |
|
43 int searchResultCount() const; |
|
44 |
|
45 |
|
46 public: // From QSortFilterProxyModel |
|
47 |
|
48 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; |
|
49 |
|
50 |
|
51 protected: // From QSortFilterProxyModel |
|
52 |
|
53 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; |
|
54 |
|
55 |
|
56 public slots: |
|
57 |
|
58 bool addSearchResult(const NmId &messageId); |
|
59 |
|
60 void refreshContent(); |
|
61 |
|
62 |
|
63 private: // Data |
|
64 |
|
65 QVector<NmId> mSearchResults; |
|
66 }; |
|
67 |
|
68 #endif /* NMMESSAGESEARCHLISTMODEL_H_ */ |
|
69 |
|
70 // End of file. |