ncdengine/inc/ncdqueryselectionitem.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_QUERY_SELECTION_ITEM_H
       
    20 #define M_NCD_QUERY_SELECTION_ITEM_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 
       
    24 #include "ncdqueryitem.h"
       
    25 #include "ncdinterfaceids.h"
       
    26 
       
    27 class MDesCArray;
       
    28 class MDesC8Array;
       
    29 
       
    30 /**
       
    31  *  Describes a selection query item.
       
    32  */
       
    33 class MNcdQuerySelectionItem : public virtual MNcdQueryItem
       
    34     {
       
    35     
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    40      *
       
    41      * 
       
    42      */
       
    43     enum { KInterfaceUid = ENcdQuerySelectionItemUid };
       
    44 
       
    45     /**
       
    46      * Getter for selection texts.
       
    47      *
       
    48      * 
       
    49      * @return Array of selection item names, one for each selection.
       
    50      */
       
    51     virtual const MDesCArray& SelectionTexts() const = 0;
       
    52 
       
    53     /**
       
    54      * Getter for additional selection data.
       
    55      * 
       
    56      * @note Actual contents depend on context. Query semantics can be used to determine
       
    57      *  the content type (if any).
       
    58      *
       
    59      * 
       
    60      * @return Array of descriptors containing the additional data for each selection.
       
    61      */
       
    62     virtual const MDesC8Array& SelectionData() const = 0;
       
    63 
       
    64     /**
       
    65      * Selects one of the choices.
       
    66      *
       
    67      * 
       
    68      * @param aIndex Index of the selection (index of the selection text in the array
       
    69      *  returned by SelectionTexts()
       
    70      * @exception KErrArgument Specified index is out of bounds.
       
    71      */
       
    72     virtual void SetSelectionL( TInt aIndex ) = 0;
       
    73     
       
    74     
       
    75     /**
       
    76      * Selection getter
       
    77      *
       
    78      * @return Index that was set with SetSelectionL
       
    79      */
       
    80     virtual TInt Selection() const = 0;
       
    81     
       
    82 
       
    83 protected:
       
    84 
       
    85     /**
       
    86     * Destructor.
       
    87     *
       
    88     * @see MCatalogsBase::~MCatalogsBase
       
    89     */
       
    90     virtual ~MNcdQuerySelectionItem() {}
       
    91 
       
    92     };
       
    93 	
       
    94 	
       
    95 #endif //  M_NCDQUERYSELECTIONITEM_H