|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Dialog used to diplay filename prompt dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAKNCOMMONDIALOGSQUERYDIALOG_H |
|
20 #define CAKNCOMMONDIALOGSQUERYDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknQueryDialog.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MAknFileSelectionObserver; |
|
27 class CCoeEnv; |
|
28 |
|
29 // CLASS DEFINITION |
|
30 /** |
|
31 * A class derived from CAknTextQueryDialog in order to catch and report events. |
|
32 * |
|
33 * @lib CommonDialogs.lib |
|
34 * @since 1.2 |
|
35 */ |
|
36 NONSHARABLE_CLASS(CAknCommonDialogsQueryDialog) : public CAknTextQueryDialog |
|
37 { |
|
38 public: // Constructors and destructors |
|
39 |
|
40 /** |
|
41 * Default constructor. |
|
42 * @param aObserver An observer which is asked, if set, to verify the filename that user types. |
|
43 * @param aPath Path where the filename is saved. If aPath is empty on |
|
44 * return of RunLD(), it means that user cancelled a query |
|
45 * launched by this dialog. |
|
46 * @param aDataText Default text for dialog. User's input is stored to this. |
|
47 * @param aExtension File extension of the filename. This is not shown to user. |
|
48 * @param aCoeEnv Pointer to control environment. |
|
49 */ |
|
50 CAknCommonDialogsQueryDialog( |
|
51 MAknFileSelectionObserver* aObserver, |
|
52 const TDesC& aPath, |
|
53 TDes& aDataText, |
|
54 const TDesC& aExtension, |
|
55 CCoeEnv* aCoeEnv ); |
|
56 |
|
57 ~CAknCommonDialogsQueryDialog(); |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Checks if a filename is valid and that it does not exist. |
|
63 * If the file already exists, user is asked if the old one is replaced. |
|
64 * @param aPath Target path for the filename. |
|
65 * @param aFileName Name of the file without extension. |
|
66 * @param aExtension Extension for the file. |
|
67 * @param aUserCancelled if user cancelled the query launched inside this |
|
68 * function, this is ETrue on return. |
|
69 * @return Returns ETrue if filename is be allowed or it is renamed |
|
70 * to such that it can be allowed. |
|
71 */ |
|
72 TBool FileNameAllowedL( |
|
73 const TDesC& aPath, |
|
74 const TDesC& aFileName, |
|
75 const TDesC& aExtension, |
|
76 TBool& aUserCancelled ); |
|
77 |
|
78 private: // Functions from base classes |
|
79 |
|
80 /** |
|
81 * From CEikDialog |
|
82 * Derived in order to check whether the selected item can be accepted or not. |
|
83 * Reports an event to the observer. |
|
84 */ |
|
85 TBool OkToExitL( TInt aButtonId ); |
|
86 |
|
87 private: // Data |
|
88 |
|
89 // Ref: Path |
|
90 const TDesC& iPath; |
|
91 |
|
92 // Ref: Extension |
|
93 const TDesC& iExtension; |
|
94 |
|
95 // Ref: Pointer to observer |
|
96 MAknFileSelectionObserver* iObserver; |
|
97 |
|
98 // Ref: Pointer to control environment |
|
99 CCoeEnv* iCoeEnv; |
|
100 }; |
|
101 |
|
102 #endif // CAKNCOMMONDIALOGSQUERYDIALOG_H |
|
103 |
|
104 // End of File |