creator/inc/creator_scriptentry.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2008 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 #ifndef __FILEUTILS_H__
       
    22 #define __FILEUTILS_H__
       
    23 
       
    24 
       
    25 #include "creator_model.h"
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <f32file.h>
       
    29 #include <badesca.h>
       
    30 #include <AknGlobalNote.h>
       
    31 #include <AknIconArray.h> 
       
    32 #include <aknmemorycardui.mbg>
       
    33 #include <msvapi.h>
       
    34 
       
    35 
       
    36 class CCreatorEngine;
       
    37 
       
    38 class CreatorFileUtils
       
    39 {
       
    40 public:
       
    41     static TInt FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
       
    42     static TInt FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
       
    43 };
       
    44 
       
    45 class CCommandParser : public CBase, public MMsvSessionObserver
       
    46     {
       
    47 public:
       
    48     static CCommandParser* NewL(CCreatorEngine* aEngine);
       
    49     static CCommandParser* NewLC(CCreatorEngine* aEngine);
       
    50     ~CCommandParser();
       
    51     
       
    52     void StrParserL(HBufC*& aDestinationBuf, TUint aToken);
       
    53     void StrParserL(HBufC8*& aDestinationBuf, TUint aToken);
       
    54 
       
    55 private:
       
    56     CCommandParser();
       
    57     void ConstructL(CCreatorEngine* aEngine);
       
    58 
       
    59     TInt FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
       
    60     TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
       
    61     TInt ReadLineFromFileL(RFile& aInputFile);    
       
    62     //void ParseCommandFromDescriptorL();
       
    63 
       
    64     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
       
    65 
       
    66 public:
       
    67     void OpenScriptL();
       
    68     TBool OpenScriptL(RFile& aScriptFile);
       
    69     TBool GetRandomDataFilenameL(TDes& aFilename);
       
    70 
       
    71 private:
       
    72     CCreatorEngine* iEngine;
       
    73     CDesCArrayFlat* iSearchArray;
       
    74 
       
    75     TInt iParserPosition;
       
    76     TInt iParserOldPosition;
       
    77 
       
    78     HBufC8* iReadBuf;
       
    79 
       
    80     };
       
    81 
       
    82 
       
    83 
       
    84 #endif // __FILEUTILS_H__
       
    85