javatools/javaapppreconverter/src.s60/preconverter.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 - 2009 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: Java platform 2.0 javaapppreconverter process
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef PRECONVERTER_H
       
    20 #define PRECONVERTER_H
       
    21 
       
    22 #include <f32file.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 #include "midletlist.h"
       
    26 
       
    27 /**
       
    28  * The main active object of javaapppreconverter that is executed once
       
    29  * to collect all necessary data of old S60 MIDlets so that they can
       
    30  * be reregistered to AppArc if OMJ is uninstalled.
       
    31  *
       
    32  * This active object is activated from the process main() after the
       
    33  * active scheduler has been created.
       
    34  */
       
    35 class CPreConverter : public CActive
       
    36 {
       
    37     enum TPreConversionState
       
    38     {
       
    39         EConversionDataAlreadyGathered,
       
    40         EFindOutInstalledMidlets,
       
    41         EFillDataFromSystemAmsDb,
       
    42         EStoreData,
       
    43         EStopMidlets,
       
    44         EUnregisterMidlets,
       
    45         EExit
       
    46     };
       
    47 
       
    48 public:
       
    49     static CPreConverter* NewLC(RFs& aFs);
       
    50 
       
    51     void CompleteRequest();
       
    52     ~CPreConverter();
       
    53     void Start();
       
    54 
       
    55 protected:
       
    56     // From CActive
       
    57     void RunL();
       
    58     void DoCancel();
       
    59     TInt RunError(TInt aError);
       
    60 
       
    61 private:
       
    62     void Exit();
       
    63     CPreConverter(RFs& aFs);
       
    64     void ConstructL();
       
    65     void FullCleanup();
       
    66 
       
    67     TDriveNumber ExtractDriveNumberFromPathL(TFileName &aPathName);
       
    68     void ReadMidletsFromAppArcL();
       
    69     void AddDataFromSystemAmsDbL();
       
    70     void RemoveInvalidMidlets();
       
    71     void StoreUidsL();
       
    72     void UnregisterOldJavaAppsL();
       
    73 
       
    74 
       
    75 private:
       
    76     RFs& iFs;
       
    77     CMidletList *iMidlets;
       
    78     TPreConversionState iState;
       
    79 
       
    80 };
       
    81 
       
    82 #endif // PRECONVERTER_H