63
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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: Implement of pen input plugin utils:resource,repository,LafEnv
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <centralrepository.h>
|
|
19 |
|
|
20 |
#include "chinesefindutils.h"
|
|
21 |
|
|
22 |
// ======== MEMBER FUNCTIONS ========
|
|
23 |
|
|
24 |
CFindRepositoryWatcher* CFindRepositoryWatcher::NewL(
|
|
25 |
const TUid aUid,
|
|
26 |
const TUint32 aKey,
|
|
27 |
CCenRepNotifyHandler::TCenRepKeyType aKeyType,
|
|
28 |
TCallBack aCallBack,
|
|
29 |
CRepository* aRepository)
|
|
30 |
{
|
|
31 |
CFindRepositoryWatcher* self = new(ELeave) CFindRepositoryWatcher(aUid, aKey, aCallBack, aRepository);
|
|
32 |
|
|
33 |
CleanupStack::PushL(self);
|
|
34 |
self->ConstructL(aKeyType);
|
|
35 |
CleanupStack::Pop(self);
|
|
36 |
|
|
37 |
return self;
|
|
38 |
}
|
|
39 |
|
|
40 |
CFindRepositoryWatcher* CFindRepositoryWatcher::NewL(
|
|
41 |
const TUid aUid,
|
|
42 |
TCallBack aCallBack,
|
|
43 |
CRepository* aRepository)
|
|
44 |
{
|
|
45 |
CFindRepositoryWatcher* self = new(ELeave) CFindRepositoryWatcher(aUid, NCentralRepositoryConstants::KInvalidNotificationId, aCallBack, aRepository);
|
|
46 |
|
|
47 |
CleanupStack::PushL(self);
|
|
48 |
self->ConstructL();
|
|
49 |
CleanupStack::Pop(self);
|
|
50 |
|
|
51 |
return self;
|
|
52 |
}
|
|
53 |
|
|
54 |
CFindRepositoryWatcher::~CFindRepositoryWatcher()
|
|
55 |
{
|
|
56 |
if (iNotifyHandler)
|
|
57 |
{
|
|
58 |
iNotifyHandler->StopListening();
|
|
59 |
delete iNotifyHandler;
|
|
60 |
}
|
|
61 |
}
|
|
62 |
|
|
63 |
CFindRepositoryWatcher::CFindRepositoryWatcher(
|
|
64 |
const TUid aUid,
|
|
65 |
const TUint32 aKey,
|
|
66 |
TCallBack aCallBack,
|
|
67 |
CRepository* aRepository)
|
|
68 |
:
|
|
69 |
iUid(aUid),
|
|
70 |
iKey(aKey),
|
|
71 |
iChangedKey(NCentralRepositoryConstants::KInvalidNotificationId),
|
|
72 |
iCallBack(aCallBack),
|
|
73 |
iRepository(aRepository)
|
|
74 |
{
|
|
75 |
}
|
|
76 |
|
|
77 |
void CFindRepositoryWatcher::ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType)
|
|
78 |
{
|
|
79 |
iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository, aKeyType, iKey);
|
|
80 |
iNotifyHandler->StartListeningL();
|
|
81 |
}
|
|
82 |
|
|
83 |
void CFindRepositoryWatcher::ConstructL()
|
|
84 |
{
|
|
85 |
iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository);
|
|
86 |
iNotifyHandler->StartListeningL();
|
|
87 |
}
|
|
88 |
|
|
89 |
TUint32 CFindRepositoryWatcher::ChangedKey()
|
|
90 |
{
|
|
91 |
return iChangedKey;
|
|
92 |
}
|
|
93 |
|
|
94 |
void CFindRepositoryWatcher::HandleNotifyInt(TUint32 aKey, TInt /*aNewValue*/)
|
|
95 |
{
|
|
96 |
iChangedKey = aKey;
|
|
97 |
iCallBack.CallBack();
|
|
98 |
iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId;
|
|
99 |
}
|
|
100 |
|
|
101 |
void CFindRepositoryWatcher::HandleNotifyError(TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/)
|
|
102 |
{
|
|
103 |
}
|
|
104 |
|
|
105 |
void CFindRepositoryWatcher::HandleNotifyGeneric(TUint32 aId)
|
|
106 |
{
|
|
107 |
iChangedKey = aId;
|
|
108 |
iCallBack.CallBack();
|
|
109 |
iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId;
|
|
110 |
}
|
|
111 |
|
|
112 |
// End Of File
|