|
1 /* |
|
2 * Copyright (c) 2004 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 * Implements MMS service and sending settings handler |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MMSSETTINGSHANDLER_H |
|
22 #define MMSSETTINGSHANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32base.h> |
|
27 #include <barsc.h> |
|
28 |
|
29 #include <AknProgressDialog.h> // MProgressDialogCallback |
|
30 |
|
31 #include <mmssettingsdialog.h> |
|
32 #include <mmssettings.h> |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CMmsClientMtm; |
|
38 class CAknWaitDialog; |
|
39 |
|
40 // CLASS DECLARATIONS |
|
41 /** |
|
42 * Class CMmsSettingsHandler |
|
43 * Creates a handler class for handling mms settings. This |
|
44 * class is used from mtmui-classes to get access to mms settings. |
|
45 * |
|
46 * Note: It is expected that the context is set to MMS service |
|
47 * object before calling! |
|
48 * |
|
49 * @since 2.5 |
|
50 */ |
|
51 class CMmsSettingsHandler : public CBase, |
|
52 public MProgressDialogCallback |
|
53 { |
|
54 public: |
|
55 |
|
56 /** |
|
57 * Constructor |
|
58 */ |
|
59 IMPORT_C static CMmsSettingsHandler* NewL( CMmsClientMtm& aMmsClient ); |
|
60 |
|
61 /** |
|
62 * Destructor |
|
63 */ |
|
64 IMPORT_C ~CMmsSettingsHandler(); |
|
65 |
|
66 /** |
|
67 * Checks if ap exists |
|
68 * @param aAp, access point id |
|
69 */ |
|
70 IMPORT_C TBool ApExistsL( TInt32 aAp ); |
|
71 |
|
72 /** |
|
73 * Checks whether or not MMS service settings are OK. Open settings |
|
74 * dialog if not. |
|
75 * @param aExitCode settings dialog exit code |
|
76 * @return are settings ok or not |
|
77 */ |
|
78 IMPORT_C TBool CheckSettingsL( CMmsSettingsDialog::TMmsExitCode& aExitCode ); |
|
79 |
|
80 /** |
|
81 * Creates completed operation after settings dialog closing with |
|
82 * appropriate parameters. |
|
83 * @param aCompletionStatus the operation progress |
|
84 * @param aExitCode settings dialog exit code |
|
85 * @return completed operation |
|
86 */ |
|
87 IMPORT_C CMsvOperation* CompleteSettingsOperationL( |
|
88 TRequestStatus& aCompletionStatus, |
|
89 const CMmsSettingsDialog::TMmsExitCode& aExitCode ); |
|
90 |
|
91 /** |
|
92 * Factory settings initializing function |
|
93 * @param aLevel normal or deep |
|
94 */ |
|
95 IMPORT_C void HandleFactorySettingsL( TDes8& aLevel ); |
|
96 |
|
97 /** |
|
98 * Actual settings dialog launcher |
|
99 * @param aExitCode out: the exit code causing dialog to close |
|
100 */ |
|
101 IMPORT_C void LaunchSettingsDialogL( |
|
102 CMmsSettingsDialog::TMmsExitCode& aExitCode ); |
|
103 |
|
104 /** |
|
105 * Opens settings dialog for the MMS service. |
|
106 * @param aCompletionStatus follows the operation progress |
|
107 * @return started operation |
|
108 */ |
|
109 IMPORT_C CMsvOperation* OpenServiceSettingsDialogL( |
|
110 TRequestStatus& aCompletionStatus ); |
|
111 |
|
112 inline CMmsSettings* MmsSettings(); |
|
113 |
|
114 /** |
|
115 * Reloads the settings from Central Repository |
|
116 */ |
|
117 inline void RefreshSettingsL( ); |
|
118 |
|
119 /** |
|
120 * From MProgressDialogCallback |
|
121 * Wait dialog has died |
|
122 */ |
|
123 void DialogDismissedL( TInt aButtonId ); |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Handles restoring MMS service default values |
|
129 * @param aLevel, level of restore: normal or deep |
|
130 */ |
|
131 void RestoreDefaultSettingsL( TMmsFactorySettingsLevel aLevel ) const; |
|
132 |
|
133 CMmsSettingsHandler( CMmsClientMtm& aMmsClient ); |
|
134 |
|
135 /** |
|
136 * Symbian OS constructor. |
|
137 */ |
|
138 void ConstructL(); |
|
139 |
|
140 private: |
|
141 |
|
142 CMmsClientMtm& iMmsClient; |
|
143 CMmsSettings* iMmsSettings; |
|
144 TInt iResourceOffset; |
|
145 CAknWaitDialog* iWaitDialog; |
|
146 |
|
147 }; |
|
148 |
|
149 inline CMmsSettings* CMmsSettingsHandler::MmsSettings() |
|
150 { |
|
151 return iMmsSettings; |
|
152 } |
|
153 |
|
154 inline void CMmsSettingsHandler::RefreshSettingsL( ) |
|
155 { |
|
156 iMmsSettings->LoadSettingsL( ); |
|
157 } |
|
158 |
|
159 #endif // MMSSETTINGSHANDLER_H |
|
160 |
|
161 // End of File |