creator/engine/inc/creator_scriptentry.h
changeset 55 2d9cac8919d3
parent 53 819e59dfc032
child 56 392f7045e621
equal deleted inserted replaced
53:819e59dfc032 55:2d9cac8919d3
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __FILEUTILS_H__
       
    23 #define __FILEUTILS_H__
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 #include <badesca.h>
       
    29 #include <AknGlobalNote.h>
       
    30 #include <AknIconArray.h> 
       
    31 #include <aknmemorycardui.mbg>
       
    32 #include <msvapi.h>
       
    33 
       
    34 
       
    35 class CCreatorEngine;
       
    36 
       
    37 class CreatorFileUtils
       
    38 {
       
    39 public:
       
    40     static TInt FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
       
    41     static TInt FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
       
    42 };
       
    43 
       
    44 class CCommandParser : public CBase, public MMsvSessionObserver, MUIObserver
       
    45     {
       
    46 enum TCommandParserStatus{
       
    47     EGetingScript,
       
    48     EGetingRandomDataFile
       
    49 };
       
    50 
       
    51 public:
       
    52     static CCommandParser* NewL(CCreatorEngine* aEngine);
       
    53     static CCommandParser* NewLC(CCreatorEngine* aEngine);
       
    54     ~CCommandParser();
       
    55     
       
    56     void StrParserL(HBufC*& aDestinationBuf, TUint aToken);
       
    57     void StrParserL(HBufC8*& aDestinationBuf, TUint aToken);
       
    58 
       
    59 private:
       
    60     CCommandParser();
       
    61     void ConstructL(CCreatorEngine* aEngine);
       
    62 
       
    63     TInt FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
       
    64     TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
       
    65     TInt ReadLineFromFileL(RFile& aInputFile);    
       
    66     //void ParseCommandFromDescriptorL();
       
    67 
       
    68     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
       
    69 
       
    70 public:
       
    71     /**
       
    72      * Called when some dialog in UI is closed
       
    73      *
       
    74      * @since S60 10.1
       
    75      * @param aPositiveAction ETrue if "Ok", "Yes" or other "positive" button was pressed
       
    76      * @param aUserData number that was passed to UI before dialog was opened
       
    77      * @return None.
       
    78      */
       
    79     virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);
       
    80     
       
    81 public:
       
    82     void OpenScriptL();
       
    83     TBool OpenScriptL(MCommandParserObserver* aObserver);
       
    84     TBool GetRandomDataFilenameL(MCommandParserObserver* aObserver);
       
    85 
       
    86 private:
       
    87     CCreatorEngine* iEngine;
       
    88     CDesCArrayFlat* iSearchArray;
       
    89     TInt iSelectedItem;
       
    90     
       
    91     TInt iParserPosition;
       
    92     TInt iParserOldPosition;
       
    93 
       
    94     HBufC8* iReadBuf;
       
    95 
       
    96     MCommandParserObserver* iObserver;
       
    97     };
       
    98 
       
    99 
       
   100 
       
   101 #endif // __FILEUTILS_H__
       
   102