diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditionfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnconditionfactory.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef C_HNCONDITIONFACTORY_H +#define C_HNCONDITIONFACTORY_H + +#include +#include +#include +#include + +class CHnConditionInterface; + +/** + * Condition factory. + * + * The purpose of this class is the creation of different types of the condition objects. + * + * @lib hnmetadatamodel + * @since S60 v3.2 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(HnConditionFactory) + { +public: + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewL( TXmlEngAttr aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element + * @return Fully constructed object. + */ + static CHnConditionInterface* NewLC( TXmlEngAttr aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewL( TDesC8 & aElement ); + + /** + * Standard factory function. + * + * @param aElement Xml element. + * @return Fully constructed object. + */ + static CHnConditionInterface* NewLC( TDesC8 & aElement ); + +private: + + /** + * Prepares the condition for processng. + * Removes excessive white characters and + * superfluous parentheses + * + * @param aConditionString Condition string. + */ + static void TrimConditionL( RBuf8 & aConditionString ); + + /** + * Check condition's brace integrity. + * + * @param aConditionString Condition string. + * @return Error code. + */ + static TInt CheckBraceIntegrityL( TDesC8 & aConditionString ); + + /** + * Constructs condition appropriate to its properties. + * + * @param aConditionString Condition string. + * @return A pointer to the condition's interface. + */ + static CHnConditionInterface* ConstructConditionL( TDesC8 & aConditionString ); + + }; + +#endif // C_HNCONDITIONFACTORY_H +