Commit | Line | Data |
27da23d5 |
1 | /* Copyright (c) 2004-2005 Nokia. All rights reserved. */ |
2 | |
3 | /* The PerlApp application is licensed under the same terms as Perl itself. */ |
4 | |
5 | #ifndef __PerlApp_h__ |
6 | #define __PerlApp_h__ |
7 | |
8 | #include <aknapp.h> |
9 | #include <aknappui.h> |
10 | #include <akndoc.h> |
11 | #include <coecntrl.h> |
12 | #include <f32file.h> |
13 | |
f26f4a2f |
14 | /* The source code can be compiled into "PerlApp" which is the simple |
15 | * launchpad application/demonstrator, or into "PerlMin", which is the |
16 | * minimal Perl-on-Series-60 application. Define the cpp symbols |
17 | * PerlMin (a boolean), PerlMinUid (the Symbian application uid in |
18 | * the 0x... format), and PerlMinName (a C wide string, with the L prefix) |
19 | * to compile as "PerlMin". */ |
20 | |
21 | // #define PerlMinSample |
22 | |
23 | #ifdef PerlMinSample |
24 | # define PerlMin |
25 | # define PerlMinUid 0x102015F6 |
26 | # define PerlMinName L"PerlMin" |
27 | #endif |
28 | |
29 | #ifdef PerlMin |
30 | # ifndef PerlMinUid |
31 | # error PerlMin defined but PerlMinUid undefined |
32 | # endif |
33 | # ifndef PerlMinName |
34 | # error PerlMin defined but PerlMinName undefined |
35 | # endif |
36 | #endif |
37 | |
27da23d5 |
38 | class CPerlAppDocument : public CAknDocument |
39 | { |
40 | public: |
41 | CPerlAppDocument(CEikApplication& aApp):CAknDocument(aApp) {;} |
f26f4a2f |
42 | #ifndef PerlMin |
27da23d5 |
43 | CFileStore* OpenFileL(TBool aDoOpen, const TDesC& aFilename, RFs& aFs); |
f26f4a2f |
44 | #endif // #ifndef PerlMin |
27da23d5 |
45 | private: // from CEikDocument |
46 | CEikAppUi* CreateAppUiL(); |
47 | }; |
48 | |
49 | class CPerlAppApplication : public CAknApplication |
50 | { |
51 | private: |
52 | CApaDocument* CreateDocumentL(); |
53 | TUid AppDllUid() const; |
54 | }; |
55 | |
56 | const TUint KPerlAppOneLinerSize = 80; |
57 | |
58 | class CPerlAppView; |
59 | |
60 | class CPerlAppUi : public CAknAppUi |
61 | { |
62 | public: |
63 | void ConstructL(); |
64 | ~CPerlAppUi(); |
f26f4a2f |
65 | TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName& aDocumentName, const TDesC8& aTail); |
27da23d5 |
66 | void HandleCommandL(TInt aCommand); |
f26f4a2f |
67 | #ifndef PerlMin |
27da23d5 |
68 | void OpenFileL(const TDesC& aFileName); |
27da23d5 |
69 | void InstallOrRunL(const TFileName& aFileName); |
70 | void SetFs(const RFs& aFs); |
f26f4a2f |
71 | #endif // #ifndef PerlMin |
27da23d5 |
72 | private: |
73 | CPerlAppView* iAppView; |
74 | RFs* iFs; |
75 | TBuf<KPerlAppOneLinerSize> iOneLiner; |
76 | }; |
77 | |
78 | class CPerlAppView : public CCoeControl |
79 | { |
80 | public: |
81 | static CPerlAppView* NewL(const TRect& aRect); |
82 | static CPerlAppView* NewLC(const TRect& aRect); |
83 | void Draw(const TRect& aRect) const; |
84 | private: |
85 | void ConstructL(const TRect& aRect); |
86 | }; |
87 | |
88 | #endif // __PerlApp_h__ |