|
1 /* |
|
2 * Copyright (c) 2002 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: Static helper methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MAILUTILS_H |
|
20 #define MAILUTILS_H |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 class RFile; |
|
25 /** |
|
26 * Class offers static helper methods. |
|
27 * @since 2.o |
|
28 */ |
|
29 class MailUtils |
|
30 { |
|
31 public: |
|
32 enum TQueryState |
|
33 { |
|
34 EConnectionOffline = KBit0, |
|
35 EQueryAttachmentFetch = KBit1, |
|
36 EQueryForward = KBit2 |
|
37 }; |
|
38 /** |
|
39 * Pops a CAknTextQueryDialog. It will leave with KLeaveWithoutAlert |
|
40 * if the user cancels the query. |
|
41 * @param aQueryResource The query resource ID. |
|
42 * @param aText Reference to a descriptor which will get the input. |
|
43 * @exception Cancelling the query results in a leave. |
|
44 */ |
|
45 IMPORT_C static void TextQueryL(TInt aQueryResource, TDes& aText); |
|
46 |
|
47 /** |
|
48 * A confirmation note is popped. |
|
49 * @param aText The confirmation text. |
|
50 */ |
|
51 IMPORT_C static void ConfirmationNoteL(const TDesC& aText); |
|
52 |
|
53 /** |
|
54 * A confirmation note is popped. |
|
55 * @param aStringResource The string resource id. |
|
56 */ |
|
57 IMPORT_C static void ConfirmationNoteL(TInt aStringResource); |
|
58 |
|
59 /** |
|
60 * An information note is popped. |
|
61 * @param aText The information text. |
|
62 */ |
|
63 IMPORT_C static void InformationNoteL(const TDesC& aText); |
|
64 |
|
65 /** |
|
66 * An information note is popped. |
|
67 * @param aStringResource The string resource id. |
|
68 */ |
|
69 IMPORT_C static void InformationNoteL(TInt aStringResource); |
|
70 |
|
71 /** |
|
72 * Show global error note if message store space is below |
|
73 * critical level. |
|
74 * @return ETrue if space below CL |
|
75 * |
|
76 * !! Deprecated -> to be removed. Leaves with KErrNotSupported !! |
|
77 */ |
|
78 IMPORT_C static TBool ShowNoteIfMsgStoreSpaceLowL(const TInt aSize); |
|
79 |
|
80 /** |
|
81 * Check if off-line profile is active. |
|
82 * @return ETrue if off-line profile is active. |
|
83 */ |
|
84 IMPORT_C static TBool OfflineProfileActiveL(); |
|
85 |
|
86 /** |
|
87 * see CCommonContentPolicy::IsClosedType() |
|
88 */ |
|
89 IMPORT_C static TBool IsClosedMimeL(const TDesC& aMimeType); |
|
90 IMPORT_C static TBool IsClosedMimeL(const TDesC8& aMimeType); |
|
91 IMPORT_C static TBool IsClosedFileL( RFile& aFileHandle ); |
|
92 |
|
93 /** |
|
94 * An Confirmation query. |
|
95 * @param aText The information text. |
|
96 * @param aNoteResource Confirmation note resource |
|
97 */ |
|
98 IMPORT_C static TBool ConfirmationQueryL(const TDesC& aText, |
|
99 TInt aNoteResource); |
|
100 |
|
101 /** |
|
102 * An Confirmation query. |
|
103 * @param aStringResource The string resource id. |
|
104 * @param aNoteResource Confirmation note resource |
|
105 */ |
|
106 IMPORT_C static TBool ConfirmationQueryL(TInt aStringResource, |
|
107 TInt aNoteResource); |
|
108 |
|
109 /** |
|
110 * An Confirmation query is popped with Yes/No options. |
|
111 * @since Series 60 3.0 |
|
112 * @param aSize size of the attachment. |
|
113 * @param aStatus Status flag. see TQueryState |
|
114 * @return ETrue if it is ok to fetch attachment. |
|
115 */ |
|
116 IMPORT_C static TBool LargeAttachmentQueryL(TInt aSize, |
|
117 TInt aStatus); |
|
118 |
|
119 /** |
|
120 * *DEPRECATED* |
|
121 * OfflineProfileActiveWithNoteL. |
|
122 * @since Series 60 3.0 |
|
123 * Leaves KErrNotSupported |
|
124 */ |
|
125 IMPORT_C static TBool OfflineProfileActiveWithNoteL(); |
|
126 |
|
127 /** |
|
128 * An Confirmation query is popped with Yes/No options. |
|
129 * @since Series 60 3.0 |
|
130 * @param aText The information text. |
|
131 */ |
|
132 IMPORT_C static TBool ConfirmationQueryL( const TDesC& aText ); |
|
133 |
|
134 /** |
|
135 * An Confirmation query is popped with Yes/No options. |
|
136 * @since Series 60 3.0 |
|
137 * @param aStringResource The information text resource id. |
|
138 */ |
|
139 IMPORT_C static TBool ConfirmationQueryL( TInt aStringResource ); |
|
140 |
|
141 /** |
|
142 * Resolve file size. |
|
143 * @param aFilename name of the file |
|
144 * @return file size |
|
145 */ |
|
146 IMPORT_C static TInt FileSize( const TDesC& aFilename ); |
|
147 }; |
|
148 |
|
149 #endif // MAILUTILS_H |
|
150 |
|
151 // End of file |