|
1 /* |
|
2 * Copyright (c) 2008-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: Base class for publishing all the content |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef GLXCONTENTHARVESTERPLUGINBASE_H |
|
22 #define GLXCONTENTHARVESTERPLUGINBASE_H |
|
23 |
|
24 //includes |
|
25 |
|
26 #include <liwcommon.h> |
|
27 |
|
28 //Forward Declarations |
|
29 |
|
30 class CLiwGenericParamList; |
|
31 class CLiwServiceHandler; |
|
32 class MLiwInterface; |
|
33 class CGlxContentHarvesterPluginBase; |
|
34 class CGlxThumbnailContext; |
|
35 class MGlxMediaList; |
|
36 class MGlxContentHarvesterPlugin; |
|
37 |
|
38 class MGlxContentHarvesterPluginEntry : public MLiwNotifyCallback |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Virtual destructor |
|
43 */ |
|
44 virtual ~MGlxContentHarvesterPluginEntry() {}; |
|
45 virtual void ContainerCacheCleanupL(MGlxMediaList* aMediaList)=0; |
|
46 virtual void UpdatePreviewThumbnailListL()=0; |
|
47 virtual void RemoveContextAndObserver()=0; |
|
48 virtual TBool Focused()=0; |
|
49 virtual TInt Count()=0; |
|
50 }; |
|
51 |
|
52 |
|
53 class CGlxContentHarvesterPluginBase : public CBase, public MGlxContentHarvesterPluginEntry |
|
54 { |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Default constructor. |
|
59 */ |
|
60 CGlxContentHarvesterPluginBase( ); |
|
61 |
|
62 /** |
|
63 * Perform the second phase construction |
|
64 */ |
|
65 void ConstructL(TInt aDefaultIconId ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 virtual ~CGlxContentHarvesterPluginBase(); |
|
71 |
|
72 TSize GetGridIconSize(); |
|
73 |
|
74 /* Calculate the Grid Icon Size for Grid Widget. It always calculate |
|
75 * size for Landscape orientation. This is done to avoid saving two |
|
76 * different thumbnail icons in Thumbnail database. |
|
77 */ |
|
78 void SetGridIconSizeL(); |
|
79 |
|
80 /** |
|
81 * Returns the focus status of this photossuite collection |
|
82 */ |
|
83 TBool Focused(); |
|
84 |
|
85 /*This returns the bitmap handle used to display the |
|
86 * default thumbnail. |
|
87 */ |
|
88 TInt GetBitmapHandle() const; |
|
89 |
|
90 /** |
|
91 * Returns if the collection is in focus or not |
|
92 */ |
|
93 TBool IsFocused() const; |
|
94 |
|
95 /** |
|
96 * Updates the focus value of the collection to true or false |
|
97 * @param aFoucs :True : updates the collection is in focus |
|
98 * :False : updates the collection is not in focus |
|
99 * |
|
100 */ |
|
101 void SetFocus(TBool aFocus ); |
|
102 |
|
103 //To check if the matrix menu is in foreground or not |
|
104 TBool IsMatrixMenuInForegroundL(); |
|
105 |
|
106 /* To register for Liw notifications |
|
107 */ |
|
108 void GetInterfaceForNotificationL(); |
|
109 void RequestCpsNotificationL(TInt aSuiteItem); |
|
110 void SetupPublisherL(TInt aSuiteItem); |
|
111 void HandleStateChangeL(TInt aSuiteItem); |
|
112 |
|
113 /* Virtual APi which will be implemented in child classes |
|
114 * Basically gives info if the item in suite has gained focus |
|
115 * or lost it |
|
116 */ |
|
117 virtual void ActivateL(TBool aOn) = 0; |
|
118 |
|
119 /* |
|
120 * Creates Medialist based on the plugin id |
|
121 */ |
|
122 MGlxMediaList* CreateMedialistAndThumbnailContextL(const TGlxMediaId& aPluginId, |
|
123 CGlxThumbnailContext* aThumbnailContext) const; |
|
124 |
|
125 /** |
|
126 * Method to fill input list for CPS add command |
|
127 */ |
|
128 void FillInputListWithDataL( |
|
129 CLiwGenericParamList* aInParamList, |
|
130 const TDesC& aPublisherId, const TDesC& aContentType, |
|
131 const TDesC& aContentId, TInt aHandle); |
|
132 |
|
133 /* Cleanup medialist cache */ |
|
134 void ContainerCacheCleanupL(MGlxMediaList* aMediaList); |
|
135 |
|
136 /* Set content harvester plugin instance */ |
|
137 void SetCHPlugin(MGlxContentHarvesterPlugin* aCHplugin); |
|
138 |
|
139 /* Get content harvester plugin instance */ |
|
140 MGlxContentHarvesterPlugin* GetCHPlugin(); |
|
141 |
|
142 private: // data |
|
143 |
|
144 /** |
|
145 * Instance of CPS interface used for update with CPS. |
|
146 */ |
|
147 TSize iGridIconSize; |
|
148 CLiwServiceHandler* iServiceHandler; |
|
149 CLiwGenericParamList* iInParamList; |
|
150 CLiwGenericParamList* iOutParamList; |
|
151 |
|
152 MLiwInterface* iCPSNotificationInterface; |
|
153 TGlxSequentialIterator iThumbnailIterator; |
|
154 |
|
155 // Instance of content harvester plugin |
|
156 MGlxContentHarvesterPlugin* iCHplugin; |
|
157 |
|
158 //This variable holds the value ,whether the collection is in focus or not |
|
159 TBool iIsFocused; |
|
160 |
|
161 //This variable is initialised with the default bitmap. |
|
162 CFbsBitmap* iBitmap; |
|
163 }; |
|
164 #endif /*GLXCONTENTHARVESTERPLUGINBASE_H*/ |