|
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 VideoProxyModelGeneric class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef VIDEOPROXYMODELGENERIC_H |
|
19 #define VIDEOPROXYMODELGENERIC_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32const.h> |
|
23 #include <mpxitemid.h> |
|
24 #include <QModelIndex> |
|
25 |
|
26 class VideoListDataModel; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 class VideoProxyModelGeneric : public QObject |
|
30 { |
|
31 Q_OBJECT |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Contructor. |
|
37 * |
|
38 * @param QObject parent object. |
|
39 */ |
|
40 VideoProxyModelGeneric(QObject *parent = 0); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 * |
|
45 */ |
|
46 virtual ~VideoProxyModelGeneric(); |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Opens the defined item. This is quite abstract as depending |
|
52 * on the type of the item, the behaviour or result could be |
|
53 * quite different. |
|
54 * |
|
55 * @param item id id of the item to be opened |
|
56 * @return int 0 succeeds, <0 if opening does not succeed. |
|
57 */ |
|
58 virtual int openItem(TMPXItemId mediaId); |
|
59 |
|
60 /** |
|
61 * Gets the currently opened item. |
|
62 * |
|
63 * @param None. |
|
64 * @return TMPXItemId. |
|
65 */ |
|
66 virtual TMPXItemId getOpenItem() const; |
|
67 |
|
68 /** |
|
69 * Compares items based in the role setted before sorting. From QSortFilterProxyModel. |
|
70 * |
|
71 */ |
|
72 virtual bool lessThan(const QModelIndex & left, const QModelIndex & right) const; |
|
73 |
|
74 /** |
|
75 * Filtering functionality. Called by the FW. From QSortFilterProxyModel. |
|
76 * |
|
77 * @param source_row row to check |
|
78 * @param source_parent row's parent |
|
79 * |
|
80 * @return bool row accepted(true) or not accepted(false) |
|
81 */ |
|
82 virtual bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const; |
|
83 |
|
84 /** |
|
85 * Connects all signals emitted from or throught this object. |
|
86 * |
|
87 * @return bool |
|
88 */ |
|
89 virtual bool connectSignals(); |
|
90 |
|
91 /** |
|
92 * Disconnects all signals. |
|
93 */ |
|
94 void disconnectSignals(); |
|
95 |
|
96 /** |
|
97 * Does actual sorting and emits sortingReady. |
|
98 * |
|
99 */ |
|
100 virtual void processSorting(); |
|
101 |
|
102 /** |
|
103 * Returns sourceModel; |
|
104 */ |
|
105 virtual const VideoListDataModel *sourceModel() const; |
|
106 |
|
107 public: |
|
108 static int mOpenItemCallCount; |
|
109 static int mGetOpenItemCallCount; |
|
110 static int mLessThanCallCount; |
|
111 static int mFilterAcceptsRowCallCount; |
|
112 static int mConnectSignalsCallCount; |
|
113 static int mDisconnectSignalsCallCount; |
|
114 static int mProcessSortingCallCount; |
|
115 |
|
116 public: |
|
117 |
|
118 /** |
|
119 * Pointer to the actual model. |
|
120 */ |
|
121 VideoListDataModel *mModel; |
|
122 |
|
123 /** |
|
124 * Collection client. |
|
125 */ |
|
126 int mCollectionClient; |
|
127 }; |
|
128 |
|
129 #endif // VIDEOPROXYMODELGENERIC_H |