1 /* Copyright (c) 2004-2005 Nokia. All rights reserved. */
3 /* The PerlApp application is licensed under the same terms as Perl itself. */
10 # include <aknappui.h>
12 #endif /* #ifdef __SERIES60__ */
16 # include <eikappui.h>
18 # include <eikbctrl.h>
20 #endif /* #ifdef __SERIES60__ */
25 /* The source code can be compiled into "PerlApp" which is the simple
26 * launchpad application/demonstrator, or into "PerlMin", which is the
27 * minimal Perl launchpad application. Define the cpp symbols
28 * PerlMin (a boolean), PerlMinUid (the Symbian application uid in
29 * the 0x... format), and PerlMinName (a C wide string, with the L prefix)
30 * to compile as "PerlMin". */
36 # define PerlMinUid 0x102015F6
37 # define PerlMinName L"PerlMin"
42 # error PerlMin defined but PerlMinUid undefined
45 # error PerlMin defined but PerlMinName undefined
50 # define CMyDocument CAknDocument
51 # define CMyApplication CAknApplication
52 # define CMyAppUi CAknAppUi
53 # define CMyNoteDialog CAknNoteDialog
54 # define CMyAppView CCoeControl
55 #endif /* #ifdef __SERIES60__ */
58 # define CMyDocument CEikDocument
59 # define CMyApplication CEikApplication
60 # define CMyAppUi CEikAppUi
61 # define CMyNoteDialog CCknFlashingDialog
62 # define CMyAppView CEikBorderedControl
63 #endif /* #ifdef __SERIES60__ */
65 class CPerlAppDocument : public CMyDocument
68 CPerlAppDocument(CEikApplication& aApp):CMyDocument(aApp) {;}
70 CFileStore* OpenFileL(TBool aDoOpen, const TDesC& aFilename, RFs& aFs);
71 #endif // #ifndef PerlMin
72 private: // from CEikDocument
73 CEikAppUi* CreateAppUiL();
76 class CPerlAppApplication : public CMyApplication
79 CApaDocument* CreateDocumentL();
80 TUid AppDllUid() const;
83 const TUint KPerlAppPromptSize = 20;
84 const TUint KPerlAppOneLinerSize = 128;
88 class CPerlAppUi : public CMyAppUi
93 TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName& aDocumentName, const TDesC8& aTail);
94 void HandleCommandL(TInt aCommand);
96 void OpenFileL(const TDesC& aFileName);
97 void InstallOrRunL(const TFileName& aFileName);
98 void SetFs(const RFs& aFs);
99 #endif // #ifndef PerlMin
100 TBuf<KPerlAppOneLinerSize> iOneLiner; // Perl source code to evaluate.
101 CPerlAppView* iAppView;
106 class CPerlAppView : public CMyAppView
109 static CPerlAppView* NewL(const TRect& aRect);
110 static CPerlAppView* NewLC(const TRect& aRect);
112 void Draw(const TRect& aRect) const;
114 void HandleCommandL(TInt aCommand);
115 #endif /* #ifdef __SERIES80__ */
117 void ConstructL(const TRect& aRect);
120 #endif // __PerlApp_h__