phonebookui/pbkcommonui/inc/cntfetchcontactsview.h
changeset 59 a642906a277a
parent 47 7cbcb2896f0e
child 65 ae724a111993
equal deleted inserted replaced
47:7cbcb2896f0e 59:a642906a277a
     1 /*
       
     2 * Copyright (c) 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 #ifndef CntFetchContacts_H_
       
    19 #define CntFetchContacts_H_
       
    20 
       
    21 #include <hbabstractitemview.h>
       
    22 #include <hbwidget.h>
       
    23 #include <hbtextitem.h>
       
    24 #include <cntviewparams.h>
       
    25 #include <QSet>
       
    26 
       
    27 class HbDialog;
       
    28 class HbSearchPanel;
       
    29 class HbAction;
       
    30 class HbListView;
       
    31 class HbLabel;
       
    32 class HbStaticVkbHost;
       
    33 class HbIndexFeedback;
       
    34 
       
    35 class CntListModel;
       
    36 class QGraphicsLinearLayout;
       
    37 
       
    38 QTM_BEGIN_NAMESPACE
       
    39 class QContact;
       
    40 QTM_END_NAMESPACE
       
    41 
       
    42 QTM_USE_NAMESPACE
       
    43 
       
    44 class CntFetchContacts : public QObject
       
    45     {
       
    46     Q_OBJECT
       
    47 
       
    48 public:
       
    49     CntFetchContacts(QContactManager &aManager);
       
    50     ~CntFetchContacts();
       
    51     
       
    52 private slots:
       
    53     void memberSelectionChanged(const QModelIndex &index);
       
    54     
       
    55     void setFilter(const QString &filterString);
       
    56     
       
    57     void handleKeypadOpen();
       
    58     void handleKeypadClose();
       
    59     
       
    60     void handleUserResponse(HbAction* action);
       
    61     
       
    62 public:
       
    63     void displayContacts(HbAbstractItemView::SelectionMode aMode,
       
    64                                      QSet<QContactLocalId> aContacts);
       
    65     
       
    66     QSet<QContactLocalId> getSelectedContacts() const;
       
    67     bool wasCanceled() const;
       
    68     void setDetails(QString aTitle, QString aButtonText);
       
    69 
       
    70 private:
       
    71     void doInitialize(HbAbstractItemView::SelectionMode aMode,
       
    72                                   QSet<QContactLocalId> aContacts);
       
    73     void showPopup();
       
    74     void markMembersInView();
       
    75     
       
    76 signals:
       
    77     void clicked();
       
    78     
       
    79 private:
       
    80     HbDialog*                          mPopup;
       
    81     HbSearchPanel*                     mSearchPanel;
       
    82     CntListModel*                      mCntModel;
       
    83     HbListView*                        mListView;
       
    84     QGraphicsLinearLayout*             mLayout;
       
    85     HbTextItem*                        mEmptyListLabel;
       
    86     HbWidget*                          mContainerWidget;
       
    87     HbAbstractItemView::SelectionMode  mSelectionMode;
       
    88     QSet<QContactLocalId>              mCurrentlySelected;
       
    89     QContactManager*                   mManager;
       
    90     bool                               mWasCanceled;
       
    91     HbLabel*                           mLabel;
       
    92     HbStaticVkbHost*                   mVirtualKeyboard;
       
    93     QString                            mButtonText;
       
    94     HbAction*                          mPrimaryAction;
       
    95     HbAction*                          mSecondaryAction;
       
    96     HbIndexFeedback*                   mIndexFeedback;
       
    97     
       
    98     friend class TestCntFetchUtility;
       
    99     friend class TestCntMyCardView;
       
   100     };
       
   101 
       
   102 #endif /* CntFetchContacts_H_ */