|
1 /* |
|
2 * Copyright (c) 2006-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: Implements queue that the Harvester server reads* |
|
15 */ |
|
16 |
|
17 #ifndef __CHARVESTERQUEUE__ |
|
18 #define __CHARVESTERQUEUE__ |
|
19 |
|
20 #include <monitorplugin.h> |
|
21 #include "harvestermediaidutil.h" |
|
22 |
|
23 // FORWARD DECLARATION |
|
24 class CHarvesterAO; |
|
25 class CHarvesterBlacklist; |
|
26 class CRestoreWatcher; |
|
27 |
|
28 class CHarvesterQueue : public CBase, |
|
29 public MMonitorPluginObserver |
|
30 { |
|
31 |
|
32 public: |
|
33 |
|
34 /** |
|
35 * Constructs a new harvester queue |
|
36 * |
|
37 * @return Harvester server queue implementation |
|
38 */ |
|
39 static CHarvesterQueue* NewL( CHarvesterAO* aHarvesterAO, |
|
40 CHarvesterBlacklist* aBlacklist ); |
|
41 |
|
42 /** |
|
43 * Constructs a new harvester queue implementation and leaves the queue implementation |
|
44 * in the cleanup stack. |
|
45 * |
|
46 * @return Harvester server queue implementation |
|
47 */ |
|
48 static CHarvesterQueue* NewLC( CHarvesterAO* aHarvesterAO, |
|
49 CHarvesterBlacklist* aBlacklist ); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CHarvesterQueue(); |
|
55 |
|
56 /** |
|
57 * ConstructL |
|
58 */ |
|
59 void ConstructL(); |
|
60 |
|
61 /** |
|
62 * ItemsInQueue |
|
63 * @return Number of items in the server queue |
|
64 */ |
|
65 TInt ItemsInQueue(); |
|
66 |
|
67 /** |
|
68 * Gets next item in the Harvester server queue |
|
69 * @returns The next item from the queue (FIFO) |
|
70 */ |
|
71 CHarvesterData* GetNextItem(); |
|
72 |
|
73 /** |
|
74 * Adds a item to the end of the queue |
|
75 * @param aItem Item to be added to the queue |
|
76 */ |
|
77 void Append( CHarvesterData* aItem ); |
|
78 |
|
79 /** |
|
80 * Derived from MMonitorPluginObserver - for getting new items to harvest |
|
81 * @param aHarvesterData data type which contains information needed by harvester |
|
82 */ |
|
83 void MonitorEvent( CHarvesterData* aHarvesterData ); |
|
84 |
|
85 /** |
|
86 * Derived from MMonitorPluginObserver - for getting new items to harvest |
|
87 * @param aHarvesterData array of data type which contains information needed by harvester |
|
88 */ |
|
89 void MonitorEvent( RPointerArray<CHarvesterData>& aHarvesterData ); |
|
90 |
|
91 /** |
|
92 * Remove items from harvesting queue |
|
93 */ |
|
94 TUint RemoveItems(TUint32 aMediaId); |
|
95 |
|
96 private: |
|
97 /** |
|
98 * Constructor |
|
99 */ |
|
100 CHarvesterQueue( CHarvesterAO* aHarvesterAO, CHarvesterBlacklist* aBlacklist ); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Array which holds the details of the available plugins - filled during startup |
|
106 */ |
|
107 RPointerArray<CHarvesterData> iItemQueue; |
|
108 |
|
109 /** Pointer to harvester active object */ |
|
110 CHarvesterAO* iHarvesterAO; |
|
111 |
|
112 /** Pointer to harvester blacklisting */ |
|
113 CHarvesterBlacklist* iBlacklist; |
|
114 |
|
115 RFs iFs; |
|
116 |
|
117 TVolumeInfo iVolInfo; |
|
118 |
|
119 // not own |
|
120 CHarvesterMediaIdUtil* iMediaIdUtil; |
|
121 }; |
|
122 |
|
123 #endif |