emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  FreestyleEmailUi grid menu model
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FREESTYLEEMAILUI_LAUNCHERGRID_MODEL_H__
       
    20 #define __FREESTYLEEMAILUI_LAUNCHERGRID_MODEL_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 //<cmail>
       
    24 #include <alf/alftexture.h>
       
    25 //</cmail>
       
    26 #include "FSEmailLauncherItem.h"
       
    27 #include "CFSMailCommon.h"
       
    28 
       
    29 
       
    30 enum TItemType
       
    31     {
       
    32     EShortcut,
       
    33     EFolder
       
    34     };
       
    35 
       
    36 
       
    37 struct TMenuItem
       
    38     {
       
    39     TInt iId;   
       
    40     TInt iParent;  
       
    41     TItemType iType; 
       
    42     HBufC* iCaption;  
       
    43     CAlfTexture* iIconTexture;
       
    44     CFSEmailLauncherItem* iLauncherItem;
       
    45     TFSMailMsgId iMailBoxId;
       
    46     TFSMailMsgId iMailBoxInboxId;
       
    47     };
       
    48 
       
    49 
       
    50 class CFSEmailUiLauncherGridModel : public CBase
       
    51     {
       
    52 public:
       
    53     CFSEmailUiLauncherGridModel();   
       
    54     void ConstructL();
       
    55 
       
    56     virtual ~CFSEmailUiLauncherGridModel();
       
    57 
       
    58     void AddL( 
       
    59         TItemType aType,
       
    60         TInt aId,
       
    61         const TDesC& aCaption,
       
    62         CAlfTexture& aIconTexture,
       
    63         TInt aParentId = 0, 
       
    64         CFSEmailLauncherItem* aLauncherItem = NULL ); // Doesn't take ownership!
       
    65     
       
    66     void AddL( 
       
    67         TItemType aType,
       
    68         TInt aId,
       
    69         const TDesC& aCaption,
       
    70         CAlfTexture& aIconTexture,
       
    71         TFSMailMsgId aMailBoxId,
       
    72         TFSMailMsgId aMailBoxInboxId );
       
    73     
       
    74     TInt Parent(TInt aId) const;
       
    75     
       
    76     TInt FindChildren(TInt aParentId, RArray<TMenuItem>& aItems);
       
    77 
       
    78     TBool HasChildren(TInt aParentId) const;
       
    79     
       
    80     TMenuItem* Item(TInt aId); // Ownership not transferred!
       
    81 
       
    82 
       
    83 private:
       
    84 
       
    85     RArray<TMenuItem> iItems;    
       
    86 
       
    87     };
       
    88 
       
    89 
       
    90 #endif // __FREESTYLEEMAILUI_LAUNCHERGRID_MODEL_H__