menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditionfactory.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-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 #ifndef C_HNCONDITIONFACTORY_H
       
    21 #define C_HNCONDITIONFACTORY_H
       
    22 
       
    23 #include <e32def.h>
       
    24 #include <e32base.h>
       
    25 #include <e32hashtab.h>
       
    26 #include <xmlengelement.h> 
       
    27 
       
    28 class CHnConditionInterface;
       
    29 
       
    30 /**
       
    31  * Condition factory.
       
    32  * 
       
    33  * The purpose of this class is the creation of different types of the condition objects.
       
    34  *  
       
    35  * @lib hnmetadatamodel
       
    36  * @since S60 v3.2
       
    37  * @ingroup group_hnmetadatamodel
       
    38  */
       
    39 NONSHARABLE_CLASS(HnConditionFactory)
       
    40     {
       
    41 public:
       
    42    
       
    43     /**
       
    44      * Standard factory function.
       
    45      * 
       
    46      * @param aElement Xml element.
       
    47      * @return Fully constructed object.
       
    48      */
       
    49     static CHnConditionInterface* NewL( TXmlEngAttr aElement );
       
    50 
       
    51     /**
       
    52      * Standard factory function.
       
    53      * 
       
    54      * @param aElement Xml element
       
    55      * @return Fully constructed object.
       
    56      */
       
    57     static CHnConditionInterface* NewLC( TXmlEngAttr aElement );
       
    58     
       
    59     /**
       
    60      * Standard factory function.
       
    61      * 
       
    62      * @param aElement Xml element.
       
    63      * @return Fully constructed object.
       
    64      */
       
    65     static CHnConditionInterface* NewL( TDesC8 & aElement );
       
    66 
       
    67     /**
       
    68      * Standard factory function.
       
    69      * 
       
    70      * @param aElement Xml element.
       
    71      * @return Fully constructed object.
       
    72      */
       
    73     static CHnConditionInterface* NewLC( TDesC8 & aElement );
       
    74     
       
    75 private:
       
    76     
       
    77     /**
       
    78      * Prepares the condition for processng.
       
    79      * Removes excessive white characters and 
       
    80      * superfluous parentheses
       
    81      * 
       
    82      * @param aConditionString Condition string.
       
    83      */
       
    84     static void TrimConditionL( RBuf8 & aConditionString );
       
    85  
       
    86     /**
       
    87      * Check condition's brace integrity.
       
    88      * 
       
    89      * @param aConditionString Condition string.
       
    90      * @return Error code. 
       
    91      */
       
    92     static TInt CheckBraceIntegrityL( TDesC8 & aConditionString );
       
    93     
       
    94     /**
       
    95      * Constructs condition appropriate to its properties.
       
    96      * 
       
    97      * @param aConditionString Condition string.
       
    98      * @return A pointer to the condition's interface.
       
    99      */
       
   100     static CHnConditionInterface* ConstructConditionL( TDesC8 & aConditionString );
       
   101 
       
   102     };
       
   103 
       
   104 #endif // C_HNCONDITIONFACTORY_H
       
   105