diff -r 6ca72c0fe49a -r a941bc465d9f PECengine/ListLibrary2/AttrListSrc/CPEngAttributeListModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PECengine/ListLibrary2/AttrListSrc/CPEngAttributeListModel.h Wed Sep 01 12:31:13 2010 +0100 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2005 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: Attribute list model implementation +* +*/ + +#ifndef __CPENGATTRIBUTELISTMODEL_H__ +#define __CPENGATTRIBUTELISTMODEL_H__ + +// INCLUDES +#include +#include "MPEngAttributeList2.h" + +// FORWARD DECLARATIONS +class MPEngPresenceAttrManager; + + +// CLASS DECLARATION + +/** + * Attribute list model + * + * @lib PEngListLib2 + * @since 3.0 + */ +NONSHARABLE_CLASS( CPEngAttributeListModel ): public CBase, + public MPEngAttributeList2 + { +public: + /** + * Two-phased constructor. + */ + static CPEngAttributeListModel* NewL( + MPEngPresenceAttrManager* aAttributeManager ); + + static CPEngAttributeListModel* NewLC( + MPEngPresenceAttrManager* aAttributeManager ); + + /** + * Two-phased constructor. + */ + static CPEngAttributeListModel* NewL( + MPEngPresenceAttrManager* aAttributeManager, + const RArray& aPresenceAttributes ); + + static CPEngAttributeListModel* NewLC( + MPEngPresenceAttrManager* aAttributeManager, + const RArray& aPresenceAttributes ); + + /** + * Destructor. + */ + ~CPEngAttributeListModel(); + + +public: // From MPEngAttributeList2 + + /** + * Adds a presence attribute into the attribute list. + * @see + */ + void AddPresenceAttributeL( TUint32 aPresenceAttribute ); + + + /** + * Removes the presence attribute from the attribute list. + * @see + */ + TInt RemovePresenceAttribute( TUint32 aPresenceAttribute ); + + + /** + * Removes all presence attributes from the attribute list + * @see + */ + void RemoveAllAttributes(); + + + /** + * Checks is the presence attribute valid and can it be added + * @see + */ + TInt ConfirmPresenceAttribute( TUint32 aPresenceAttribute ) const; + + + /** + * Current set of presence attributes in the attribute list. + * @see + */ + TArray ListOfAttributes() const; + + + + /** + * Generic attribute list extension interface. + * @see + * @since 3.0 + */ + MPEngAttributeListExt2* Extension() + { + return NULL; + } + + /** + * Presence Engine internal attribute list interface. + * @see + * @since 3.0 + */ + const MPEngAdvancedAttributeList2* Advanced() const + { + return NULL; + } + + MPEngAdvancedAttributeList2* Advanced() + { + return NULL; + } + + + /** + * Close reference to the object + * + * @since 3.0 + */ + void Close(); + + +public: // New functions + + /** + * Reference to the array of the attributes + * + * @since 3.0 + * @return array of presence attributes + */ + const RArray& PresenceAttributes() const; + + +private: // constructors + + /** + * Symbian constructor. + */ + void ConstructL( const RArray& aPresenceAttributes ); + + /** + * C++ constructor. + */ + CPEngAttributeListModel( MPEngPresenceAttrManager* aAttributeManager ); + + +private: // Data + + /// OWN: List of presence attributes + RArray iListOfAttributes; + + /// REF: Attribute manager + MPEngPresenceAttrManager* iAttributeManager; + + }; + +#endif // __CPENGATTRIBUTELISTMODEL_H__ + +// End of File +