|
1 /* |
|
2 * Copyright (c) 2010 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 |
|
19 #ifndef CNOTESPLUGIN_H |
|
20 #define CNOTESPLUGIN_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cindexingplugin.h> |
|
24 #include <calchangecallback.h> |
|
25 #include <calcommon.h> // TCalLocalUid |
|
26 |
|
27 #include <common.h> |
|
28 #include "delayedcallback.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CCalSession; |
|
32 class CCalEntryView; |
|
33 class CCPixIndexer; |
|
34 class CCalInstanceView; |
|
35 class CCalInstance; |
|
36 |
|
37 #define KNotesDllUid 0x2001A9D8 |
|
38 |
|
39 class CNotesPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MCalChangeCallBack2 |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 /* |
|
43 * NewL |
|
44 * @return instance of Notes plugin |
|
45 */ |
|
46 static CNotesPlugin* NewL(); |
|
47 /* |
|
48 * NewLC |
|
49 * @return instance of Notes plugin |
|
50 */ |
|
51 static CNotesPlugin* NewLC(); |
|
52 /* |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CNotesPlugin(); |
|
56 |
|
57 public: // From CIndexingPlugin |
|
58 void StartPluginL(); |
|
59 void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); |
|
60 |
|
61 public: // From MCalChangeCallBack2 |
|
62 |
|
63 void CalChangeNotification( RArray< TCalChangeEntry >& aChangeItems ); |
|
64 |
|
65 public: // From MDelayedCallbackObserver |
|
66 |
|
67 void DelayedCallbackL(TInt aCode); |
|
68 void DelayedError(TInt aError); |
|
69 |
|
70 private: |
|
71 /* |
|
72 * @description Prepares the CPix action to be done. |
|
73 * @param TCalChangeEntry changedEntry details of the modified calendar entry |
|
74 * Leaves in case of errors. |
|
75 */ |
|
76 void HandleNoteChangedEntryL(const TCalChangeEntry& changedEntry); |
|
77 |
|
78 /* |
|
79 * @description Prepares the search document and update the CPix engine |
|
80 * according to the passed aActionType. |
|
81 * @param TCalLocalUid aLocalUid uid of the cal entry |
|
82 * @param TCPixActionType aActionType Add/update/remove option |
|
83 * Leaves in case of errors. |
|
84 */ |
|
85 void CreateNoteEntryL( const TCalLocalUid& aLocalUid, TCPixActionType aActionType ); |
|
86 /* |
|
87 * @description Reads the default start and end times from the config file. |
|
88 * @param TTime& aStartTime Start time for creating calendar views |
|
89 * @param TTime& aEndTime End time for creating calendar views |
|
90 * Leaves in case of errors. |
|
91 */ |
|
92 void InitTimeValuesL( TTime& aStartTime, TTime& aEndTime ); |
|
93 |
|
94 private: // Constructors |
|
95 |
|
96 /** |
|
97 * Default C++ constructor. |
|
98 */ |
|
99 CNotesPlugin(); |
|
100 |
|
101 /** |
|
102 * Symbian 2nd phase constructor. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 private: |
|
107 |
|
108 // The asynchronizer .owned |
|
109 CDelayedCallback* iAsynchronizer; |
|
110 |
|
111 // CPix database .owned |
|
112 CCPixIndexer* iIndexer; |
|
113 |
|
114 // Calendar session .owned |
|
115 CCalSession* iSession; |
|
116 |
|
117 // Calendar entry view to fetch the details of Note entry for given LocalUid .owned |
|
118 CCalEntryView* iEntryView; |
|
119 |
|
120 //Calinstance view to retrive notes .owned |
|
121 CCalInstanceView* iNotesInstanceView; |
|
122 |
|
123 //Array of calinstances of Notes .owned |
|
124 RPointerArray<CCalInstance> iNotesInstanceArray; |
|
125 |
|
126 //Notes count |
|
127 TInt iNoteCount; |
|
128 |
|
129 #ifdef __PERFORMANCE_DATA |
|
130 TTime iStartTime; |
|
131 TTime iCompleteTime; |
|
132 void UpdatePerformaceDataL(); |
|
133 #endif |
|
134 |
|
135 }; |
|
136 |
|
137 #endif // CNOTESPLUGIN_H |