33
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 "cpprofilemonitor_p.h"
|
|
19 |
#include "cpprofilemonitor.h"
|
41
|
20 |
#include "cpprofilemodel.h"
|
|
21 |
#include <ProEngFactory.h>
|
33
|
22 |
#include <CProfileChangeNotifyHandler.h>
|
|
23 |
|
|
24 |
/*
|
|
25 |
* Construtor
|
|
26 |
*/
|
|
27 |
CpProfileMonitorPrivate::CpProfileMonitorPrivate():
|
|
28 |
mProfileNotifier(0)
|
|
29 |
{
|
|
30 |
|
|
31 |
}
|
|
32 |
|
|
33 |
/*
|
|
34 |
* Desconstructor
|
|
35 |
*/
|
|
36 |
CpProfileMonitorPrivate::~CpProfileMonitorPrivate()
|
|
37 |
{
|
41
|
38 |
delete mProfileModel;
|
33
|
39 |
delete mProfileNotifier;
|
|
40 |
}
|
|
41 |
|
|
42 |
/*
|
|
43 |
* Initializing for the monitoring profile event
|
|
44 |
*/
|
|
45 |
void CpProfileMonitorPrivate::initialize(CpProfileMonitor *parent)
|
|
46 |
{
|
|
47 |
q_ptr = parent;
|
41
|
48 |
mProfileModel = new CpProfileModel();
|
|
49 |
TRAP_IGNORE(mProfileNotifier = ProEngFactory::NewNotifyHandlerL());
|
|
50 |
TRAP_IGNORE(mProfileNotifier->RequestProfileActivationNotificationsL(*this));
|
|
51 |
TRAP_IGNORE(mProfileNotifier->RequestProfileNameArrayNotificationsL(*this));
|
|
52 |
TRAP_IGNORE(mProfileNotifier->RequestProfileNotificationsL(*this, EProfileWrapperGeneralId));
|
|
53 |
TRAP_IGNORE(mProfileNotifier->RequestProfileNotificationsL(*this, EProfileWrapperMeetingId));
|
|
54 |
}
|
|
55 |
|
|
56 |
/*
|
|
57 |
* From MProEngProfileObserver
|
|
58 |
*/
|
|
59 |
void CpProfileMonitorPrivate::HandleProfileModifiedL( TInt aProfileId )
|
|
60 |
{
|
|
61 |
if (aProfileId == mProfileModel->activeProfileId()) {
|
|
62 |
q_ptr->avtiveProfileModified();
|
|
63 |
} else {
|
|
64 |
q_ptr->profileModified(aProfileId);
|
|
65 |
}
|
33
|
66 |
}
|
|
67 |
|
|
68 |
/*
|
41
|
69 |
* From MProEngProfileActivationObserver
|
33
|
70 |
*/
|
41
|
71 |
void CpProfileMonitorPrivate::HandleProfileActivatedL( TInt aProfileId )
|
33
|
72 |
{
|
41
|
73 |
q_ptr->profileActivated( aProfileId );
|
33
|
74 |
}
|
41
|
75 |
|
|
76 |
/*
|
|
77 |
* From MProEngProfileNameArrayObserver
|
|
78 |
*/
|
|
79 |
void CpProfileMonitorPrivate::HandleProfileNameArrayModificationL()
|
|
80 |
{
|
|
81 |
q_ptr->profileNameModified();
|
|
82 |
}
|
|
83 |
|
|
84 |
/*
|
|
85 |
* Stop receiveing notification
|
|
86 |
*/
|
|
87 |
void CpProfileMonitorPrivate::stopMonitoring()
|
|
88 |
{
|
|
89 |
mProfileNotifier->CancelAll();
|
|
90 |
}
|