1 /* Copyright (c) 2005 Nokia. All rights reserved. */
3 /* The PerlUi class is licensed under the same terms as Perl itself. */
10 # include <aknappui.h>
12 #endif /* #ifdef __SERIES60__ */
14 #if defined(__SERIES80__) || defined(__SERIES90__)
16 # include <eikappui.h>
18 # include <eikbctrl.h>
20 # include <eikdialg.h>
21 #endif /* #if defined(__SERIES80__) || defined(__SERIES90__) */
24 # include <qikapplication.h>
25 # include <qikappui.h>
26 # include <qikdocument.h>
27 # include <eikdialg.h>
28 #endif /* #ifdef __UIQ____ */
34 # define CgPerlUiDocument CAknDocument
35 # define CgPerlUiApplication CAknApplication
36 # define CgPerlUiAppUi CAknAppUi
37 # define CgPerlUiNoteDialog CAknNoteDialog
38 # define CgPerlUiAppView CCoeControl
39 #endif /* #ifdef __SERIES60__ */
41 #if defined(__SERIES80__) || defined(__SERIES90__)
42 # define CgPerlUiDocument CEikDocument
43 # define CgPerlUiApplication CEikApplication
44 # define CgPerlUiAppUi CEikAppUi
45 # define CgPerlUiNoteDialog CCknFlashingDialog
46 # define CgPerlUiAppView CEikBorderedControl
47 #endif /* #if defined(__SERIES80__) || defined(__SERIES90__) */
50 # define CgPerlUiDocument CEikDocument
51 # define CgPerlUiApplication CQikApplication
52 # define CgPerlUiAppUi CQikAppUi
53 # define CgPerlUiNoteDialog CCknFlashingDialog
54 # define CgPerlUiAppView CCoeControl
55 #endif /* #ifdef __UIQ__ */
57 class CPerlUiApplication : public CgPerlUiApplication
61 const TUint KPerlUiPromptSize = 20;
62 const TUint KPerlUiOneLinerSize = 128;
66 class CPerlUiAppUi : public CgPerlUiAppUi
69 IMPORT_C void ConstructL();
70 void virtual DoHandleCommandL(TInt aCommand) = 0;
71 IMPORT_C void HandleCommandL(TInt aCommand);
72 TBuf<KPerlUiOneLinerSize> iOneLiner; // Perl code to evaluate.
73 CPerlUiAppView* iAppView;
76 class CPerlUiAppView : public CgPerlUiAppView
79 static CPerlUiAppView* NewL(const TRect& aRect);
80 static CPerlUiAppView* NewLC(const TRect& aRect);
82 void Draw(const TRect& aRect) const;
83 #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__)
84 IMPORT_C void HandleCommandL(TInt aCommand, CPerlUiAppUi* aAppUi);
85 #endif /* #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__) */
87 void ConstructL(const TRect& aRect);
90 #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__)
92 class CPerlUiTextQueryDialog : public CEikDialog
95 CPerlUiTextQueryDialog(HBufC*& aBuffer);
96 /* TODO: OfferKeyEventL() so that newline can be seen as 'OK'. */
98 TPtrC iTitle; // used in S80 but not in S60
99 TPtrC iPrompt; // used in S60 and S80
102 void PreLayoutDynInitL();
104 TBool OkToExitL(TInt aKeycode);
107 #endif /* #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__) */
109 class CPerlUi : public CgPerlUiAppUi
112 IMPORT_C static TBool OkCancelDialogL(TDesC& aMessage);
113 IMPORT_C static TBool YesNoDialogL(TDesC& aMessage);
114 IMPORT_C static void InformationNoteL(TDesC& aMessage);
115 IMPORT_C static TInt WarningNoteL(TDesC& aMessage);
116 IMPORT_C static TBool TextQueryDialogL(const TDesC& aTitle, const TDesC& aPrompt, TDes& aData, const TInt aMaxLength);
117 IMPORT_C static TBool FileQueryDialogL(TDes& aFilename);
120 #endif // __PerlUi_h__