|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IRSYMBIANDOCUMENT_H |
|
19 #define IRSYMBIANDOCUMENT_H |
|
20 |
|
21 #include <QS60MainDocument> |
|
22 |
|
23 #include <QString> |
|
24 #include <QList> |
|
25 |
|
26 class QTextStream; |
|
27 |
|
28 class IRPlsPlayListItem |
|
29 { |
|
30 public: |
|
31 IRPlsPlayListItem(const QString &aFile, const QString &aTitle, int aLength); |
|
32 |
|
33 const QString & file() const; |
|
34 const QString & title() const; |
|
35 |
|
36 private: |
|
37 QString iFile; |
|
38 QString iTitle; |
|
39 int iLength; |
|
40 }; |
|
41 |
|
42 class IRSymbianDocument : public QS60MainDocument |
|
43 { |
|
44 public: |
|
45 static IRSymbianDocument *getInstance(); |
|
46 bool isPlsAvailable() const; |
|
47 int getNumberOfEntries() const; |
|
48 IRPlsPlayListItem* getEntry(int aIndex); |
|
49 |
|
50 void parseFile(const QString &aFileName); |
|
51 |
|
52 private: |
|
53 IRSymbianDocument(CEikApplication &mainApplication); |
|
54 ~IRSymbianDocument(); |
|
55 |
|
56 private: |
|
57 //from base class CEikDocument |
|
58 void OpenFileL(CFileStore*& aFileStore, RFile& aFile); |
|
59 CEikAppUi* CreateAppUiL(); |
|
60 |
|
61 void parsePlsFile(const QString &aFileName); |
|
62 void parseM3uFile(const QString &aFileName); |
|
63 |
|
64 void clearPlsList(); |
|
65 QString readValue(QTextStream &aStream, const QString &aKey); |
|
66 |
|
67 private: |
|
68 static IRSymbianDocument *documentInstance; |
|
69 QList<IRPlsPlayListItem*> iPlsList; |
|
70 }; |
|
71 |
|
72 #endif //IRSYMBIANDOCUMENT_H |