|
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: Music Player collection view base container definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <QtCore> |
|
19 |
|
20 #include <hbabstractviewitem.h> |
|
21 |
|
22 #include "mpcollectioncontainer.h" |
|
23 #include "mpcollectiondatamodel.h" |
|
24 #include "mpmpxcollectiondata.h" |
|
25 #include "mptrace.h" |
|
26 |
|
27 /*! |
|
28 \class MpCollectionContainer |
|
29 \brief Music Player collection view base container definition. |
|
30 |
|
31 Collection container is a base container that provides interface to |
|
32 be implemented by the specific collection context containers, e.g. |
|
33 All Songs, Artists, etc. |
|
34 */ |
|
35 |
|
36 /*! |
|
37 \fn void itemActivated( int index ); |
|
38 |
|
39 This signal is emitted when an item of the container with \a index is activated. |
|
40 */ |
|
41 |
|
42 /*! |
|
43 \fn void itemLongPressed( int index, const QPointF &coords ); |
|
44 |
|
45 This signal is emitted when an item of the container with \a index is long pressed. |
|
46 */ |
|
47 |
|
48 /*! |
|
49 Constructs the collection container. |
|
50 */ |
|
51 MpCollectionContainer::MpCollectionContainer( HbDocumentLoader *loader, QGraphicsItem *parent ) |
|
52 : HbWidget(parent), |
|
53 mDocumentLoader(loader), |
|
54 mCollectionContext(ECollectionContextUnknown) |
|
55 { |
|
56 TX_LOG |
|
57 } |
|
58 |
|
59 /*! |
|
60 Destructs the collection container. |
|
61 */ |
|
62 MpCollectionContainer::~MpCollectionContainer() |
|
63 { |
|
64 TX_LOG |
|
65 } |
|
66 |
|
67 /*! |
|
68 Sets the data model for the container. |
|
69 */ |
|
70 void MpCollectionContainer::setDataModel( MpCollectionDataModel *dataModel ) |
|
71 { |
|
72 TX_ENTRY |
|
73 mDataModel = dataModel; |
|
74 mCollectionData = mDataModel->collectionData(); |
|
75 mCollectionContext = mCollectionData->context(); |
|
76 |
|
77 setupContainer(); |
|
78 TX_EXIT |
|
79 } |
|
80 |
|
81 /*! |
|
82 Loads the correct layout based on the \a orientation. |
|
83 */ |
|
84 void MpCollectionContainer::orientationChange( Qt::Orientation orientation ) |
|
85 { |
|
86 Q_UNUSED(orientation); |
|
87 } |
|
88 |
|
89 /*! |
|
90 Sets the view mode. |
|
91 */ |
|
92 void MpCollectionContainer::setViewMode( MpCommon::MpViewMode viewMode ) |
|
93 { |
|
94 mViewMode = viewMode; |
|
95 } |
|
96 |