idlefw/plugins/shortcutplugin/inc/aiscutappuidparser.h
branchRCL_3
changeset 9 d0529222e3f0
parent 4 1a2a00e78665
child 10 5ef93ea513cb
child 18 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Shortcut definition parser.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AISCUTAPPUIDPARSER_H
       
    20 #define AISCUTAPPUIDPARSER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CLASS DECLARATIONS
       
    26 
       
    27 /**
       
    28  * Parser class that interpretes the given text as a description of
       
    29  * application position data.
       
    30  */
       
    31 class TAiScutAppUidParser
       
    32 {
       
    33 public: // Construction
       
    34 
       
    35     /**
       
    36      * Standard C++ constructor.
       
    37      * @param aData Data which will be parsed
       
    38      * @param aAppPositions This array will be filled with parsed
       
    39      *                      application positions.
       
    40      */
       
    41     TAiScutAppUidParser(const TDesC& aData, RArray<TUid>& aAppPositions);
       
    42 
       
    43 public: // Interface
       
    44 
       
    45     /**
       
    46      * Parses the data that was given in constructor and fills the
       
    47      * application position array with parsed data.
       
    48      */
       
    49     void ParseL();
       
    50 
       
    51 private: // Implementation
       
    52     /**
       
    53      * Skips the given char.
       
    54      * Skipping can be done conditionally or unconditionally.
       
    55      * If conditional skipping is used, next character in data will be
       
    56      * skipped only if it is the same as given character.
       
    57      * If unconditional skipping is used the next character in data must
       
    58      * be the given character, otherwise the data is invalid and parsing
       
    59      * will be stopped.
       
    60      * @param aChar Character that will be skipped.
       
    61      * @param aConditionalSkip If ETrue, use conditional skipping,
       
    62      *                         otherwise unconditional skipping will be
       
    63      *                         used.
       
    64      */
       
    65     void SkipChar(TChar aChar, TBool aConditionalSkip);
       
    66 
       
    67     /**
       
    68      * Reads app UID from data. If data doesn't contain app UID in the
       
    69      * point in which this function is called, data is considered invalid.
       
    70      * @return App UID that was read from data.
       
    71      */
       
    72     TUid ReadAppUid();
       
    73 
       
    74 private:
       
    75 
       
    76     /// Ref: Application positions array that will be filled when parsing
       
    77     RArray<TUid>&   iUidArray;
       
    78 
       
    79     /// Lexer for data
       
    80     TLex            iLex;
       
    81 
       
    82     /// Is the data that has been read so far valid.
       
    83     TBool           iLexIsValid;
       
    84 };
       
    85 
       
    86 #endif // AISCUTAPPUIDPARSER_H
       
    87 
       
    88 // End of File