|
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: This widget is used to display audio content in univiewer. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef UNI_VIEWER_AUDIO_WIDGET_H |
|
19 #define UNI_VIEWER_AUDIO_WIDGET_H |
|
20 |
|
21 // FORWARD DECLARATIONS |
|
22 class UniViewerUtils; |
|
23 |
|
24 #include <HbPushButton> |
|
25 |
|
26 /** |
|
27 * @class UniViewerAudioWidget |
|
28 * @brief This widget is used to display audio content in univiewer. |
|
29 */ |
|
30 class UniViewerAudioWidget: public HbPushButton |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Constructor |
|
38 */ |
|
39 explicit UniViewerAudioWidget(QGraphicsItem *parent = 0); |
|
40 |
|
41 /** |
|
42 * Destructor |
|
43 */ |
|
44 ~UniViewerAudioWidget(); |
|
45 |
|
46 /** |
|
47 * Populates the widget contents. |
|
48 * @param mimeType Mime type of media. |
|
49 * @param filePath File path of media. |
|
50 */ |
|
51 void populate(const QString &mimeType, const QString &filePath); |
|
52 |
|
53 signals: |
|
54 |
|
55 /** |
|
56 * Signal emitted when widget is clicked. |
|
57 * @param mediaPath File path of the media. |
|
58 */ |
|
59 void shortTap(const QString &mediaPath); |
|
60 |
|
61 /** |
|
62 * Signal emitted when widget is long tapped. |
|
63 * @param position Scene coordinates of tap. |
|
64 */ |
|
65 void longTap(const QPointF &position); |
|
66 |
|
67 private slots: |
|
68 |
|
69 /** |
|
70 * Handles short tap event. |
|
71 */ |
|
72 void handleShortTap(); |
|
73 |
|
74 /** |
|
75 * Handles long tap event. |
|
76 * @param position Scene coordinates of tap. |
|
77 */ |
|
78 void handleLongTap(const QPointF &position); |
|
79 |
|
80 /** |
|
81 * Handles opening of media. |
|
82 */ |
|
83 void handleOpen(); |
|
84 |
|
85 /** |
|
86 * Handles saving of media. |
|
87 */ |
|
88 void handleSave(); |
|
89 |
|
90 /** |
|
91 * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture |
|
92 * events back to back. |
|
93 */ |
|
94 void regrabGesture(); |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * UniViewerUtils object. |
|
100 * Own |
|
101 */ |
|
102 UniViewerUtils *mViewerUtils; |
|
103 |
|
104 /** |
|
105 * Media file path. |
|
106 */ |
|
107 QString mMediaPath; |
|
108 |
|
109 /** |
|
110 * Mime type of media. |
|
111 */ |
|
112 QString mMimeType; |
|
113 }; |
|
114 |
|
115 #endif //UNI_VIEWER_AUDIO_WIDGET_H |
|
116 // EOF |