os/boardsupport/haitest/bspsvs/suite/bsp/digitiser/src/T_DigitiserDriverData.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-2009 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 #include "T_DigitiserDriverData.h"
    19 
    20 
    21 //These are attributes for the touch screen device
    22 _LIT(KEnumPen,                                  "EPen");
    23 _LIT(KEnumPenX,                                 "EPenX");
    24 _LIT(KEnumPenY,                                 "EPenY");
    25 _LIT(KEnumPenState,                             "EPenState");
    26 
    27 //These are attributes for the sound driver device
    28 _LIT(KEnumPenClick,                             "EPenClick");
    29 _LIT(KEnumPenClickVolumeMax,                    "EPenClickVolumeMax");
    30 _LIT(KEnumPenClickState,                        "EPenClickState");
    31 _LIT(KEnumPenClickVolume,                       "EPenClickVolume");
    32 
    33 //These are the attributes for the power controller
    34  _LIT(KEnumPenDisplayOn,                        "EPenDisplayOn");
    35  
    36  //These are the attributes for the lcd screen device
    37  _LIT(KEnumDisplayState,                        "EDisplayState");
    38  _LIT(KEnumDisplayMode,							"EDisplayMode");
    39  
    40  //This represents a NULL attribute
    41 _LIT(KEnumNull,                                 "");
    42 
    43 const CT_HALData::THalTableLookup	CT_DigitiserDriverData::iTableLookup[] =
    44     {
    45 /**     
    46 *	Enum as a descriptor            Enum                            Prepare input           Prepare paramters       Validation of           Store data returned after               aFlag indicating
    47 *																	value prior to 			prior to				value returned			successful HAL::Get or                  if validation
    48 *																	HAL::Set call           HAL::Get call           after a successful      HAL::Set call                           is mandatory
    49 *																													HAL::Get call							
    50 */	
    51         
    52     KEnumPen,                       HALData::EPen,                  SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPen,                                 ETrue,
    53     KEnumPenState,                  HALData::EPenState,             SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenState,                            ETrue,
    54     KEnumPenX,                      HALData::EPenX,                 SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenX,                                ETrue,
    55     KEnumPenY,                      HALData::EPenY,                 SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenY,                                ETrue,	
    56     KEnumPenClick,                  HALData::EPenClick,             SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenClick,                            ETrue,
    57     KEnumPenClickVolumeMax,         HALData::EPenClickVolumeMax,    SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenClickVolumeMax,                   ETrue,
    58     KEnumPenClickState,             HALData::EPenClickState,        SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenClickState,                       ETrue,
    59     KEnumPenClickVolume,            HALData::EPenClickVolume,       SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenClickVolume,                      ETrue,
    60     KEnumPenDisplayOn,              HALData::EPenDisplayOn,         SetPrepareInt,          GetPrepareDummy,        GetValidationInt,       SetPenDisplayOn,                        ETrue,
    61     KEnumDisplayState,				HALData::EDisplayState,			SetPrepareInt,			GetPrepareDummy,		GetValidationInt,		SetDisplayState,						ETrue,
    62     KEnumDisplayMode,				HALData::EDisplayMode,			SetPrepareInt,			GetPrepareDummy,		GetValidationInt,		SetDisplayMode,							EFalse,
    63     KEnumNull,                      (HALData::TAttribute)0,         NULL,                   NULL,                   NULL,                   NULL,                                   NULL
    64     };
    65 
    66 //////////////////////////////////////////////////////////////////////
    67 // Construction/Destruction
    68 //////////////////////////////////////////////////////////////////////
    69 
    70 CT_DigitiserDriverData* CT_DigitiserDriverData::NewL()
    71 	{
    72 	CT_DigitiserDriverData*	digit=new (ELeave) CT_DigitiserDriverData();
    73 	CleanupStack::PushL(digit);
    74 	digit->ConstructL();
    75 	CleanupStack::Pop(digit);
    76 	return digit;
    77 	}
    78 
    79 
    80 CT_DigitiserDriverData::CT_DigitiserDriverData()
    81 :       CT_HALData(iTableLookup)
    82 ,       iPenState(-1)
    83 ,       iPen(-1)
    84 ,       iPenX(-1)
    85 ,       iPenY(-1)
    86 ,       iPenClick(-1)
    87 ,       iPenClickVolumeMax(-1)
    88 ,       iPenClickState(-1)
    89 ,       iPenClickVolume	(-1)
    90 ,       iPenDisplayOn(-1)
    91 ,		iDisplayState(-1)
    92 ,		iDisplayMode(-1)
    93 	{	
    94 	}
    95 
    96 void CT_DigitiserDriverData::ConstructL()
    97 /**
    98  * Second phase construction
    99  *
   100  * @internalComponent
   101  *
   102  * @return	N/A
   103  *
   104  * @pre		None
   105  * @post	None
   106  *
   107  * @leave	system wide error
   108  */
   109 	{
   110    
   111 	}
   112 
   113 CT_DigitiserDriverData::~CT_DigitiserDriverData()
   114 /**
   115  * Public destructor
   116  */
   117 	{
   118 	}
   119 
   120 TAny* CT_DigitiserDriverData::GetObject()
   121 /**
   122  * Return a pointer to the object that the data wraps
   123  *
   124  * @return	pointer to the object that the data wraps
   125  */
   126 	{
   127 	return NULL;
   128 	}
   129 	
   130 TBool CT_DigitiserDriverData::GetPrepareDummy(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
   131 /**
   132  * This a dummy place holder function that does nothing see HAL_Data
   133  *
   134  * @return a boolean value 
   135  *
   136  */	
   137 	{
   138 	return ETrue;
   139 	}
   140 	
   141 void CT_DigitiserDriverData::SetPen(CDataWrapperBase* aThis, TInt aValue)
   142 /**
   143  * Store whether the pen/digitiser is availabe for input
   144  *
   145  * @param 	aThis	a pointer to the data wrapper base class
   146  * @param  	aValue  an integer value to use in set 
   147  * 
   148  */
   149 	{
   150 	static_cast<CT_DigitiserDriverData*>(aThis)->iPen=aValue;	
   151 	}
   152 
   153 void CT_DigitiserDriverData::SetPenX(CDataWrapperBase* aThis, TInt aValue)
   154  /**
   155  *
   156  * Store pen/digitiser horizontal resolution in pixels
   157  *
   158  * @param 	aThis a pointer to the data wrapper base class
   159  * @param  	aValue  an integer value to use in set 
   160  */	
   161  	{
   162     static_cast<CT_DigitiserDriverData*>(aThis)->iPenX=aValue;	
   163     }
   164  
   165  void CT_DigitiserDriverData::SetPenY(CDataWrapperBase* aThis, TInt aValue)
   166  /**
   167  * Store pen/digitiser vertical resolution in pixels
   168  * 
   169  * @param       aThis a pointer to the data wrapper base class
   170  * @param       aValue  an integer value to use in set 
   171  * 
   172  */	
   173     {
   174     static_cast<CT_DigitiserDriverData*>(aThis)->iPenY=aValue;	
   175     }
   176      
   177 void CT_DigitiserDriverData::SetPenState(CDataWrapperBase* aThis, TInt aValue)
   178  /**
   179  * Store Pen Clicking ability
   180  *
   181  * @param 	aThis a pointer to the data wrapper base class
   182  * @param  	aValue  an integer value to use in set 
   183  * 
   184  */
   185     {
   186     static_cast<CT_DigitiserDriverData*>(aThis)->iPenState=aValue;
   187     }
   188     
   189 void CT_DigitiserDriverData::SetPenClick(CDataWrapperBase* aThis, TInt aValue)
   190  /**
   191  * Store Pen Click  
   192  * 
   193  * @param 	aThis a pointer to the data wrapper base class
   194  * @param  	aValue  an integer value to use in set 
   195  */	
   196 	{
   197 	static_cast<CT_DigitiserDriverData*>(aThis)->iPenClick=aValue;
   198 	}
   199 
   200 void CT_DigitiserDriverData::SetPenClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
   201  /**
   202  * Store maximum Pen Click Volume 
   203  *
   204  * @param 	aThis a pointer to the data wrapper base class
   205  * @param  	aValue  an integer value to use in set 
   206  */	
   207 	{
   208 	static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolumeMax=aValue;
   209 	}
   210 
   211 void CT_DigitiserDriverData::SetPenClickState(CDataWrapperBase* aThis, TInt aValue)
   212  /**
   213  * Store pen click state
   214  *
   215  * @param  	aThis a pointer to the data wrapper base class
   216  * @param  	aValue  an integer value to use in set 
   217  * 
   218  */
   219 	{
   220 	static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickState=aValue;
   221 	}
   222 
   223 void CT_DigitiserDriverData::SetPenClickVolume(CDataWrapperBase* aThis, TInt aValue)
   224  /**
   225  * Store pen click volume
   226  *
   227  * @param  	aThis a pointer to the data wrapper base class
   228  * @param  	aValue  an integer value to use in set 
   229  */	
   230 	{
   231 	static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolume=aValue;
   232 	}
   233 
   234 void CT_DigitiserDriverData::SetPenDisplayOn(CDataWrapperBase* aThis, TInt aValue)
   235  /**
   236  * Store PenDisplay On
   237  * @param 		aThis a pointer to the data wrapper base class
   238  * @param   	aValue  an integer value to use in set 
   239  * 
   240  */	
   241 	{
   242 	static_cast<CT_DigitiserDriverData*>(aThis)->iPenDisplayOn=aValue;
   243 	}
   244 
   245 void CT_DigitiserDriverData::SetDisplayState(CDataWrapperBase* aThis, TInt aValue)
   246  /**
   247  * Store DisplayState
   248  * @param 		aThis a pointer to the data wrapper base class
   249  * @param   	aValue  an integer value to use in set 
   250  * 
   251  */		
   252 	{
   253 	static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayState=aValue;
   254 	}
   255 	
   256  void CT_DigitiserDriverData::SetDisplayMode(CDataWrapperBase* aThis, TInt aValue)
   257  /**
   258  * Store DisplayMode
   259  * @param 		aThis a pointer to the data wrapper base class
   260  * @param   	aValue  an integer value to use in set 
   261  * 
   262  */		
   263  	{
   264  	static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayMode=aValue;
   265  	}
   266 	
   267 TBool CT_DigitiserDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   268 /**
   269  * Process a command read from the ini file
   270  *
   271  * @param aCommand                      The command to process
   272  * @param aSection                      The section in the ini containing data for the command
   273  * @param aAsyncErrorIndex              Command index for async calls to return errors to
   274  *
   275  * @return                              ETrue if the command is processed
   276  *
   277  * @leave                               System wide error
   278  */
   279 	{
   280 	TBool	ret=ETrue;
   281 	ret=CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
   282 	return ret;
   283 	}
   284