|
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 #include <QDebug> |
|
19 #include "caobserver.h" |
|
20 #include "caobjectadapter.h" |
|
21 #include "cainnerentry.h" |
|
22 |
|
23 //---------------------------------------------------------------------------- |
|
24 // |
|
25 //---------------------------------------------------------------------------- |
|
26 CaObserver::CaObserver(QObject *parent) : |
|
27 QObject(parent) |
|
28 { |
|
29 } |
|
30 //---------------------------------------------------------------------------- |
|
31 // |
|
32 //---------------------------------------------------------------------------- |
|
33 CaObserver::~CaObserver() |
|
34 { |
|
35 } |
|
36 |
|
37 //---------------------------------------------------------------------------- |
|
38 // |
|
39 //---------------------------------------------------------------------------- |
|
40 void CaObserver::entryChanged(TInt entryId, |
|
41 TChangeType changeType) const |
|
42 { |
|
43 qDebug() << "CaClientProxy::entryChanged entryId:" |
|
44 << entryId << "changeType:" << changeType; |
|
45 |
|
46 int entryChangedId(entryId); |
|
47 ChangeType entryChangeType(AddChangeType); |
|
48 CaObjectAdapter::convert(changeType, entryChangeType); |
|
49 |
|
50 emit signalEntryChanged(entryChangedId, entryChangeType); |
|
51 } |
|
52 |
|
53 //---------------------------------------------------------------------------- |
|
54 // |
|
55 //---------------------------------------------------------------------------- |
|
56 void CaObserver::entryChanged(const CCaInnerEntry &entry, |
|
57 TChangeType changeType) const |
|
58 { |
|
59 qDebug() << "CaClientProxy::entryChanged changeType:" << changeType; |
|
60 |
|
61 CaEntry *caEntry = new CaEntry(static_cast<EntryRole>(entry.GetRole())); |
|
62 ChangeType entryChangeType(AddChangeType); |
|
63 CaObjectAdapter::convert(entry, *caEntry); |
|
64 CaObjectAdapter::convert(changeType, entryChangeType); |
|
65 |
|
66 |
|
67 emit signalEntryChanged(*caEntry, entryChangeType); |
|
68 } |
|
69 |
|
70 //---------------------------------------------------------------------------- |
|
71 // |
|
72 //---------------------------------------------------------------------------- |
|
73 void CaObserver::entryTouched(TInt id) const |
|
74 { |
|
75 qDebug() << "CaClientProxy::entryTouched id:" << id; |
|
76 emit signalEntryTouched(id); |
|
77 } |
|
78 |
|
79 //---------------------------------------------------------------------------- |
|
80 // |
|
81 //---------------------------------------------------------------------------- |
|
82 void CaObserver::groupContentChanged(TInt groupId) const |
|
83 { |
|
84 qDebug() << "CaClientProxy::groupContentChanged groupId:" << groupId; |
|
85 |
|
86 int groupChangedId(groupId); |
|
87 |
|
88 emit signalGroupContentChanged(groupChangedId); |
|
89 } |
|
90 |