emailuis/emailui/inc/FreestyleEmailUiListModel.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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:  FreestyleEmailUi  list model and model item 
       
    15 *				 abstract base classes definitions
       
    16 *
       
    17 */
       
    18 
       
    19  
       
    20  
       
    21 #ifndef __FREESTYLEEMAILUI_LISTMODEL_H__
       
    22 #define __FREESTYLEEMAILUI_LISTMODEL_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 //<cmail>
       
    26 #include "CFSMailMessage.h"
       
    27 //</cmail>
       
    28 
       
    29 // LIST ITEM MODEL DEFINITION
       
    30 class MFSListModelItem
       
    31     {
       
    32 public:
       
    33     /** Virtual destructor. */
       
    34     virtual ~MFSListModelItem() {}
       
    35 
       
    36     };
       
    37 
       
    38 /**
       
    39  * An interface for a list model. This mixin class provides storage methods for 
       
    40  * accessing, adding and removing list data.
       
    41  * 
       
    42  * Logic code and visualisation is done elsewhere.
       
    43  */
       
    44 class MFSEmailListModel
       
    45     {
       
    46 public:
       
    47 	/**
       
    48 	* Add an item to the end of the list.
       
    49 	*/
       
    50 	virtual void AppendL(MFSListModelItem* aItem) = 0;
       
    51 	
       
    52 	/**
       
    53 	* Insert an item at the given index.
       
    54 	*/	
       
    55 	virtual void InsertL(MFSListModelItem* aItem, TInt aIndex) = 0;
       
    56 
       
    57 	/**
       
    58 	* Remove item by its index.
       
    59 	*/	
       
    60 	virtual void RemoveAndDestroy(TInt aIndex) = 0;
       
    61 
       
    62 	/**
       
    63 	* get an item by its index.
       
    64 	* 
       
    65 	* @return NULL if out of range.
       
    66 	*/
       
    67 	virtual MFSListModelItem* Item(TInt aIndex) = 0;
       
    68 
       
    69 	/**
       
    70 	* Get number of items in list.
       
    71 	* 
       
    72 	* @return Number of items.
       
    73 	*/		
       
    74 	virtual TInt Count() const = 0;
       
    75     };
       
    76 
       
    77 #endif //__FREESTYLEEMAILUI_LISTMODEL_H__