creator/inc/engine.h
changeset 28 4cc0d1a608c1
parent 27 271e901a9423
child 29 1c71b77fbc93
equal deleted inserted replaced
27:271e901a9423 28:4cc0d1a608c1
   101  */
   101  */
   102 class MCommandParserObserver
   102 class MCommandParserObserver
   103     {
   103     {
   104 public:
   104 public:
   105     /**
   105     /**
   106      * Called when CCommandParser user has choosen some file(script file, random data file)
   106      * Called when CCommandParser user has choosen script file
   107      *
   107      *
   108      * @since S60 10.1
   108      * @since S60 10.1
   109      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
   109      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
   110      * @param aFileName filename chosen by user
   110      * @param aFileName filename chosen by user
   111      * @return None.
   111      * @return None.
   112      */
   112      */
   113     virtual void FileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
   113     virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
   114 
   114 
       
   115     /**
       
   116      * Called when CCommandParser user has choosen random data file
       
   117      *
       
   118      * @since S60 10.1
       
   119      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
       
   120      * @param aFileName filename chosen by user
       
   121      * @return None.
       
   122      */
       
   123     virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
   115     };
   124     };
   116 
   125 
   117 /**
   126 /**
   118  * Device memory information
   127  * Device memory information
   119  */
   128  */
   133 // Common constant for undefined integer value:
   142 // Common constant for undefined integer value:
   134 const TInt KUndef = KErrNotFound;
   143 const TInt KUndef = KErrNotFound;
   135 
   144 
   136 class CCreatorEngine : public CActive, public MUIObserver, public MCommandParserObserver
   145 class CCreatorEngine : public CActive, public MUIObserver, public MCommandParserObserver
   137 	{
   146 	{
       
   147 enum ECreatorEngineState{
       
   148     ECreatorEngineDeleteAllEntries,
       
   149     ECreatorEngineDeleteAllCreatorEntries,
       
   150 };
   138 public:
   151 public:
   139     
   152     
   140     enum TRandomStringType
   153     enum TRandomStringType
   141         {
   154         {
   142         EFirstName = 0,
   155         EFirstName = 0,
   266      */
   279      */
   267     virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);
   280     virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);
   268     
   281     
   269 public: // from MCommandParserObserver
   282 public: // from MCommandParserObserver
   270     /**
   283     /**
   271      * Called when CCommandParser user has choosen some file(script file, random data file)
   284      * Called when CCommandParser user has choosen script file
   272      *
   285      *
   273      * @since S60 10.1
   286      * @since S60 10.1
   274      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
   287      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
   275      * @param aFileName filename chosen by user
   288      * @param aFileName filename chosen by user
   276      * @return None.
   289      * @return None.
   277      */
   290      */
   278     virtual void FileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
   291     virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
       
   292     
       
   293     /**
       
   294      * Called when CCommandParser user has choosen random data file
       
   295      *
       
   296      * @since S60 10.1
       
   297      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
       
   298      * @param aFileName filename chosen by user
       
   299      * @return None.
       
   300      */
       
   301     virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
   279     
   302     
   280 public:
   303 public:
   281     void ExecuteOptionsMenuCommandL(TInt aCommand);
   304     void ExecuteOptionsMenuCommandL(TInt aCommand);
   282     void RunScriptL();
   305     void RunScriptL();
   283     TInt RunScriptL(const TDesC& aScriptFile);
   306     TInt RunScriptL(const TDesC& aScriptFile);
   339     void WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
   362     void WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
   340     void ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
   363     void ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
   341     void WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
   364     void WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
   342     void RemoveStoreL( const TUid aModuleUid );
   365     void RemoveStoreL( const TUid aModuleUid );
   343 	void ProgressDialogCancelledL();
   366 	void ProgressDialogCancelledL();
       
   367 	
       
   368 	void SortCommands();
   344     
   369     
   345 private:
   370 private:
   346     // needed by the engine itself
   371     // needed by the engine itself
   347     RTimer iTimer;
   372     RTimer iTimer;
   348     CEikonEnv* iEnv;
   373     CEikonEnv* iEnv;
   349     //CCreatorAppUi* iAppUi;
   374     //CCreatorAppUi* iAppUi;
   350     TInt iCurrentEntry;
   375     TInt iCurrentEntry;
   351     TInt iEntriesToBeCreated;
       
   352     TInt iFailedCommands;
   376     TInt iFailedCommands;
   353 
   377 
   354     CDesCArrayFlat* iSoundFileArray;
   378     CDesCArrayFlat* iSoundFileArray;
   355     CDesCArrayFlat* iPictureFileArray;
   379     CDesCArrayFlat* iPictureFileArray;
   356     CCommandArray* iCommandArray;
   380     CCommandArray* iCommandArray;