|
1 /* |
|
2 * Copyright (c) 2002 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 * Defines abstract interface for Logs model. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __MLogsModel_H_ |
|
21 #define __MLogsModel_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 #include "LogsEng.hrh" |
|
27 // MACROS |
|
28 |
|
29 // DATA TYPES |
|
30 |
|
31 // FUNCTION PROTOTYPES |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 |
|
35 // CLASS DECLARATION |
|
36 class MLogsObserver; |
|
37 class MLogsEventGetter; |
|
38 class MLogsReaderConfig; |
|
39 /** |
|
40 * Defines abstract interface for Logs model |
|
41 */ |
|
42 class MLogsModel |
|
43 { |
|
44 public: |
|
45 |
|
46 enum TClearMissedCalls |
|
47 { |
|
48 ENormalOperation, |
|
49 ESkipClearing |
|
50 }; |
|
51 |
|
52 enum TDoActivate |
|
53 { |
|
54 EActivateOnly, |
|
55 ERefresh, |
|
56 EResetAndRefresh |
|
57 }; |
|
58 |
|
59 enum TDoDeactivate |
|
60 { |
|
61 EKeepDBConnection, |
|
62 ECloseDBConnection, |
|
63 ECloseDBConnectionAndResetArray, |
|
64 EResetOnlyArray, |
|
65 EResetOnlyArrayWithDirty |
|
66 }; |
|
67 |
|
68 virtual ~MLogsModel() {}; |
|
69 |
|
70 public: |
|
71 |
|
72 /** |
|
73 * Event deletion method |
|
74 * |
|
75 * @param aIndex index array value of the event to be deleted |
|
76 */ |
|
77 virtual void Delete( TInt aIndex ) = 0; |
|
78 |
|
79 /** |
|
80 * Event count method. |
|
81 * |
|
82 * @return count of events in this list. |
|
83 */ |
|
84 virtual TInt Count() = 0; |
|
85 |
|
86 /** |
|
87 * Event get method. |
|
88 * |
|
89 * @param aIndex index array value. |
|
90 * @return |
|
91 */ |
|
92 virtual const MLogsEventGetter* At( TInt aIndex ) = 0; |
|
93 |
|
94 /** |
|
95 * Set UI observer for notifications |
|
96 * |
|
97 * @param aObserver pointer to observer. |
|
98 */ |
|
99 virtual void SetObserver( MLogsObserver* aObserver ) = 0; |
|
100 |
|
101 /** |
|
102 * Activate model. |
|
103 * @param aDoActivate If event array is to be resetted or refreshed or model just activated. |
|
104 */ |
|
105 virtual void DoActivateL( TDoActivate aDoActivate ) = 0; |
|
106 |
|
107 /** |
|
108 * Deactivate model. |
|
109 * @param aClearMissedCalls For missed calls view the clearing of duplicates can be skipped |
|
110 * by setting this to ESkipClearing |
|
111 * @param aDisconnectDb Model disconnects from db if this is set to ETrue |
|
112 */ |
|
113 virtual void DoDeactivate( TClearMissedCalls aClearMissedCalls, |
|
114 TDoDeactivate aDisconnectDb ) = 0; |
|
115 |
|
116 /** |
|
117 * Reset model. Do not delete data from db. |
|
118 */ |
|
119 virtual void Reset() = 0; |
|
120 |
|
121 /** |
|
122 * Configure model |
|
123 * |
|
124 * @param aConfig pointer to configure info |
|
125 */ |
|
126 virtual void ConfigureL( const MLogsReaderConfig* aConfig ) = 0; |
|
127 |
|
128 /** |
|
129 * Start reading. |
|
130 * @param aReset If event array is to be resetted. |
|
131 **/ |
|
132 |
|
133 virtual void KickStartL( TBool aReset ) = 0; |
|
134 |
|
135 }; |
|
136 |
|
137 |
|
138 #endif |
|
139 |
|
140 // End of File __MLogsModel_H_ |