1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __FILENAMESETTINGITEM_H__ |
|
22 #define __FILENAMESETTINGITEM_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <aknsettingitemlist.h> |
|
26 |
|
27 // CONSTANTS |
|
28 _LIT( KCharColon, ":" ); // Illegal character for filename. |
|
29 const TText KCharDot = '.'; // Dot character. |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Custom setting item for filename. Filename validity is checked. |
|
35 */ |
|
36 class CFileNameSettingItem: public CAknTextSettingItem |
|
37 { |
|
38 public: |
|
39 // Constructor and destructor |
|
40 |
|
41 /** |
|
42 * Constructor. |
|
43 * |
|
44 * @param aIdentifier Resource identifier for this setting item. |
|
45 * @param aText Setting text. |
|
46 * @param aIllegalFilenameTextResourceID Resource identifier for |
|
47 * warning note text. |
|
48 * @param aUnsuitableFilenameTextResourceID Resource identifier for |
|
49 * warning note text. |
|
50 */ |
|
51 CFileNameSettingItem( TInt aIdentifier, |
|
52 TDes& aText, |
|
53 TInt aIllegalFilenameTextResourceID, |
|
54 TInt aUnsuitableFilenameTextResourceID ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CFileNameSettingItem(); |
|
60 |
|
61 public: |
|
62 // Functions from base classes |
|
63 |
|
64 /** |
|
65 * From <code>MAknSettingPageObserver</code>, handles events reported |
|
66 * by the setting page. |
|
67 * |
|
68 * @param aSettingPage Notified setting page. |
|
69 * @param aEventType Occured event type. |
|
70 */ |
|
71 void HandleSettingPageEventL( CAknSettingPage* aSettingPage, |
|
72 TAknSettingPageEvent aEventType ); |
|
73 |
|
74 /** |
|
75 * From <code>CAknTextSettingItem</code>, this launches the setting |
|
76 * page for text editing. |
|
77 * |
|
78 * @param aCalledFromMenu Ignored in this and under laying |
|
79 * <code>CAknTextSettingItem</code> class. |
|
80 */ |
|
81 void EditItemL( TBool aCalledFromMenu ); |
|
82 |
|
83 private: |
|
84 // Data |
|
85 |
|
86 /** |
|
87 * The text in editor before editing is started. |
|
88 */ |
|
89 HBufC* iTextBeforeEditing; |
|
90 |
|
91 /** |
|
92 * Indicates whether ok is pressed and the file name is incorrect. |
|
93 */ |
|
94 TBool iInvalidFilenameOked; |
|
95 |
|
96 /** |
|
97 * Resource identifier for illegal file name string. |
|
98 */ |
|
99 TInt iIllegalFilenameTextResourceID; |
|
100 |
|
101 /** |
|
102 * Resource identifier for unsuitable file name string. |
|
103 */ |
|
104 TInt iUnsuitableFilenameTextResourceID; |
|
105 |
|
106 }; |
|
107 #endif // __FILENAMESETTINGITEM_H__ |
|
108 |
|
109 // End of File |
|