predictivesearch/PcsAlgorithm/Algorithm1/inc/CPcsAdaptiveGrid.h
branchRCL_3
changeset 39 a6539d1e8e43
child 45 34879f5cfc63
equal deleted inserted replaced
35:4ae315f230bc 39:a6539d1e8e43
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Utility class to hold a single item for Adaptive Grid.
       
    15 *               Used to provide quickly to client applications (Phonebook)
       
    16 *               The Adaptive Grid for the full list of contacts, which is
       
    17 *               the one that is displayed when the Find Box is empty.
       
    18 */
       
    19 
       
    20 #ifndef __CPS_ADAPTIVE_GRID_H__
       
    21 #define __CPS_ADAPTIVE_GRID_H__
       
    22 
       
    23 // SYSTEM INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <s32strm.h>
       
    26 #include <CPcsDefs.h>
       
    27 
       
    28 #include "CPcsAdaptiveGridItem.h"
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Utility class to hold a single item for the Adaptive Grid.
       
    34  * This class is used to represent one character of the Adaptive Grid
       
    35  * with its reference counters.
       
    36  * 
       
    37  * @lib pcsutils.lib
       
    38  * @since S60 v3.2
       
    39  */
       
    40 class CPcsAdaptiveGrid : public CBase
       
    41 {
       
    42 	public:
       
    43 
       
    44 		/**
       
    45 		 * Two phase construction
       
    46 		 *
       
    47 		 * @return Instance of CPcsAdaptiveGrid
       
    48 		 */
       
    49 		static CPcsAdaptiveGrid* NewL( );
       
    50 
       
    51 		/**
       
    52 		 * Destructor
       
    53 		 */
       
    54 		~CPcsAdaptiveGrid();
       
    55 
       
    56         /**
       
    57          * Return the count of grid items
       
    58          */
       
    59 		TInt Count();
       
    60 
       
    61 		/**
       
    62 		 * Return the index of the Adaptive Grid item, given the char
       
    63 		 */
       
    64 		TInt GetAdaptiveGridItemIndex( const TChar& aChar );
       
    65 
       
    66         /**
       
    67          * Get the pointer to the Adaptive Grid item, given the char
       
    68          */
       
    69         CPcsAdaptiveGridItem* GetAdaptiveGridItemPtr( const TChar& aChar );
       
    70 
       
    71         /**
       
    72          * Increment the ref counter of the Adaptive Grid item, given the char
       
    73          * and the selector
       
    74          */
       
    75 		void IncrementRefCounterL( const TChar& aChar, const TUint aSelector );
       
    76 		
       
    77         /**
       
    78          * Decrement the ref counter of the Adaptive Grid item, given the char
       
    79          * and the selector
       
    80          */
       
    81         void DecrementRefCounter( const TChar& aChar, const TUint aSelector );		
       
    82 		
       
    83         /**
       
    84          * Return the Adaptive Grid, given the Company Name
       
    85          */
       
    86         void GetAdaptiveGrid( const TBool aCompanyName, TDes& aGrid );
       
    87 
       
    88         /**
       
    89          * Print the Adaptive Grid
       
    90          */
       
    91         void CPcsAdaptiveGrid::PrintAdatptiveGrid( );
       
    92 
       
    93 	private:
       
    94 
       
    95 		/**
       
    96 		 * Default Constructor
       
    97 		 */
       
    98 		CPcsAdaptiveGrid();
       
    99 								
       
   100         /**
       
   101         * Array of Adaptive Grid characters with reference counters.
       
   102         */
       
   103         RPointerArray<CPcsAdaptiveGridItem> iAdaptiveGrid;
       
   104 };
       
   105 
       
   106 #endif // __CPS_ADAPTIVE_GRID_H__
       
   107 
       
   108 // End of file