|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-BE65B3A7-04E8-5406-B46A-09E2608E0F1F" xml:lang="en"><title>Requesting |
|
13 Log Engine Notifications </title><shortdesc>This tutorial describes how to request notification from Log Engine. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
14 <context id="GUID-026E70FC-4181-56D2-810A-F9D70BE9A2E7"><p>The Log Engine |
|
15 records events so that other applications can react to them in ways which |
|
16 are not part of its own specification. A typical reaction to an event might |
|
17 be refreshing the screen of the device or causing it to beep, but that is |
|
18 not Log Engine functionality. The Log Engine notifies other applications of |
|
19 a change to its database. It provides two interfaces which you implement to |
|
20 set up notification of changes: </p> <ul> |
|
21 <li id="GUID-7CE07F32-E2D1-5E2B-A491-4B3DC5CC5F31"><p> <xref href="GUID-37519930-C95E-3FF1-A32D-D42D0A9E710F.dita"><apiname>MLogClientChangeObserver</apiname></xref> </p> </li> |
|
22 <li id="GUID-5D5CFA78-7B04-56CD-B919-D0703F1696EF"><p> <xref href="GUID-7DE036FC-7ECE-38FE-8BC0-7B0CA2B3B195.dita"><apiname>MLogViewChangeObserver</apiname></xref> </p> </li> |
|
23 </ul> </context> |
|
24 <steps id="GUID-5E3B8D4C-C912-5E74-8744-44FE6427754F"> |
|
25 <step id="GUID-81E579ED-7379-5ED9-AAD8-F49A0AE50F06"><cmd>Implement <xref href="GUID-37519930-C95E-3FF1-A32D-D42D0A9E710F.dita"><apiname>MLogClientChangeObserver</apiname></xref> </cmd> |
|
26 <info> <xref href="GUID-37519930-C95E-3FF1-A32D-D42D0A9E710F.dita"><apiname>MLogClientChangeObserver</apiname></xref> concerns changes which |
|
27 are global to the database and it has a single member function to be implemented: </info> |
|
28 <substeps id="GUID-E55DB2B7-A71E-4EB6-8A69-4F4BB5EABE9B"> |
|
29 <substep id="GUID-E509EE1B-92F6-4C45-BFC6-8370BA3FE4AA"><cmd>Implement <xref href="GUID-539F45CB-1182-38EE-A15C-BCD9093AC24F.dita"><apiname>HandleLogClientChangeEventL</apiname></xref> of <xref href="GUID-37519930-C95E-3FF1-A32D-D42D0A9E710F.dita"><apiname>MLogClientChangeObserver</apiname></xref></cmd> |
|
30 <info>Its arguments are: </info> |
|
31 <info><ul> |
|
32 <li id="GUID-393080A5-BAF1-5461-AF2A-46F413C56383"><p> <xref href="GUID-530281E6-29FC-33F2-BC9B-610FBA389444.dita"><apiname>TUid</apiname></xref> aChangeType |
|
33 the UID of the type of event which occurred </p> </li> |
|
34 <li id="GUID-73B0B616-C029-52EF-AF31-53996B639051"><p> <xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aChangeParameter1 </p> </li> |
|
35 <li id="GUID-34CF35D8-6078-587B-A8C1-00337F5C3C31"><p> <xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aChangeParameter2 </p> </li> |
|
36 <li id="GUID-800AC30F-DF6F-55CF-9455-D49C25F253D0"><p> <xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aChangeParameter3 </p> </li> |
|
37 </ul></info> |
|
38 <info>The last three arguments are context-specific: their meaning is specific |
|
39 to the type of event that occurred. </info> |
|
40 </substep> |
|
41 </substeps> |
|
42 </step> |
|
43 <step id="GUID-75C55B15-FA43-5E6D-9967-6B6086BCA32B"><cmd/> |
|
44 <info>Implement <xref href="GUID-7DE036FC-7ECE-38FE-8BC0-7B0CA2B3B195.dita"><apiname>MLogViewChangeObserver</apiname></xref> </info> |
|
45 <info> <xref href="GUID-7DE036FC-7ECE-38FE-8BC0-7B0CA2B3B195.dita"><apiname>MLogViewChangeObserver</apiname></xref> concerns changes which are |
|
46 specific to a database view and it has three member functions to be implemented: </info> |
|
47 <substeps id="GUID-5645F222-5B4C-4B28-8AC2-F28256821883"> |
|
48 <substep id="GUID-DB5501DF-E345-426E-B13D-5B3CEF840A28"><cmd/> |
|
49 <info><xref href="GUID-A41FB471-60EC-3786-8CCC-BD35048ED38A.dita"><apiname>HandleLogViewChangeEventAddedL</apiname></xref></info> |
|
50 </substep> |
|
51 <substep id="GUID-D68B3B48-8D28-4086-B5FE-B22D622A741C"><cmd/> |
|
52 <info><xref href="GUID-D799F87B-C0CE-3129-A526-A3B06469B328.dita"><apiname>HandleLogViewChangeEventChangedL</apiname></xref></info> |
|
53 </substep> |
|
54 <substep id="GUID-0698E95C-F370-49B5-B43E-176BF5C5F713"><cmd/> |
|
55 <info><xref href="GUID-6C1A90CC-BA78-3B37-A39C-DC6D1F714654.dita"><apiname>HandleLogViewChangeEventDeletedL</apiname></xref></info> |
|
56 </substep> |
|
57 </substeps> |
|
58 <info>Each of them has the same arguments: </info> |
|
59 <substeps id="GUID-368850E6-5B7F-4ADB-99ED-F1843BE1340C"> |
|
60 <substep id="GUID-649209D5-146A-445B-B7FF-E67F061148B8"><cmd/> |
|
61 <info><xref href="GUID-271367A8-DD4F-3A82-AD88-F3E94F2AA980.dita"><apiname>TLogId</apiname></xref> aId </info> |
|
62 </substep> |
|
63 <substep id="GUID-982974D3-2D00-40EB-9A32-1F7588390CAA"><cmd/> |
|
64 <info><xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aViewIndex</info> |
|
65 </substep> |
|
66 <substep id="GUID-46F2D7CB-5016-4F08-94DA-12BFFDDD535F"><cmd/> |
|
67 <info><xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aChangeIndex </info> |
|
68 </substep> |
|
69 <substep id="GUID-DF50A88D-DE13-4693-9376-CF6143D8FC7C"><cmd/> |
|
70 <info><xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> aTotalChangeCount</info> |
|
71 </substep> |
|
72 </substeps> |
|
73 </step> |
|
74 </steps> |
|
75 <postreq><p>A change to a view typically occurs as part of a sequence of changes, |
|
76 and the position of the change event record in the view typically reflects |
|
77 this |
|
78 fact. |
|
79 </p><p>The argument <codeph>aId</codeph> is the Id of the log event in the database. |
|
80 The argument <codeph>aViewIndex</codeph> is the position in the view |
|
81 where the event record was added, changed or deleted. The argument |
|
82 <codeph>aChangeIndex</codeph> is the index of the event in the sequence of |
|
83 changes. The argument <codeph>aTotalChangeCount</codeph> is the total number |
|
84 of events in the sequence of changes |
|
85 </p></postreq> |
|
86 </taskbody><related-links> |
|
87 <link href="GUID-E4A950EA-5671-5755-B3EF-5D6B90E19AE6.dita"><linktext>Maintaining |
|
88 Log Events</linktext></link> |
|
89 <link href="GUID-2022F702-9899-5798-8932-D70119C7177D.dita"><linktext>Setting Up |
|
90 A Log Engine Client</linktext></link> |
|
91 <link href="GUID-55ECBCF5-FC29-5A4A-A3C6-1CB1C0D562CE.dita"><linktext>Displaying |
|
92 Log Events</linktext></link> |
|
93 <link href="GUID-BCB0E50F-B22E-5964-BB68-BEE1870D9C79.dita"><linktext>Configuring |
|
94 Log Engine </linktext></link> |
|
95 </related-links></task> |