phonebookui/pbkcommonui/inc/cntfetchcontactsview.h
changeset 31 2a11b5b00470
child 37 fd64c38c277d
equal deleted inserted replaced
27:de1630741fbe 31:2a11b5b00470
       
     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 MobCntModel;
       
    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     enum DisplayType {
       
    53         view,
       
    54         popup
       
    55     };
       
    56     
       
    57 private slots:
       
    58     void memberSelectionChanged(const QModelIndex &index);
       
    59     
       
    60     void closeFind();
       
    61     void setFilter(const QString &filterString);
       
    62     
       
    63     void handleKeypadOpen();
       
    64     void handleKeypadClose();
       
    65     
       
    66     void handleUserResponse(HbAction* action);
       
    67     
       
    68 public:
       
    69     void displayContacts(DisplayType aType, HbAbstractItemView::SelectionMode aMode, QSet<QContactLocalId> aContacts);
       
    70     
       
    71     QSet<QContactLocalId> getSelectedContacts() const;
       
    72     bool wasCanceled() const;
       
    73     void setDetails(QString aTitle, QString aButtonText);
       
    74 
       
    75 private:
       
    76     void doInitialize(HbAbstractItemView::SelectionMode aMode,
       
    77                                   QSet<QContactLocalId> aContacts);
       
    78     void connectSignal();
       
    79     void showPopup();
       
    80     void markMembersInView();
       
    81     
       
    82 signals:
       
    83     void clicked();
       
    84 
       
    85 private:
       
    86     HbDialog*                          mPopup;
       
    87     HbSearchPanel*                     mSearchPanel;
       
    88     MobCntModel*                       mCntModel;
       
    89     HbListView*                        mListView;
       
    90     QGraphicsLinearLayout*             mLayout;
       
    91     HbTextItem*                        mEmptyListLabel;
       
    92     HbWidget*                          mContainerWidget;
       
    93     HbAbstractItemView::SelectionMode  mSelectionMode;
       
    94     QSet<QContactLocalId>              mCurrentlySelected;
       
    95     QContactManager*                   mManager;
       
    96     bool                               mWasCanceled;
       
    97     HbLabel*                           mLabel;
       
    98     HbStaticVkbHost*                   mVirtualKeyboard;
       
    99     QString                            mButtonText;
       
   100     HbAction*                          mPrimaryAction;
       
   101     HbAction*                          mSecondaryAction;
       
   102     HbIndexFeedback*                   mIndexFeedback;
       
   103     };
       
   104 
       
   105 #endif /* CntFetchContacts_H_ */