34
|
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 popup handler.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef MPCOLLECTIONPOPUPHANDLER_H
|
|
19 |
#define MPCOLLECTIONPOPUPHANDLER_H
|
|
20 |
|
|
21 |
#include <QObject>
|
37
|
22 |
#include "mpmpxcollectionviewdefs.h"
|
34
|
23 |
|
|
24 |
class MpCollectionView;
|
|
25 |
class HbPopup;
|
|
26 |
class HbAction;
|
|
27 |
class MpEngine;
|
|
28 |
class QAbstractItemModel;
|
|
29 |
class MpMpxCollectionData;
|
|
30 |
class QPointF;
|
37
|
31 |
class MpPopupHandlerPermanentData;
|
34
|
32 |
|
|
33 |
class MpCollectionPopupHandler : public QObject
|
|
34 |
{
|
|
35 |
Q_OBJECT
|
|
36 |
|
|
37 |
public:
|
|
38 |
MpCollectionPopupHandler( MpCollectionView *parent );
|
|
39 |
virtual ~MpCollectionPopupHandler();
|
|
40 |
|
|
41 |
void openDefaultViewContextMenu( int index, const QPointF &coords );
|
|
42 |
void openFetchViewContextMenu( int index, const QPointF &coords );
|
|
43 |
void openRenamePlaylistContainerDialog( const QString ¤tName );
|
|
44 |
void openRenamePlaylistItemDialog( const QString ¤tName );
|
|
45 |
void openAddSongsToPlaylist( QAbstractItemModel* model );
|
35
|
46 |
void openAddSongsToPlaylistFromTBone();
|
34
|
47 |
void openDeleteSongs( QAbstractItemModel* model );
|
|
48 |
void openAddToCurrentPlaylist( MpMpxCollectionData* collectionData );
|
|
49 |
void openCreateNewPlaylist( MpMpxCollectionData* collectionData );
|
35
|
50 |
void openArrangeSongs();
|
37
|
51 |
void cancelOngoingPopup( bool onlyContextMenu );
|
34
|
52 |
|
|
53 |
public slots:
|
|
54 |
//Context Menus
|
|
55 |
void defaultContextMenuOptionSelected( HbAction *selectedAction );
|
|
56 |
void fetcherContextMenuOptionSelected( HbAction *selectedAction );
|
|
57 |
|
|
58 |
//Dialogs
|
|
59 |
void handleAddToPlaylistDialogFinished( HbAction *selectedAction );
|
|
60 |
void handleAddToPlaylistGetTextFinished( HbAction *selectedAction );
|
|
61 |
void handleRenamePlaylistContainer( HbAction *selectedAction );
|
|
62 |
void handleRenamePlaylistItem( HbAction *selectedAction );
|
|
63 |
void handleAddSongsToPlayList( HbAction *selectedAction );
|
|
64 |
void handleDeleteSongs( HbAction *selectedAction );
|
|
65 |
void handleAddToCurrentPlaylist( HbAction *selectedAction );
|
|
66 |
void handleCreateNewPlaylistGetTextFinished( HbAction *selectedAction );
|
|
67 |
void handleCreateNewPlaylistGetModelIndexesFinished( HbAction *selectedAction );
|
|
68 |
void handleArrangeSongs( HbAction *selectedAction );
|
|
69 |
void handleRequestDelete( HbAction *selectedAction );
|
|
70 |
|
37
|
71 |
//External Events
|
|
72 |
void handleDeleteStarted( TCollectionContext context, int count );
|
|
73 |
void handleAddingSongs( int count );
|
|
74 |
void handleOperationEnded( bool success );
|
|
75 |
|
34
|
76 |
void outstandingPopupClosing();
|
|
77 |
|
|
78 |
private:
|
|
79 |
void setOutstandingPopup( HbPopup *popup );
|
|
80 |
void clearOutstandingPopup( HbPopup *popup );
|
|
81 |
void launchAddToPlaylistDialog( QList<int> &selection );
|
|
82 |
void queryNewPlaylistName(const QStringList &playlists, const char *handler );
|
|
83 |
void getText(const QString &label, const QString &text, const char *handler );
|
|
84 |
void getModelIndexes( const QString &label, QAbstractItemModel* model, const char *handler );
|
35
|
85 |
void launchArrangeSongsDialog();
|
34
|
86 |
void requestDelete( QList<int> &selection );
|
37
|
87 |
void launchProgressDialog( const char *id );
|
|
88 |
void connectExternalEvents();
|
34
|
89 |
|
|
90 |
private:
|
|
91 |
MpCollectionView *mView; // Not own
|
|
92 |
HbPopup *mOutstandingPopup; // Own
|
|
93 |
MpEngine *mMpEngine; // Not own
|
|
94 |
MpPopupHandlerPermanentData *mPermanentData; // Own
|
37
|
95 |
bool mExternalEventsConnected;
|
34
|
96 |
};
|
|
97 |
|
|
98 |
#endif // MPCOLLECTIONPOPUPHANDLER_H
|
|
99 |
|