textinput/peninputcommonlayout/inc/peninputclientlayoutinfo.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  client layout information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PENINPUTCLIENTLAYOUTINFO_H
       
    20 #define C_PENINPUTCLIENTLAYOUTINFO_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 #include <barsread.h>
       
    26 
       
    27 /**
       
    28  *  Control info class
       
    29  *
       
    30  *  This class is to define control info. Application can create it from  
       
    31  *  resource file. Control info includes control id, begin row, end row,  
       
    32  *  bgin column and end column. 
       
    33  *
       
    34  *  @lib peninputcommonlayout.lib
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class CPeninputControlInfo : public CBase
       
    38     {
       
    39     
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Symbian constructor
       
    44      *
       
    45      * @since S60 v3.2
       
    46      * @param aReader Resource reader    
       
    47      * @return The pointer to CPeninputControlInfo object
       
    48      */
       
    49     IMPORT_C static CPeninputControlInfo* NewL( TResourceReader& aReader );
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @return None
       
    56      */    
       
    57     IMPORT_C virtual ~CPeninputControlInfo();
       
    58 
       
    59     /**
       
    60      * Get control id
       
    61      *
       
    62      * @since S60 v3.2
       
    63      * @return Control id
       
    64      */    
       
    65     inline const TInt ControlID() const;
       
    66 
       
    67     /**
       
    68      * Get control type
       
    69      *
       
    70      * @since S60 v3.2
       
    71      * @return Control type
       
    72      */    
       
    73     inline const TInt ControlType() const;
       
    74 
       
    75     /**
       
    76      * Get begin row
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @return Begin row
       
    80      */    
       
    81     inline const TInt BeginRow() const;
       
    82 
       
    83     /**
       
    84      * Get end row
       
    85      *
       
    86      * @since S60 v3.2
       
    87      * @return End row
       
    88      */    
       
    89     inline const TInt EndRow() const;
       
    90 
       
    91     /**
       
    92      * Get begine column
       
    93      *
       
    94      * @since S60 v3.2
       
    95      * @return Begine column
       
    96      */    
       
    97     inline const TInt BeginColumn() const;
       
    98 
       
    99     /**
       
   100      * Get end column
       
   101      *
       
   102      * @since S60 v3.2
       
   103      * @return End column
       
   104      */    
       
   105     inline const TInt EndColumn() const;
       
   106 
       
   107 protected:
       
   108 
       
   109     /**
       
   110      * Second phase constructor
       
   111      *
       
   112      * @since S60 v3.2
       
   113      * @param aReader Resource reader
       
   114      * @return None
       
   115      */
       
   116     void ConstructL( TResourceReader& aReader );
       
   117 
       
   118     /**
       
   119      * Construct from resource 
       
   120      *
       
   121      * @since S60 v3.2
       
   122      * @param aReader Resource reader
       
   123      * @return None
       
   124      */
       
   125     void ConstructFromResourceL( TResourceReader& aReader );
       
   126 
       
   127 private: // Data
       
   128 
       
   129     /**
       
   130      * Control id
       
   131      */  
       
   132     TInt iControlID;
       
   133 
       
   134     /**
       
   135      * Control Type
       
   136      */
       
   137     TInt iControlType;
       
   138 
       
   139     /**
       
   140      * Begin row
       
   141      */  
       
   142     TInt iBeginRow;
       
   143 
       
   144     /**
       
   145      * End row
       
   146      */  
       
   147     TInt iEndRow;
       
   148 
       
   149     /**
       
   150      * Begin column
       
   151      */  
       
   152     TInt iBeginColumn;
       
   153 
       
   154     /**
       
   155      * End column
       
   156      */  
       
   157     TInt iEndColumn;
       
   158     
       
   159     };
       
   160 
       
   161 /**
       
   162  *  Client layout class
       
   163  *
       
   164  *  This class is to implement image layout. Application can create it from  
       
   165  *  resource file. Control info includes control id, row and column. 
       
   166  *
       
   167  *  @lib peninputcommonlayout.lib
       
   168  *  @since S60 v3.2
       
   169  */
       
   170 class CPeninputClientLayoutInfo : public CBase
       
   171     {
       
   172     
       
   173 public:
       
   174 
       
   175     /**
       
   176      * Symbian constructor
       
   177      *
       
   178      * @since S60 v3.2
       
   179      * @param aReader Resource reader        
       
   180      * @return The pointer to CPeninputClientLayoutInfo object
       
   181      */
       
   182     IMPORT_C static CPeninputClientLayoutInfo* NewL( 
       
   183         TResourceReader& aReader );
       
   184 
       
   185     /**
       
   186      * Symbian constructor
       
   187      *
       
   188      * @since S60 v3.2
       
   189      * @param aReader Resource reader        
       
   190      * @return The pointer to CPeninputClientLayoutInfo object
       
   191      */
       
   192     IMPORT_C static CPeninputClientLayoutInfo* NewLC( 
       
   193         TResourceReader& aReader );
       
   194 
       
   195     /**
       
   196      * Destructor
       
   197      *
       
   198      * @since S60 v3.2
       
   199      * @return None
       
   200      */
       
   201     IMPORT_C virtual ~CPeninputClientLayoutInfo();
       
   202     
       
   203     /**
       
   204      * Contruct from resource file
       
   205      *
       
   206      * @since S60 v3.2
       
   207      * @param aReader Resource reader    
       
   208      * @return None
       
   209      */    
       
   210     IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
       
   211 
       
   212     /**
       
   213      * Get control info
       
   214      *
       
   215      * @since S60 v3.2
       
   216      * @param aControlID control id  
       
   217      * @return The pointer to CPeninputControlInfo object
       
   218      */    
       
   219     IMPORT_C CPeninputControlInfo* FindControlInfo( const TInt aControlID );
       
   220 
       
   221     /**
       
   222      * Add control info
       
   223      *
       
   224      * @since S60 v3.2
       
   225      * @param aControlInfo Pointer to control info
       
   226      * @return None
       
   227      */    
       
   228     IMPORT_C void AddControlInfo( CPeninputControlInfo* aControlInfo );
       
   229 
       
   230     /**
       
   231      * Remove control info
       
   232      *
       
   233      * @since S60 v3.2
       
   234      * @param aControlInfo Pointer to control info
       
   235      * @return None
       
   236      */  
       
   237     IMPORT_C void RemoveControlInfo( CPeninputControlInfo* aControlInfo );
       
   238  
       
   239     /**
       
   240      * Remove control info based on control id
       
   241      *
       
   242      * @since S60 v3.2
       
   243      * @param aControlID Control id
       
   244      * @return None
       
   245      */ 
       
   246     IMPORT_C void RemoveControlInfo( const TInt aControlID );
       
   247 
       
   248     /**
       
   249      * Get layout id
       
   250      *
       
   251      * @since S60 v3.2
       
   252      * @return Layout id
       
   253      */ 
       
   254     inline TInt LayoutID() const;
       
   255 
       
   256     /**
       
   257      * Get column
       
   258      *
       
   259      * @since S60 v3.2
       
   260      * @return Column
       
   261      */ 
       
   262     inline TInt Columns() const;
       
   263 
       
   264     /**
       
   265      * Get row
       
   266      *
       
   267      * @since S60 v3.2
       
   268      * @return Row
       
   269      */ 
       
   270     inline TInt Rows() const;
       
   271 
       
   272     /**
       
   273      * Get control array
       
   274      *
       
   275      * @since S60 v3.2
       
   276      * @return Control array
       
   277      */ 
       
   278     inline RPointerArray<CPeninputControlInfo>& ControlInfoList();
       
   279 
       
   280 protected:
       
   281 
       
   282     /**
       
   283      * Symbian second-phase constructor
       
   284      *
       
   285      * @since S60 v3.2
       
   286      * @param aReader Resource reader   
       
   287      * @return None
       
   288      */ 
       
   289     void ConstructL( TResourceReader& aReader );  
       
   290                 
       
   291 private: // Data
       
   292 
       
   293     /**
       
   294      * Layout id
       
   295      */  
       
   296     TInt iLayoutID;
       
   297 
       
   298     /**
       
   299      * Column count
       
   300      */  
       
   301     TInt iColumns;
       
   302 
       
   303     /**
       
   304      * Row count
       
   305      */  
       
   306     TInt iRows;
       
   307 
       
   308     /**
       
   309      * Control info array
       
   310      */  
       
   311     RPointerArray<CPeninputControlInfo> iControlInfoList;
       
   312     
       
   313     };
       
   314 
       
   315 #include "peninputclientlayoutinfo.inl"
       
   316     
       
   317 #endif // C_PENINPUTCLIENTLAYOUTINFO_H