|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Processor object for running thumbnail requests |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef THUMBNAILREQUESTQUEUE_H |
|
20 #define THUMBNAILREQUESTQUEUE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "thumbnailmanager.h" |
|
25 |
|
26 class CThumbnailRequestActive; |
|
27 |
|
28 /** |
|
29 * Processor object for running queued tasks. |
|
30 * |
|
31 * @since S60 v5.0 |
|
32 */ |
|
33 class CThumbnailRequestQueue: public CBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * |
|
40 * @since S60 v5.0 |
|
41 * @return Instance of CThumbnailRequestQueue. |
|
42 */ |
|
43 static CThumbnailRequestQueue* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor |
|
47 * |
|
48 * @since S60 v5.0 |
|
49 */ |
|
50 virtual ~CThumbnailRequestQueue(); |
|
51 |
|
52 /** |
|
53 * Activates next request if possible. |
|
54 * |
|
55 * @since S60 v5.0 |
|
56 */ |
|
57 void Process(); |
|
58 |
|
59 /** |
|
60 * Adds new request to the queue. |
|
61 * |
|
62 * @since S60 v5.0 |
|
63 * @param aRequest Request to be added to the queue. |
|
64 */ |
|
65 void AddRequestL( CThumbnailRequestActive* aRequest ); |
|
66 |
|
67 /** |
|
68 * Cancels request in the queue. |
|
69 * |
|
70 * @since S60 v5.0 |
|
71 * @param aId Request to be canceled. |
|
72 * @return Error code. |
|
73 */ |
|
74 TInt CancelRequest( const TThumbnailRequestId aId ); |
|
75 |
|
76 /** |
|
77 * Change priority of a request. |
|
78 * |
|
79 * @since S60 v5.0 |
|
80 * @param aId Request to be canceled. |
|
81 * @param aNewPriority New priority. |
|
82 * @return Error code. |
|
83 */ |
|
84 TInt ChangePriority( const TThumbnailRequestId aId, const TInt aNewPriority ); |
|
85 |
|
86 /** |
|
87 * Marks request complete. |
|
88 * |
|
89 * @since S60 v5.0 |
|
90 */ |
|
91 void RequestComplete(CThumbnailRequestActive* aRequestAO = NULL); |
|
92 |
|
93 /** |
|
94 * Removes completed requests. |
|
95 * |
|
96 * @since S60 v5.0 |
|
97 */ |
|
98 void RemoveCompleted(CThumbnailRequestActive* aRequestAO); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * C++ default constructor |
|
104 * |
|
105 * @since S60 v5.0 |
|
106 * @return Instance of CThumbnailRequestQueue. |
|
107 */ |
|
108 CThumbnailRequestQueue(); |
|
109 |
|
110 /** |
|
111 * Symbian 2nd phase constructor can leave. |
|
112 * |
|
113 * @since S60 v5.0 |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 private: |
|
118 |
|
119 /** |
|
120 * Array of active objects for each pending thumbnail request. |
|
121 */ |
|
122 RPointerArray <CThumbnailRequestActive> iRequests; |
|
123 |
|
124 // number of currently active requests |
|
125 TInt iActiveRequests; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // THUMBNAILREQUESTQUEUE_H |