|
1 /* |
|
2 * Copyright (c) 2006 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: Contains MNcdNodeScreenshot interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCD_NODE_SCREENSHOT_H |
|
20 #define M_NCD_NODE_SCREENSHOT_H |
|
21 |
|
22 |
|
23 #include <e32cmn.h> |
|
24 |
|
25 #include "catalogsbase.h" |
|
26 #include "ncdinterfaceids.h" |
|
27 |
|
28 |
|
29 class MNcdDownloadOperation; |
|
30 class MNcdDownloadOperationObserver; |
|
31 |
|
32 |
|
33 /** |
|
34 * This interface is provided for the node if it contains screenshots. |
|
35 * The node may contains multiple screenshots. |
|
36 * |
|
37 * |
|
38 */ |
|
39 class MNcdNodeScreenshot : public virtual MCatalogsBase |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Unique identifier for the interface, required for all MCatalogsBase interfaces. |
|
46 * |
|
47 * |
|
48 */ |
|
49 enum { KInterfaceUid = ENcdNodeScreenshotUid }; |
|
50 |
|
51 |
|
52 /** |
|
53 * Gives the number of the screenshots for the node. |
|
54 * |
|
55 * @note This count is given according to the protocol information |
|
56 * that informs how many screenshots for the node are available. So, the information |
|
57 * can be asked before calling LoadScreenshotL. But, to get the |
|
58 * data of the wanted screenshot, LoadScreenshotL has to be called. |
|
59 * |
|
60 * |
|
61 * @return The number of screenshots. |
|
62 */ |
|
63 virtual TInt ScreenshotCount() const = 0; |
|
64 |
|
65 |
|
66 /** |
|
67 * Gives the mime type of the screenshot data. |
|
68 * |
|
69 * @note This mime type is set according to the information gotten |
|
70 * from the protocol. So, this information is available before calling |
|
71 * LoadScreenshotL for the screenshot item of the given index. |
|
72 * |
|
73 * @note Current servers do not send mime types for screenshots so |
|
74 * this always returns KNullDesC |
|
75 * |
|
76 * @param aIndex tells which one of the screenshots is wanted. |
|
77 * @return The mime type of the screenshot data. The type is |
|
78 * given as a text according to the standards that define MIME types. |
|
79 * If the protocol has not defined |
|
80 * any value, an empty string is returned. |
|
81 * @exception Panic ENcdPanicIndexOutOfRange Index out of range. |
|
82 */ |
|
83 virtual const TDesC& ScreenshotMimeType( TInt aIndex ) const = 0; |
|
84 |
|
85 |
|
86 /** |
|
87 * Downloads the screenshot file. The screenshot is not handled by the engine, |
|
88 * the screenshot data should be handled by the user of this interface as it |
|
89 * sees fit. |
|
90 * |
|
91 * @note The reference count of the operation object is increased by one. |
|
92 * So, Release() function of the operation should be called when the operation |
|
93 * is not needed anymore. |
|
94 * |
|
95 * @note If a download operation has already been started for the specified |
|
96 * screenshot, the already existing operation object is returned. |
|
97 * |
|
98 * |
|
99 * @param aIndex Index of the screenshot that should be loaded. |
|
100 * @param aObserver Observer for the operation. |
|
101 * @return Pointer to an operation object that can |
|
102 * be used to check the progressing of the screenshot loading. Counted, |
|
103 * Release() must be called after use. |
|
104 * @exception Leave System wide error codes. |
|
105 * Leave with KNcdErrorParallelOperationNotAllowed if a parallel client is running |
|
106 * an operation for the same metadata. See MNcdOperation for full explanation. |
|
107 * @exception Panic ENcdPanicIndexOutOfRange Index out of range. |
|
108 */ |
|
109 virtual MNcdDownloadOperation* LoadScreenshotL( TInt aIndex, |
|
110 MNcdDownloadOperationObserver* aObserver ) = 0; |
|
111 |
|
112 |
|
113 /** |
|
114 * Gives the data of the loaded screenshot. |
|
115 * |
|
116 * The MIME type of the screenshot may be found automatically |
|
117 * from the screenshot data by Symbian methods. |
|
118 * |
|
119 * |
|
120 * @param aIndex is the index of the screenshot. |
|
121 * @return Data of the loaded screenshot. Ownership is |
|
122 * transferred. NULL if the data has not been loaded. |
|
123 * @exception Leave System wide error codes. |
|
124 * @exception Panic ENcdPanicIndexOutOfRange Index out of range. |
|
125 */ |
|
126 virtual HBufC8* ScreenshotDataL( TInt aIndex ) const = 0; |
|
127 |
|
128 |
|
129 protected: |
|
130 |
|
131 /** |
|
132 * Destructor. |
|
133 * |
|
134 * @see MCatalogsBase::~MCatalogsBase |
|
135 */ |
|
136 virtual ~MNcdNodeScreenshot() {} |
|
137 |
|
138 }; |
|
139 |
|
140 |
|
141 #endif // M_NCD_NODE_SCREENSHOT_H |