|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: Encapsulates a edit folder dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FEEDS_EDIT_FOLDER_DIALOG_H |
|
20 #define FEEDS_EDIT_FOLDER_DIALOG_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <aknform.h> |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // MACROS |
|
29 |
|
30 // DATA TYPES |
|
31 |
|
32 // FUNCTION PROTOTYPES |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CAknViewAppUi; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 |
|
40 /** |
|
41 * The observer interface for the edit folder dialog. |
|
42 * @lib FeedsEngine.lib |
|
43 * @since 3.0 |
|
44 */ |
|
45 class MFeedsEditFolderDialogObserver |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Called when a folder's name is changed -- this is called |
|
50 * after IsValidFolderName is called. |
|
51 * |
|
52 * @since 3.0 |
|
53 * @param aName The folder's new name. |
|
54 * @return void. |
|
55 */ |
|
56 virtual void UpdateFolderL(const TDesC& aName) = 0; |
|
57 |
|
58 /** |
|
59 * Called when a new folder is created -- this is called |
|
60 * after IsValidFolderName is called. |
|
61 * |
|
62 * @since 3.0 |
|
63 * @param aName The folder's new name. |
|
64 * @return void. |
|
65 */ |
|
66 virtual void NewFolderL(const TDesC& aName) = 0; |
|
67 |
|
68 /** |
|
69 * Validates the folder's updated name. |
|
70 * |
|
71 * @since 3.0 |
|
72 * @param aName The folder's new name. |
|
73 * @param aIsEditing True if the edit dialog was opened to edit a folder. |
|
74 * @return ETrue if the value is valid. |
|
75 */ |
|
76 virtual TBool IsFolderNameValidL(const TDesC* aName, TBool aIsEditing) = 0; |
|
77 }; |
|
78 |
|
79 |
|
80 /** |
|
81 * Encapsulates a edit folder dialog. |
|
82 * @lib FeedsEngine.lib |
|
83 * @since 3.0 |
|
84 */ |
|
85 class CFeedsEditFolderDialog: public CAknForm |
|
86 { |
|
87 public: |
|
88 /** |
|
89 * Two-phased constructor. |
|
90 */ |
|
91 static CFeedsEditFolderDialog* NewL(MFeedsEditFolderDialogObserver& aObserver, |
|
92 CAknViewAppUi* aAppUi, |
|
93 const TDesC& aName); |
|
94 |
|
95 /** |
|
96 * Two-phased constructor. |
|
97 */ |
|
98 static CFeedsEditFolderDialog* NewL(MFeedsEditFolderDialogObserver& aObserver, |
|
99 CAknViewAppUi* aAppUi); |
|
100 |
|
101 /** |
|
102 * Destructor. |
|
103 */ |
|
104 virtual ~CFeedsEditFolderDialog(); |
|
105 |
|
106 |
|
107 public: // From CAknForm |
|
108 /** |
|
109 * Called to setup the options menu with the dialog is active. |
|
110 * |
|
111 * @since ? |
|
112 * @param aResourceId The resource id of the menu. |
|
113 * @param aMenuPane The menu. |
|
114 * @return void. |
|
115 */ |
|
116 virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
117 |
|
118 /** |
|
119 * Called by the framework whenver the 'Save' menu item is selected. |
|
120 * |
|
121 * @since ? |
|
122 * @return ETrue if the form data has been saved, otherwise EFalse. |
|
123 */ |
|
124 virtual TBool SaveFormDataL(); |
|
125 |
|
126 /** |
|
127 * Called by the framework before the form is initialised. |
|
128 * |
|
129 * @since ? |
|
130 * @return void. |
|
131 */ |
|
132 virtual void PreLayoutDynInitL(); |
|
133 |
|
134 /** |
|
135 * Called by the framework to process the options menu. |
|
136 * |
|
137 * @since ? |
|
138 * @param aCommandId The command. |
|
139 * @return void. |
|
140 */ |
|
141 virtual void ProcessCommandL(TInt aCommandId); |
|
142 |
|
143 |
|
144 private: // New methods |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CFeedsEditFolderDialog(MFeedsEditFolderDialogObserver& aObserver, |
|
149 CAknViewAppUi* aAppUi, |
|
150 const TDesC& aName); |
|
151 |
|
152 /** |
|
153 * Loads the form data before the form is displayed. |
|
154 * |
|
155 * @since ? |
|
156 * @return ETrue if the form data has been saved, otherwise EFalse. |
|
157 */ |
|
158 void LoadFormValuesFromDataL(); |
|
159 |
|
160 |
|
161 private: |
|
162 MFeedsEditFolderDialogObserver& iObserver; |
|
163 CAknViewAppUi* iAppUi; // not owned |
|
164 TBool iIsNewFolder; |
|
165 TBool iExitDialog; |
|
166 |
|
167 const TDesC& iName; |
|
168 }; |
|
169 |
|
170 #endif // FEEDS_EDIT_FOLDER_DIALOG_H |
|
171 |
|
172 // End of File |