mmuifw_plat/alf_widgetmodel_api/inc/alf/ialfbranch.h
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
equal deleted inserted replaced
25:4ea6f81c838a 26:0e9bb658ef58
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Defines a branch data type for the data hierarchy
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef I_ALFBRANCH_H
       
    21 #define I_ALFBRANCH_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <alf/ialfvarianttype.h>
       
    26 
       
    27 namespace osncore
       
    28     {
       
    29 class UString;
       
    30     }
       
    31 
       
    32 using osncore::UString;
       
    33 
       
    34 namespace Alf
       
    35     {
       
    36 class IAlfMap;
       
    37 class IAlfSortFunction;
       
    38 
       
    39 /**
       
    40  * An interface for Container data type.
       
    41  *
       
    42  * @lib hitchcockwidgetmodel.lib
       
    43  * @since S60 ?S60_version
       
    44  * @status Draft
       
    45  */
       
    46 class IAlfBranch : public IAlfVariantType
       
    47     {
       
    48 public:
       
    49 
       
    50     /**
       
    51      * The data for this branch
       
    52      *
       
    53      * @return the data for this branch as a Map Interface pointer
       
    54      * @since S60 ?S60_version
       
    55      */
       
    56     virtual IAlfMap* data() = 0;
       
    57 
       
    58     /**
       
    59      * Set the data for this branch.
       
    60      * @param aData The new data for this branch.
       
    61      * @since S60 ?S60_version
       
    62      */
       
    63     virtual void setData( IAlfMap* aData ) = 0;
       
    64 
       
    65     /**
       
    66      * The data for a child at a given index
       
    67      * @param aIndex- index of the child at which the data needs to be fetched
       
    68      * @return the data for its children as a Map Interface pointer
       
    69      * @since S60 ?S60_version
       
    70      */
       
    71     virtual IAlfVariantType* childData(int aIndex) = 0;
       
    72 
       
    73     /**
       
    74      * APi to get the childName
       
    75      * @param aIndex- index of the child at which the data needs to be fetched
       
    76      * @return the name  for the child at the given index
       
    77      * @since S60 ?S60_version
       
    78      */
       
    79     virtual const UString& childName(int aIndex) = 0;
       
    80 
       
    81     /**
       
    82      * The data for all children.
       
    83      * @return the data for its children as a Map Interface pointer
       
    84      * @since S60 ?S60_version
       
    85      */
       
    86     virtual IAlfMap* childData() = 0;
       
    87 
       
    88     /**
       
    89      * Set the data for children of this branch.
       
    90      * @param aChildData The new data for the children.
       
    91      * @since S60 ?S60_version
       
    92      */
       
    93     virtual void setChildData( IAlfMap* aChildData ) = 0;
       
    94 
       
    95     /**
       
    96      * Get the number of children in this branch
       
    97      * @return The number of children
       
    98      * @since S60 ?S60_version
       
    99      */
       
   100     virtual uint childrenCount() = 0;
       
   101 
       
   102     /**
       
   103      * Destructor
       
   104      * @since S60 ?S60_version
       
   105      */
       
   106     virtual ~IAlfBranch() {};
       
   107 
       
   108     /**
       
   109      * Sorts the branch using user defined sort function.
       
   110      *
       
   111      * @param aSortFunction - sort function.
       
   112      * @since S60 ?S60_version
       
   113      */
       
   114     virtual void sort( const IAlfSortFunction& aSortFunction ) = 0;
       
   115 
       
   116     /**
       
   117      * Function to Clone the Branch
       
   118      * @since S60 ?S60_version
       
   119      * @return The clone
       
   120      */
       
   121     virtual IAlfBranch* clone() = 0;
       
   122 
       
   123     };
       
   124 
       
   125     } // namespace Alf
       
   126 
       
   127 #endif // I_ALFBRANCH_H
       
   128 
       
   129 // End of File