| 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 "PerlUi.h" |
| 9 | |
| 10 | /* The source code can be compiled into "PerlApp" which is the simple |
| 11 | * launchpad application/demonstrator, or into "PerlAppMinimal", which |
| 12 | * is the minimal Perl launchpad application. Define the cpp symbols |
| 13 | * CreatePerlAppMinimal (a boolean), PerlAppMinimalUid (the Symbian |
| 14 | * application uid in the 0x... format), and PerlAppMinimalName (a C |
| 15 | * wide string, with the L prefix) to compile as "PerlAppMinimal". */ |
| 16 | |
| 17 | // #define CreatePerlAppMinimal |
| 18 | |
| 19 | #ifdef CreatePerlAppMinimal |
| 20 | # define PerlAppMinimal |
| 21 | # ifndef PerlAppMinimalUid // PerlApp is ...F6, PerlRecog is ...F7 |
| 22 | # define PerlAppMinimalUid 0x102015F8 |
| 23 | # endif |
| 24 | # ifndef PerlAppMinimalName |
| 25 | # define PerlAppMinimalName L"PerlAppMinimal" |
| 26 | # endif |
| 27 | #endif |
| 28 | |
| 29 | #ifdef PerlAppMinimal |
| 30 | # ifndef PerlAppMinimalUid |
| 31 | # error PerlAppMinimal defined but PerlAppMinimalUid undefined |
| 32 | # endif |
| 33 | # ifndef PerlAppMinimalName |
| 34 | # error PerlAppMinimal defined but PerlAppMinimalName undefined |
| 35 | # endif |
| 36 | #endif |
| 37 | |
| 38 | class CPerlAppDocument : public CgPerlUiDocument |
| 39 | { |
| 40 | public: |
| 41 | CPerlAppDocument(CEikApplication& aApp) : CgPerlUiDocument(aApp) {;} |
| 42 | #ifndef PerlAppMinimal |
| 43 | CFileStore* OpenFileL(TBool aDoOpen, const TDesC& aFilename, RFs& aFs); |
| 44 | #endif // #ifndef PerlAppMinimal |
| 45 | private: // from CEikDocument |
| 46 | CEikAppUi* CreateAppUiL(); |
| 47 | }; |
| 48 | |
| 49 | class CPerlAppApplication : public CPerlUiApplication |
| 50 | { |
| 51 | private: |
| 52 | CApaDocument* CreateDocumentL(); |
| 53 | TUid AppDllUid() const; |
| 54 | }; |
| 55 | |
| 56 | class CPerlAppAppView; |
| 57 | |
| 58 | class CPerlAppAppUi : public CPerlUiAppUi |
| 59 | { |
| 60 | public: |
| 61 | TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName& aDocumentName, const TDesC8& aTail); |
| 62 | void DoHandleCommandL(TInt aCommand); |
| 63 | #ifndef PerlAppMinimal |
| 64 | void OpenFileL(const TDesC& aFileName); |
| 65 | void InstallOrRunL(const TFileName& aFileName); |
| 66 | void SetFs(const RFs& aFs); |
| 67 | #endif // #ifndef PerlAppMinimal |
| 68 | ~CPerlAppAppUi(); |
| 69 | private: |
| 70 | RFs* iFs; |
| 71 | }; |
| 72 | |
| 73 | class CPerlAppAppView : public CPerlUiAppView |
| 74 | { |
| 75 | public: |
| 76 | #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__) |
| 77 | void HandleCommandL(TInt aCommand); |
| 78 | #endif /* #if defined(__SERIES80__) || defined(__SERIES90__) || defined(__UIQ__) */ |
| 79 | }; |
| 80 | |
| 81 | #endif // __PerlApp_h__ |