16 */ |
16 */ |
17 |
17 |
18 #include "cntaddressmodel.h" |
18 #include "cntaddressmodel.h" |
19 #include "cntdetailmodelitem.h" |
19 #include "cntdetailmodelitem.h" |
20 #include "cntdetailconst.h" |
20 #include "cntdetailconst.h" |
21 #include <cntmaptileservice.h> |
21 #include <maptileservice.h> |
22 |
22 |
23 CntAddressModel::CntAddressModel( QContact* aContact ): |
23 CntAddressModel::CntAddressModel( QContact* aContact ): |
24 CntDetailEditorModel( aContact ), |
24 CntDetailEditorModel( aContact ), |
25 mAddress(NULL), |
25 mAddress(NULL), |
26 mAddressHome(NULL), |
26 mAddressHome(NULL), |
27 mAddressWork(NULL), |
27 mAddressWork(NULL), |
28 mIsLocationPickerEnabled( false ) |
28 mIsLocationPickerEnabled( false ) |
29 { |
29 { |
30 mMaptileInterface = new CntMapTileService; |
30 mMaptileInterface = new MapTileService; |
31 HbDataFormModelItem* address = appendDataFormGroup(hbTrId("txt_phob_formlabel_address"), invisibleRootItem()); |
31 HbDataFormModelItem* address = appendDataFormGroup(hbTrId("txt_phob_formlabel_address"), invisibleRootItem()); |
32 HbDataFormModelItem* addressHome = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_home"), invisibleRootItem()); |
32 HbDataFormModelItem* addressHome = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_home"), invisibleRootItem()); |
33 HbDataFormModelItem* addressWork = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_work"), invisibleRootItem()); |
33 HbDataFormModelItem* addressWork = appendDataFormGroup(hbTrId("txt_phob_formlabel_address_work"), invisibleRootItem()); |
34 |
34 |
35 foreach ( QContactAddress a, mContact->details<QContactAddress>() ) |
35 foreach ( QContactAddress a, mContact->details<QContactAddress>() ) |
89 } |
89 } |
90 |
90 |
91 void CntAddressModel::createAddressItems( HbDataFormModelItem* aGroup, QContactAddress* aAddress ) |
91 void CntAddressModel::createAddressItems( HbDataFormModelItem* aGroup, QContactAddress* aAddress ) |
92 { |
92 { |
93 //Show the location picker button only if location feature enabled |
93 //Show the location picker button only if location feature enabled |
94 if( mMaptileInterface->isLocationFeatureEnabled() ) |
94 if( mMaptileInterface->isLocationFeatureEnabled(MapTileService::AppTypeContacts) ) |
95 { |
95 { |
96 // custom item for map button |
96 // custom item for map button |
97 HbDataFormModelItem* mapButton = new HbDataFormModelItem( HbDataFormModelItem::CustomItemBase ); |
97 HbDataFormModelItem* mapButton = new HbDataFormModelItem( HbDataFormModelItem::CustomItemBase ); |
98 appendDataFormItem( mapButton, aGroup ); |
98 appendDataFormItem( mapButton, aGroup ); |
99 mIsLocationPickerEnabled = true; |
99 mIsLocationPickerEnabled = true; |