17 |
17 |
18 #include "cntbaseselectionview.h" |
18 #include "cntbaseselectionview.h" |
19 |
19 |
20 #include <hbview.h> |
20 #include <hbview.h> |
21 #include <hblistview.h> |
21 #include <hblistview.h> |
|
22 #include <hblistviewitem.h> |
22 #include <hbindexfeedback.h> |
23 #include <hbindexfeedback.h> |
23 #include <hbscrollbar.h> |
24 #include <hbscrollbar.h> |
24 #include <hbdocumentloader.h> |
25 #include <hbdocumentloader.h> |
25 #include <hbaction.h> |
26 #include <hbaction.h> |
26 #include "cntlistmodel.h" |
27 #include "cntlistmodel.h" |
45 mListView->setFrictionEnabled(true); |
46 mListView->setFrictionEnabled(true); |
46 mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); |
47 mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn); |
47 mListView->verticalScrollBar()->setInteractive(true); |
48 mListView->verticalScrollBar()->setInteractive(true); |
48 mListView->setUniformItemSizes(true); |
49 mListView->setUniformItemSizes(true); |
49 |
50 |
|
51 HbListViewItem* prototype = mListView->listItemPrototype(); |
|
52 |
50 HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView); |
53 HbIndexFeedback *indexFeedback = new HbIndexFeedback(mView); |
51 indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); |
54 indexFeedback->setIndexFeedbackPolicy(HbIndexFeedback::IndexFeedbackSingleCharacter); |
52 indexFeedback->setItemView(mListView); |
55 indexFeedback->setItemView(mListView); |
53 |
56 |
54 mSoftkey = new HbAction(Hb::BackNaviAction, mView); |
57 mSoftkey = new HbAction(Hb::BackNaviAction, mView); |
58 CntBaseSelectionView::~CntBaseSelectionView() |
61 CntBaseSelectionView::~CntBaseSelectionView() |
59 { |
62 { |
60 delete mDocument; |
63 delete mDocument; |
61 } |
64 } |
62 |
65 |
63 void CntBaseSelectionView::activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs ) |
66 void CntBaseSelectionView::activate( const CntViewParameters aArgs ) |
64 { |
67 { |
65 mMgr = aMgr; |
68 mMgr = &mEngine->viewManager(); |
66 |
69 |
67 if ( mView->navigationAction() != mSoftkey) |
70 if ( mView->navigationAction() != mSoftkey) |
68 mView->setNavigationAction(mSoftkey); |
71 mView->setNavigationAction(mSoftkey); |
69 |
|
70 HbMainWindow* window = mView->mainWindow(); |
|
71 if ( window ) |
|
72 { |
|
73 //connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation))); |
|
74 //setOrientation(window->orientation()); |
|
75 } |
|
76 |
72 |
77 QContactDetailFilter filter; |
73 QContactDetailFilter filter; |
78 filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); |
74 filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType); |
79 QString typeContact = QContactType::TypeContact; |
75 QString typeContact = QContactType::TypeContact; |
80 filter.setValue(typeContact); |
76 filter.setValue(typeContact); |
81 |
77 |
82 mListModel = new CntListModel(mMgr->contactManager(SYMBIAN_BACKEND), filter); |
78 mListModel = new CntListModel( &mEngine->contactManager(SYMBIAN_BACKEND), filter); |
83 mListModel->showMyCard( false ); |
79 mListModel->showMyCard( false ); |
84 |
80 |
85 mListView->setModel( mListModel ); |
81 mListView->setModel( mListModel ); |
86 |
82 |
87 if ( aArgs.contains(ESelectionMode) ) { |
83 if ( aArgs.contains(ESelectionMode) ) { |