diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/inc/commands/tvtflagcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/inc/commands/tvtflagcontainer.h Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007 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: Flag container class definition. +* +*/ + + +#ifndef T_VTFLAGCONTAINER_H +#define T_VTFLAGCONTAINER_H + +#include + +/** + * TVtFlagContainer + * + * Flag container is a class that holds maximum of 32 different flags. Also + * contains methods for setting, clearing and getting the flag state. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtFlagContainer ) + { +public: + + /** + * Constructor. + */ + inline TVtFlagContainer(); + +protected: + + /** + * Clears all flags. + */ + inline void Clear(); + + /** + * Tests flag. + */ + inline TBool IsFlag( TUint32 aFlags ) const; + + /** + * Sets flag(s). + */ + inline void SetFlag( TUint32 aFlags ); + + /** + * Clears flag(s). + */ + inline void ClearFlag( TUint32 aFlags ); + + /** + * Gets flag value. + */ + inline TUint32 Value() const; + + /** + * Sets flag value. + */ + inline void SetValue( TUint32 aValue ); + +private: + + // Current flags + TUint32 iFlags; + + }; + +/** + * TVtUpdateableFlagContainer + * + * A flag container with Update() method that can be called to get + * flags updated in one pass. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( TVtUpdateableFlagContainer ) : public TVtFlagContainer + { +public: + + /** + * Issues flag updation. + */ + inline void Update(); + +private: + + /** + * Called when flags needs to be updated (as a result to call Update()). + */ + virtual void UpdateFlags() = 0; + + }; + +#include "tvtflagcontainer.inl" + +#endif // T_VTFLAGCONTAINER_H