This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
g++ stage 1 reached
[perl5.git] / symbian / PerlApp.h
index c76d963..43f61b6 100644 (file)
@@ -5,84 +5,77 @@
 #ifndef __PerlApp_h__
 #define __PerlApp_h__
 
-#include <aknapp.h>
-#include <aknappui.h>
-#include <akndoc.h>
-#include <coecntrl.h>
-#include <f32file.h>
+#include "PerlUi.h"
 
 /* The source code can be compiled into "PerlApp" which is the simple
- * launchpad application/demonstrator, or into "PerlMin", which is the
- * minimal Perl-on-Series-60 application.  Define the cpp symbols
- * PerlMin (a boolean), PerlMinUid (the Symbian application uid in
- * the 0x... format), and PerlMinName (a C wide string, with the L prefix)
- * to compile as "PerlMin". */
+ * launchpad application/demonstrator, or into "PerlAppMinimal", which
+ * is the minimal Perl launchpad application.  Define the cpp symbols
+ * CreatePerlAppMinimal (a boolean), PerlAppMinimalUid (the Symbian
+ * application uid in the 0x... format), and PerlAppMinimalName (a C
+ * wide string, with the L prefix) to compile as "PerlAppMinimal". */
 
-// #define PerlMinSample
+// #define CreatePerlAppMinimal
 
-#ifdef PerlMinSample
-# define PerlMin
-# define PerlMinUid 0x102015F6
-# define PerlMinName L"PerlMin"
+#ifdef CreatePerlAppMinimal
+# define PerlAppMinimal
+# ifndef PerlAppMinimalUid // PerlApp is ...F6, PerlRecog is ...F7
+#  define PerlAppMinimalUid 0x102015F8
+# endif
+# ifndef PerlAppMinimalName
+#  define PerlAppMinimalName L"PerlAppMinimal"
+# endif
 #endif
 
-#ifdef PerlMin
-# ifndef PerlMinUid
-#   error PerlMin defined but PerlMinUid undefined
+#ifdef PerlAppMinimal
+# ifndef PerlAppMinimalUid
+#   error PerlAppMinimal defined but PerlAppMinimalUid undefined
 # endif
-# ifndef PerlMinName
-#  error PerlMin defined but PerlMinName undefined
+# ifndef PerlAppMinimalName
+#  error PerlAppMinimal defined but PerlAppMinimalName undefined
 # endif
 #endif
 
-class CPerlAppDocument : public CAknDocument
+class CPerlAppDocument : public CgPerlUiDocument
 {
   public:
-    CPerlAppDocument(CEikApplication& aApp):CAknDocument(aApp) {;}
-#ifndef PerlMin
+    CPerlAppDocument(CEikApplication& aApp) : CgPerlUiDocument(aApp) {;}
+#ifndef PerlAppMinimal
     CFileStore* OpenFileL(TBool aDoOpen, const TDesC& aFilename, RFs& aFs);
-#endif // #ifndef PerlMin
+#endif // #ifndef PerlAppMinimal
   private: // from CEikDocument
     CEikAppUi* CreateAppUiL();
 };
 
-class CPerlAppApplication : public CAknApplication
+class CPerlAppApplication : public CPerlUiApplication
 {
   private:
     CApaDocument* CreateDocumentL();
     TUid AppDllUid() const;
 };
 
-const TUint KPerlAppOneLinerSize = 80;
-
-class CPerlAppView;
+class CPerlAppAppView;
 
-class CPerlAppUi : public CAknAppUi
+class CPerlAppAppUi : public CPerlUiAppUi
 {
   public:
-    void ConstructL();
-     ~CPerlAppUi();
     TBool ProcessCommandParametersL(TApaCommand aCommand, TFileName& aDocumentName, const TDesC8& aTail);
-    void HandleCommandL(TInt aCommand);
-#ifndef PerlMin
+    void DoHandleCommandL(TInt aCommand);
+#ifndef PerlAppMinimal
     void OpenFileL(const TDesC& aFileName);
     void InstallOrRunL(const TFileName& aFileName);
     void SetFs(const RFs& aFs);
-#endif // #ifndef PerlMin
+#endif // #ifndef PerlAppMinimal
+    ~CPerlAppAppUi();
   private:
-    CPerlAppView* iAppView;
     RFs* iFs;
-    TBuf<KPerlAppOneLinerSize> iOneLiner;
 };
 
-class CPerlAppView : public CCoeControl
+class CPerlAppAppView : public CPerlUiAppView
 {
   public:
-    static CPerlAppView* NewL(const TRect& aRect);
-    static CPerlAppView* NewLC(const TRect& aRect);
-    void Draw(const TRect& aRect) const;
-  private:
-    void ConstructL(const TRect& aRect);
+#if defined(__SERIES80__) || defined(__UIQ__)
+    void HandleCommandL(TInt aCommand);
+#endif /* #if defined(__SERIES80__) || defined(__UIQ__) */
 };
 
 #endif // __PerlApp_h__