|
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: The CNssVASDBEvent encapsulates events occuring on the VAS DB. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TNSSVASDBEVENT_H |
|
20 #define TNSSVASDBEVENT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <nssvasmtag.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 |
|
27 /** |
|
28 * CNssVASDBEvent class encapsulates a VAS DB event. |
|
29 * A VAS DB evnt consists of the type of event and the tag object on which the event occured. |
|
30 * The enumeration above shows the event types. Symbian DBMS event types do not have tag |
|
31 * tag with them (set to NULL). The client is responsible for deleting the event object, |
|
32 * otherwise a memory leak would occur. |
|
33 * @lib NssVASApi.lib |
|
34 * @since 2.8 |
|
35 */ |
|
36 class CNssVASDBEvent: public CBase |
|
37 { |
|
38 public: |
|
39 |
|
40 // ENUMS |
|
41 enum TVASDBEventType |
|
42 { |
|
43 // standard Symbian DBMS event types (from RDBNotifier) |
|
44 // event notification across threads possible, |
|
45 EVASDatabaseEventNull, |
|
46 EVASDatabaseEventDatabaseClose, |
|
47 EVASDatabaseEventDatabaseUnlock, |
|
48 EVASDatabaseEventDatabaseCommit, |
|
49 EVASDatabaseEventDatabaseRollback, |
|
50 EVASDatabaseEventDatabaseRecover, |
|
51 // In addition, following event types are also supported by VAS. |
|
52 // These events are notifieds only within the same thread. The |
|
53 // observers and event originator must be on the same thread. |
|
54 // future releases would allow event noification across threads |
|
55 EVASDatabaseEventTagAdded, |
|
56 EVASDatabaseEventTagChanged, |
|
57 EVASDatabaseEventTagDeleted |
|
58 }; |
|
59 |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * 2Phase Constructor |
|
64 * @param aType - event type, |
|
65 * @param aTag - tag on which the event occured |
|
66 * @return |
|
67 */ |
|
68 static CNssVASDBEvent* NewL(TVASDBEventType& aType, MNssTag *aTag); |
|
69 |
|
70 /** |
|
71 * 2Phase Constructor |
|
72 * @param aType - event type, |
|
73 * @param aTag - tag on which the event occured |
|
74 * @return |
|
75 */ |
|
76 static CNssVASDBEvent* NewLC(TVASDBEventType& aType, MNssTag *aTag); |
|
77 |
|
78 /** |
|
79 * C++ destructor |
|
80 * @param |
|
81 * @return |
|
82 */ |
|
83 ~CNssVASDBEvent(); |
|
84 |
|
85 /** |
|
86 * Get function to determine the type of event |
|
87 * @since 2.0 |
|
88 * @param void |
|
89 * @return Type of event |
|
90 */ |
|
91 IMPORT_C TVASDBEventType Type(); |
|
92 |
|
93 /** |
|
94 * Function to get the tag object on which the event took place. |
|
95 * Deleting the event, deletes the tag associated with it. |
|
96 * @since 2.0 |
|
97 * @param void |
|
98 * @return Pointer to a tag object on which event occured |
|
99 */ |
|
100 IMPORT_C MNssTag* Tag(); |
|
101 |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * C++ constructor. |
|
107 */ |
|
108 CNssVASDBEvent(); |
|
109 |
|
110 /** |
|
111 * EPOC Constructor |
|
112 * @param aType - event type, |
|
113 * @param aTag - tag on which the event occured |
|
114 * @return |
|
115 */ |
|
116 void ConstructL(TVASDBEventType& aType, MNssTag *aTag); |
|
117 |
|
118 // Data |
|
119 TVASDBEventType iType; |
|
120 MNssTag* iTag; // NULL for standard Symbian DBMS events. |
|
121 }; |
|
122 |
|
123 #endif // TVASDBEVENT_H |
|
124 |
|
125 // End of File |