114
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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: Header file for the CAiProfileEngine class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CAIPROFILEENGINE_H
|
|
20 |
#define CAIPROFILEENGINE_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <badesca.h>
|
|
25 |
#include <ConeResLoader.h>
|
|
26 |
#include <MSSSettingsObserver.h>
|
|
27 |
#include <MProEngActiveProfileObserver.h>
|
|
28 |
#include <MProEngProfileNameArrayObserver.h>
|
|
29 |
#include <MProEngProfileActivationObserver.h>
|
|
30 |
|
|
31 |
// User includes
|
|
32 |
#include "maiprofilepluginnotifier.h"
|
|
33 |
|
|
34 |
// Forward declarations
|
|
35 |
class MProEngEngine;
|
|
36 |
class MProEngNotifyHandler;
|
|
37 |
class MProEngProfileNameArray;
|
|
38 |
|
|
39 |
class RSSSettings;
|
|
40 |
class CAknQueryDialog;
|
|
41 |
|
|
42 |
/**
|
|
43 |
* @ingroup group_profileplugin
|
|
44 |
*
|
|
45 |
* CAiProfileEngine
|
|
46 |
*
|
|
47 |
* @since S60 v3.2
|
|
48 |
*/
|
|
49 |
NONSHARABLE_CLASS( CAiProfileEngine ) : public CBase,
|
|
50 |
public MSSSettingsObserver,
|
|
51 |
public MProEngActiveProfileObserver,
|
|
52 |
public MProEngProfileNameArrayObserver,
|
|
53 |
public MProEngProfileActivationObserver
|
|
54 |
{
|
|
55 |
public:
|
|
56 |
// constructors and destructor
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Part of the two phased constuction
|
|
60 |
*
|
|
61 |
* @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier
|
|
62 |
(the object ordering a notification of the content status change)
|
|
63 |
* @return Pointer to the created CAiProfileEngine object
|
|
64 |
*/
|
|
65 |
static CAiProfileEngine* NewL( MAiProfilePluginNotifier* aProfilePluginNotifier );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Destructor
|
|
69 |
*
|
|
70 |
* @param none
|
|
71 |
* @return none
|
|
72 |
*/
|
|
73 |
~CAiProfileEngine();
|
|
74 |
|
|
75 |
private:
|
|
76 |
// constructors
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Constructor to use in the object creation. Initializes the necessary data.
|
|
80 |
*
|
|
81 |
* @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier
|
|
82 |
(the object ordering a notification of the content status change)
|
|
83 |
* @return none
|
|
84 |
*/
|
|
85 |
CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* 2nd phase constructor
|
|
89 |
*/
|
|
90 |
void ConstructL();
|
|
91 |
|
|
92 |
public:
|
|
93 |
// New functions
|
|
94 |
|
|
95 |
const TDesC& ActiveProfileName() const;
|
|
96 |
|
|
97 |
const TDesC& SwapProfileName() const;
|
|
98 |
|
|
99 |
TInt NumberOfProfiles() const;
|
|
100 |
|
|
101 |
const TDesC& ProfileNameByIndex( TInt aIndex ) const;
|
|
102 |
|
|
103 |
void HandleAiEventL( TInt aEvent, const TDesC& aParam );
|
|
104 |
|
|
105 |
void SetActiveProfileL( const TInt aProfileId );
|
|
106 |
|
|
107 |
TBool IsActiveProfileSilentL() const;
|
|
108 |
|
|
109 |
TBool IsActiveProfileTimedL() const;
|
|
110 |
|
|
111 |
void UpdateProfileNamesL();
|
|
112 |
|
|
113 |
TBool IsOffline() const;
|
|
114 |
|
|
115 |
private:
|
|
116 |
// new functions
|
|
117 |
|
|
118 |
void SetActiveProfileNameL( const TDesC& aName );
|
|
119 |
|
|
120 |
void SetSwapProfileNameL( const TDesC& aName );
|
|
121 |
|
|
122 |
void SetProfileNameListL( const MProEngProfileNameArray& aArray );
|
|
123 |
|
|
124 |
void HandleSwitchByNameL( const TDesC& aParam );
|
|
125 |
|
|
126 |
void HandleSwitchByIndexL( const TDesC& aParam );
|
|
127 |
|
|
128 |
void HandleSwapL( const TDesC& aParam );
|
|
129 |
|
|
130 |
void HandleEditActiveProfileL();
|
|
131 |
|
|
132 |
TBool ShowOfflineMessageL();
|
|
133 |
|
|
134 |
void DetermineTimedAndSilentStatesL();
|
|
135 |
|
|
136 |
void NotifyContentUpdate();
|
|
137 |
|
|
138 |
private:
|
|
139 |
// from MSSSettingsObserver
|
|
140 |
|
|
141 |
/**
|
|
142 |
* @see MSSSettingsObserver
|
|
143 |
*/
|
|
144 |
void PhoneSettingChanged(
|
|
145 |
TSSSettingsSetting aSetting, TInt aNewValue );
|
|
146 |
|
|
147 |
private:
|
|
148 |
// from MProEngActiveProfileObserver
|
|
149 |
|
|
150 |
/**
|
|
151 |
* @see MProEngActiveProfileObserver
|
|
152 |
*/
|
|
153 |
void HandleActiveProfileModifiedL();
|
|
154 |
|
|
155 |
private:
|
|
156 |
// from MProEngProfileNameArrayObserver
|
|
157 |
|
|
158 |
/**
|
|
159 |
* @see MProEngProfileNameArrayObserver
|
|
160 |
*/
|
|
161 |
void HandleProfileNameArrayModificationL();
|
|
162 |
|
|
163 |
private:
|
|
164 |
// from MProEngProfileActivationObserver
|
|
165 |
|
|
166 |
/**
|
|
167 |
* @see MProEngProfileActivationObserver
|
|
168 |
*/
|
|
169 |
void HandleProfileActivatedL( TInt aProfileId );
|
|
170 |
|
|
171 |
private:
|
|
172 |
// data
|
|
173 |
|
|
174 |
/** MAiProfilePluginNotifier interface, not owned */
|
|
175 |
MAiProfilePluginNotifier* iProfilePluginNotifier;
|
|
176 |
/** Client to listen SS setting changes, owned */
|
|
177 |
RSSSettings iSSSettings;
|
|
178 |
/** Profile engine, owned */
|
|
179 |
MProEngEngine* iProfileEngine;
|
|
180 |
/** Profile change notifier, owned */
|
|
181 |
MProEngNotifyHandler* iProfileNotifier;
|
|
182 |
/** Active profile name, owned */
|
|
183 |
HBufC* iActiveProfileName;
|
|
184 |
/** Swap profile name, owned */
|
|
185 |
HBufC* iSwapProfileName;
|
|
186 |
/** Array of Profile Names, owned */
|
|
187 |
RPointerArray< HBufC > iProfileNamePointerArray;
|
|
188 |
/** Resource loader, owned */
|
|
189 |
RConeResourceLoader iResourceLoader;
|
|
190 |
/** Flag to indicate whether active profile is timed */
|
|
191 |
TBool iTimed;
|
|
192 |
/** Flag to indicate whether active profile is silent */
|
|
193 |
TBool iSilent;
|
|
194 |
/** Offline query dialog */
|
|
195 |
CAknQueryDialog* iOfflineQueryDialog;
|
|
196 |
};
|
|
197 |
|
|
198 |
#endif // CAIPROFILEENGINE_H
|
|
199 |
|
|
200 |
// End of file
|