serviceproviders/sapi_landmarks/src/clandmarkiterable.cpp
changeset 26 5d0ec8b709be
parent 23 50974a8b132e
equal deleted inserted replaced
23:50974a8b132e 26:5d0ec8b709be
    20 #include <EPos_CPosLandmark.h>
    20 #include <EPos_CPosLandmark.h>
    21 #include <EPos_CPosLandmarkDatabase.h>
    21 #include <EPos_CPosLandmarkDatabase.h>
    22 #include <EPos_CPosLmItemIterator.h>
    22 #include <EPos_CPosLmItemIterator.h>
    23 #include <lbsposition.h>
    23 #include <lbsposition.h>
    24 #include "clandmarkiterable.h"
    24 #include "clandmarkiterable.h"
       
    25 #include "clandmarkmanagehandlers.h"
    25 #include "landmarkliwparams.hrh"
    26 #include "landmarkliwparams.hrh"
    26 
    27 
    27 // ============================ MEMBER FUNCTIONS ===============================
    28 // ============================ MEMBER FUNCTIONS ===============================
    28 
    29 
    29 // -----------------------------------------------------------------------------
    30 // -----------------------------------------------------------------------------
    77     delete iLandmark;
    78     delete iLandmark;
    78     delete iDatabase;
    79     delete iDatabase;
    79     delete iLandmarkId;
    80     delete iLandmarkId;
    80     iCategoryIds.ResetAndDestroy();
    81     iCategoryIds.ResetAndDestroy();
    81     iCategoryIds.Close();
    82     iCategoryIds.Close();
       
    83     if (iHandler && !iHandler->DecRef())
       
    84         {
       
    85         delete iHandler;
       
    86         }
    82     ReleaseLandmarkResources();
    87     ReleaseLandmarkResources();
    83     }
    88     }
    84 
    89 
       
    90  void CLandmarkIterable::SetHandler(CLandmarkHandler* aHandler)
       
    91      {
       
    92      iHandler = aHandler;
       
    93      iHandler->IncRef();
       
    94      }
    85 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    86 // CLandmarkIterable::Reset()
    96 // CLandmarkIterable::Reset()
    87 // Resets the iterator. NextL has to be called to retrieve the first item.
    97 // Resets the iterator. NextL has to be called to retrieve the first item.
    88 // -----------------------------------------------------------------------------
    98 // -----------------------------------------------------------------------------
    89 //
    99 //
   247                 }
   257                 }
   248             if ( EPositionFieldBuildingTelephone == fieldId)
   258             if ( EPositionFieldBuildingTelephone == fieldId)
   249                 {
   259                 {
   250                 fieldMap->InsertL(KLandmarkTelephone,variant);
   260                 fieldMap->InsertL(KLandmarkTelephone,variant);
   251                 }
   261                 }
       
   262             if ( EPositionFieldState == fieldId)
       
   263                 {
       
   264                 fieldMap->InsertL(KLandmarkstate,variant);
       
   265                 }
   252             fieldId = iLandmark->NextPositionFieldId(fieldId);
   266             fieldId = iLandmark->NextPositionFieldId(fieldId);
   253             }
   267             }
   254         landmarkMap->InsertL(KLandmarkFields,TLiwVariant(fieldMap));
   268         landmarkMap->InsertL(KLandmarkFields,TLiwVariant(fieldMap));
   255         CleanupStack::PopAndDestroy (fieldMap );
   269         CleanupStack::PopAndDestroy (fieldMap );
   256         variant.Reset();
   270         variant.Reset();
   261     aEntry.SetL(landmarkMap);
   275     aEntry.SetL(landmarkMap);
   262     CleanupStack::PopAndDestroy (landmarkMap );
   276     CleanupStack::PopAndDestroy (landmarkMap );
   263     
   277     
   264     return ETrue;
   278     return ETrue;
   265     }
   279     }
       
   280 void CLandmarkIterable::Close()
       
   281     {
       
   282     DecRef();
       
   283     }
   266 
   284 
   267 //end of file
   285 //end of file