textinput/peninputcommonctrls/inc/peninputdropdownlist/peninputpages.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2200 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:  Pages manager,which is used by drop down list
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PAGES_H
       
    20 #define C_PAGES_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <w32std.h>
       
    24 
       
    25 /**
       
    26  *  Pages manager
       
    27  *
       
    28  *  Pages manager used by drop down list
       
    29  *
       
    30  *  @lib FepCtrlDropdownList.lib
       
    31  *  @since S60 v3.2
       
    32  */ 
       
    33 NONSHARABLE_CLASS(CPages) : public CBase
       
    34     {
       
    35     
       
    36 public:  
       
    37 
       
    38     /**
       
    39      * Create a object of CPages, static method
       
    40      *
       
    41      * @since S60 v3.2
       
    42      * @return CPages pointer.
       
    43      */
       
    44     static CPages* NewL();
       
    45     
       
    46     /**
       
    47      * Destructor
       
    48      *
       
    49      * @since S60 v3.2
       
    50      */     
       
    51     virtual ~CPages();        
       
    52  
       
    53     /**
       
    54      * Add one page into the page list
       
    55      *
       
    56      * @since S60 v3.2
       
    57      * @param aFirstIndex The first index of the page
       
    58      * @param aLastIndex The last index of the page    
       
    59      * @return None.
       
    60      */
       
    61     void AddPage(const TInt aFirstIndex, const TInt aLastIndex); 
       
    62            
       
    63     /**
       
    64      * Get previous index according the appointed last index
       
    65      *
       
    66      * @since S60 v3.2
       
    67      * @param aLastIndex The current last index 
       
    68      * @param aFirstIndexOfPrevious Returned first index of previous page
       
    69      * @param aLastIndexOfPrevious Returned last index of previous page
       
    70      * @return The find result, ETrue if success, else EFalse.
       
    71      */
       
    72     TBool GetPreviousIndex(const TInt aLastIndex, 
       
    73                            TInt& aFirstIndexOfPrevious, 
       
    74                            TInt& aLastIndexOfPrevious) const;
       
    75     
       
    76     /**
       
    77      * Reset the pages, clear all pages
       
    78      *
       
    79      * @since S60 v3.2
       
    80      * @return None.
       
    81      */
       
    82     void Reset();
       
    83     
       
    84     /**
       
    85      * Get page count in the list
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @return Page count.
       
    89      */
       
    90     TInt PageCount() const;    
       
    91     
       
    92     /**
       
    93      * Get page by appointed postion.
       
    94      *
       
    95      * @since S60 v3.2
       
    96      * @param aPos The appointed postion
       
    97      * @param aFirstIndex Returned first index of page
       
    98      * @param aLastIndex Returned last index of page
       
    99      * @return The find result, ETrue if success, else EFalse.
       
   100      */
       
   101     TBool GetPageIndexByPos(const TInt aPos, 
       
   102                             TInt& aFirstIndex, 
       
   103                             TInt& aLastIndex) const;
       
   104     
       
   105 protected:
       
   106 
       
   107     /**
       
   108      * 2nd construct method
       
   109      *
       
   110      * @since S60 v3.2
       
   111      * @return None
       
   112      */      
       
   113     void ConstructL();  
       
   114     
       
   115 private: // Data
       
   116 
       
   117     /**
       
   118      * the list for first indexes 
       
   119      */  
       
   120     RArray<TInt> iFirstIndexList;
       
   121     
       
   122     /**
       
   123      * the list for last indexes 
       
   124      */  
       
   125     RArray<TInt> iLastIndexList;
       
   126       
       
   127     };
       
   128 
       
   129 #endif // C_PAGES_H
       
   130 
       
   131 // End Of File