uiservicetab/vimpstui/src/cvimpstuisearchfieldarray.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 0 5e5d6b214f4f
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    25 #include <barsread.h>
    25 #include <barsread.h>
    26 #include <coemain.h>
    26 #include <coemain.h>
    27 #include <eikcapc.h>
    27 #include <eikcapc.h>
    28 #include <eikedwin.h>
    28 #include <eikedwin.h>
    29 #include <AknUtils.h>
    29 #include <AknUtils.h>
       
    30 #include "uiservicetabtracer.h"
    30 
    31 
    31 // --------------------------------------------------------------------------
    32 // --------------------------------------------------------------------------
    32 // CVIMPSTUiSearchFieldArray::CVIMPSTUiSearchFieldArray
    33 // CVIMPSTUiSearchFieldArray::CVIMPSTUiSearchFieldArray
    33 // --------------------------------------------------------------------------
    34 // --------------------------------------------------------------------------
    34 //
    35 //
    76 TInt CVIMPSTUiSearchFieldArray::CreateFieldsL( const TDesC& aLebal, 
    77 TInt CVIMPSTUiSearchFieldArray::CreateFieldsL( const TDesC& aLebal, 
    77 											TVIMPSTSearchDataFieldType aFieldDataType ,
    78 											TVIMPSTSearchDataFieldType aFieldDataType ,
    78 											TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, 
    79 											TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, 
    79 											TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/  )
    80 											TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/  )
    80     {
    81     {
       
    82 	TRACER_AUTO;
    81     MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType , aSearchKey);
    83     MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType , aSearchKey);
    82     
    84     
    83     iFieldArray.Append( newField ); // ownership to array
    85     iFieldArray.Append( newField ); // ownership to array
    84     
    86     
    85 	return newField->ControlId();
    87 	return newField->ControlId();
    92 TInt CVIMPSTUiSearchFieldArray::InsertFieldsL(TInt aIndex, const TDesC& aLebal, 
    94 TInt CVIMPSTUiSearchFieldArray::InsertFieldsL(TInt aIndex, const TDesC& aLebal, 
    93 											TVIMPSTSearchDataFieldType aFieldDataType ,
    95 											TVIMPSTSearchDataFieldType aFieldDataType ,
    94 											TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, 
    96 											TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, 
    95 											TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/ )
    97 											TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/ )
    96     {
    98     {
       
    99 	TRACER_AUTO;
    97     MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType, aSearchKey );
   100     MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType, aSearchKey );
    98     
   101     
    99     iFieldArray.InsertL( newField ,aIndex); // ownership to array
   102     iFieldArray.InsertL( newField ,aIndex); // ownership to array
   100     
   103     
   101 	return newField->ControlId();
   104 	return newField->ControlId();
   104 // CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty
   107 // CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty
   105 // --------------------------------------------------------------------------
   108 // --------------------------------------------------------------------------
   106 //
   109 //
   107 TBool CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty() const
   110 TBool CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty() const
   108     {
   111     {
       
   112 	TRACER_AUTO;
   109     const TInt count = iFieldArray.Count();
   113     const TInt count = iFieldArray.Count();
   110     
   114     
   111     for(TInt i = 0; i < count; ++i)
   115     for(TInt i = 0; i < count; ++i)
   112         {        
   116         {        
   113         TPtrC text = iFieldArray[i]->FieldData() ;
   117         TPtrC text = iFieldArray[i]->FieldData() ;
   124 // CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL
   128 // CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL
   125 // --------------------------------------------------------------------------
   129 // --------------------------------------------------------------------------
   126 //
   130 //
   127 TBool CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL() const
   131 TBool CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL() const
   128     {
   132     {
       
   133 	TRACER_AUTO;
   129     const TInt count = iFieldArray.Count();
   134     const TInt count = iFieldArray.Count();
   130     
   135     
   131     for(TInt i = 0; i < count; ++i)
   136     for(TInt i = 0; i < count; ++i)
   132         {        
   137         {        
   133         HBufC* text = iFieldArray[i]->ControlTextL() ;
   138         HBufC* text = iFieldArray[i]->ControlTextL() ;
   144 // CVIMPSTUiSearchFieldArray::ResetFieldData
   149 // CVIMPSTUiSearchFieldArray::ResetFieldData
   145 // --------------------------------------------------------------------------
   150 // --------------------------------------------------------------------------
   146 //
   151 //
   147 void CVIMPSTUiSearchFieldArray::ResetFieldData() 
   152 void CVIMPSTUiSearchFieldArray::ResetFieldData() 
   148     {
   153     {
       
   154 	TRACER_AUTO;
   149     const TInt count = iFieldArray.Count();
   155     const TInt count = iFieldArray.Count();
   150    
   156    
   151     for(TInt i = 0; i < count; ++i)
   157     for(TInt i = 0; i < count; ++i)
   152         {        
   158         {        
   153         TInt len = iFieldArray[i]->FieldData().Length() ;
   159         TInt len = iFieldArray[i]->FieldData().Length() ;
   164 // CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL
   170 // CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL
   165 // --------------------------------------------------------------------------
   171 // --------------------------------------------------------------------------
   166 //
   172 //
   167 void CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL(MVIMPSTSearchUiBuilder& aUiBuilder )
   173 void CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL(MVIMPSTSearchUiBuilder& aUiBuilder )
   168 	{
   174 	{
       
   175 	TRACER_AUTO;
   169 	iUiBuilder = NULL; 
   176 	iUiBuilder = NULL; 
   170 	iUiBuilder = &aUiBuilder;
   177 	iUiBuilder = &aUiBuilder;
   171 	
   178 	
   172 	TInt count = Count();
   179 	TInt count = Count();
   173 	
   180 	
   183 // CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL
   190 // CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL
   184 // --------------------------------------------------------------------------
   191 // --------------------------------------------------------------------------
   185 //
   192 //
   186 void CVIMPSTUiSearchFieldArray::CreateUiFieldsL(MVIMPSTUiSearchField& aField )
   193 void CVIMPSTUiSearchFieldArray::CreateUiFieldsL(MVIMPSTUiSearchField& aField )
   187 	{
   194 	{
       
   195 	TRACER_AUTO;
   188 	switch( aField.FieldDataType() )
   196 	switch( aField.FieldDataType() )
   189 		{
   197 		{
   190 
   198 
   191 		case EVIMPSTEdwinNumber :
   199 		case EVIMPSTEdwinNumber :
   192 			{
   200 			{
   249 // CVIMPSTUiSearchFieldArray::SetFocusL
   257 // CVIMPSTUiSearchFieldArray::SetFocusL
   250 // -----------------------------------------------------------------------------
   258 // -----------------------------------------------------------------------------
   251 //
   259 //
   252 void CVIMPSTUiSearchFieldArray::SetFocusL(TInt aFieldIndex )
   260 void CVIMPSTUiSearchFieldArray::SetFocusL(TInt aFieldIndex )
   253     {
   261     {
       
   262 	TRACER_AUTO;
   254     if (aFieldIndex >= 0 && aFieldIndex < iFieldArray.Count() && iUiBuilder )
   263     if (aFieldIndex >= 0 && aFieldIndex < iFieldArray.Count() && iUiBuilder )
   255         {
   264         {
   256         MVIMPSTUiSearchField& field = At( aFieldIndex);
   265         MVIMPSTUiSearchField& field = At( aFieldIndex);
   257         
   266         
   258         iUiBuilder->TryChangeFocusL( field.ControlId() );
   267         iUiBuilder->TryChangeFocusL( field.ControlId() );
   264 // CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL
   273 // CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL
   265 // -----------------------------------------------------------------------------
   274 // -----------------------------------------------------------------------------
   266 //
   275 //
   267 TPtrC CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL()
   276 TPtrC CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL()
   268     {
   277     {
       
   278 	TRACER_AUTO;
   269     const TInt count = iFieldArray.Count();
   279     const TInt count = iFieldArray.Count();
   270     
   280     
   271     for(TInt i = 0; i < count; ++i)
   281     for(TInt i = 0; i < count; ++i)
   272         {        
   282         {        
   273         TPtrC text = iFieldArray[i]->FieldData() ;
   283         TPtrC text = iFieldArray[i]->FieldData() ;
   285 // CVIMPSTUiSearchFieldArray::GetSearchKeyDataL
   295 // CVIMPSTUiSearchFieldArray::GetSearchKeyDataL
   286 // -----------------------------------------------------------------------------
   296 // -----------------------------------------------------------------------------
   287 //
   297 //
   288 void CVIMPSTUiSearchFieldArray::GetSearchKeyDataL(RArray<TVIMPSTSearchKeyData>& aKeyDataArray )
   298 void CVIMPSTUiSearchFieldArray::GetSearchKeyDataL(RArray<TVIMPSTSearchKeyData>& aKeyDataArray )
   289     {
   299     {
       
   300 	TRACER_AUTO;
   290     const TInt count = iFieldArray.Count();
   301     const TInt count = iFieldArray.Count();
   291     TPtrC dataPtr(KNullDesC );
   302     TPtrC dataPtr(KNullDesC );
   292     for(TInt i = 0; i < count; ++i)
   303     for(TInt i = 0; i < count; ++i)
   293         {    
   304         {    
   294         MVIMPSTUiSearchField*  field = iFieldArray[i] ;
   305         MVIMPSTUiSearchField*  field = iFieldArray[i] ;