javatools/certificatesconfigurator/src.s60/trustrootpolicy.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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:
       
    15 *
       
    16 */
       
    17 #include <e32base.h>
       
    18 #include <xml/contenthandler.h> // for MContentHandler
       
    19 #include <xml/parser.h> // for CParser
       
    20 #include <f32file.h>
       
    21 #include <string>
       
    22 #include <vector>
       
    23 
       
    24 using namespace Xml;
       
    25 using namespace std;
       
    26 
       
    27 class TrustRoot
       
    28 {
       
    29 public:
       
    30     TrustRoot();
       
    31 
       
    32 public:
       
    33 
       
    34     std::string iName;
       
    35     std::string iDomain;
       
    36     std::string iMcc;
       
    37     std::string iMnc;
       
    38     bool iCanDelete;
       
    39     bool iCanDisable;
       
    40 };
       
    41 
       
    42 class CTrustRootPolicy: public CBase, MContentHandler
       
    43 {
       
    44 
       
    45 public:
       
    46 
       
    47     static CTrustRootPolicy* NewL();
       
    48 
       
    49     virtual ~CTrustRootPolicy();
       
    50 
       
    51 public:
       
    52 
       
    53     void ReadFromFileL(const TDesC& aFileName, vector<TrustRoot>& aTrustRoots);
       
    54 
       
    55 private:
       
    56 
       
    57     CTrustRootPolicy();
       
    58 
       
    59     void ConstructL();
       
    60 
       
    61 private: // from MContentHandler
       
    62 
       
    63     void OnStartDocumentL(const RDocumentParameters &aDocParam, TInt aErrorCode);
       
    64 
       
    65     void OnEndDocumentL(TInt aErrorCode);
       
    66 
       
    67     void OnStartElementL(const RTagInfo &aElement, const RAttributeArray &aAttributes,
       
    68                          TInt aErrorCode);
       
    69 
       
    70     void OnEndElementL(const RTagInfo &aElement, TInt aErrorCode);
       
    71 
       
    72     void OnContentL(const TDesC8 &aBytes, TInt aErrorCode);
       
    73 
       
    74     void OnStartPrefixMappingL(const RString &aPrefix, const RString &aUri,
       
    75                                TInt aErrorCode);
       
    76 
       
    77     void OnEndPrefixMappingL(const RString &aPrefix, TInt aErrorCode);
       
    78 
       
    79     void OnIgnorableWhiteSpaceL(const TDesC8 &aBytes, TInt aErrorCode);
       
    80 
       
    81     void OnSkippedEntityL(const RString &aName, TInt aErrorCode);
       
    82 
       
    83     void OnProcessingInstructionL(const TDesC8 &aTarget, const TDesC8 &aData,
       
    84                                   TInt aErrorCode);
       
    85 
       
    86     void OnError(TInt aErrorCode);
       
    87 
       
    88     TAny *GetExtendedInterface(const TInt32 aUid);
       
    89 
       
    90 private:
       
    91 
       
    92     CParser*             iParser;
       
    93     RFs                  iRfs;
       
    94     vector<TrustRoot>*  iTrustRoots;
       
    95     string               iCurrentContent;
       
    96     TrustRoot           iTrustRoot;
       
    97 };