phonebookui/pbkcommonui/inc/cntfetchcontactpopup.h
changeset 59 a642906a277a
child 61 d30183af6ca6
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 CNTFETCHCONTACTPOPUP_H_
       
    19 #define CNTFETCHCONTACTPOPUP_H_
       
    20 
       
    21 #include <qtcontacts.h>
       
    22 #include <hbabstractitemview.h>
       
    23 #include <QSet>
       
    24 
       
    25 class HbDialog;
       
    26 class HbListView;
       
    27 class HbTextItem;
       
    28 class HbLabel;
       
    29 class HbAction;
       
    30 class HbSearchPanel;
       
    31 class HbStaticVkbHost;
       
    32 
       
    33 class QGraphicsLinearLayout;
       
    34 class QItemSelectionModel;
       
    35 
       
    36 class CntListModel;
       
    37 class CntFetchMarkAll;
       
    38 class CntDocumentLoader;
       
    39 
       
    40 QTM_BEGIN_NAMESPACE
       
    41 class QContactManager;
       
    42 QTM_END_NAMESPACE
       
    43 QTM_USE_NAMESPACE
       
    44 
       
    45 /*!
       
    46   CntFetchContactPopup is simple to use popup for fetching (selecting) number
       
    47   of contacts.
       
    48   
       
    49   \code
       
    50   \endcode
       
    51   
       
    52   Note that by default, CntFetchContactPopup deletes itself when closing the popup.
       
    53 */
       
    54 class CntFetchContactPopup : public QObject
       
    55 {
       
    56     Q_OBJECT
       
    57     
       
    58 public:
       
    59     ~CntFetchContactPopup();
       
    60     
       
    61     static CntFetchContactPopup* createMultiSelectionPopup(  QString aTitle, QString aAction, QContactManager& aContactMgr );
       
    62     static CntFetchContactPopup* createSingleSelectionPopup( QString aTitle, QContactManager& aContactMgr );
       
    63 
       
    64     void setSelectedContacts( QSet<QContactLocalId> aIds );
       
    65     void showPopup();
       
    66     
       
    67 signals:
       
    68     void fetchReady( QSet<QContactLocalId> aIds );
       
    69     void fetchCancelled();
       
    70 
       
    71 private slots:
       
    72     void setFilter( const QString& aFilter );
       
    73     void contactSelected( const QModelIndex& aIndex );
       
    74     void contactsSelected( const QItemSelection & selected, const QItemSelection & deselected );
       
    75     void selectAll( int aState );
       
    76     void dialogDismissed( HbAction* aAction );
       
    77     void loadLayout( Qt::Orientation aOrientation );
       
    78     void handleKeypadOpen();
       
    79     void handleKeypadClosed();
       
    80     void closePopup();
       
    81     
       
    82 private:
       
    83     CntFetchContactPopup( QContactManager& aManager );
       
    84     void constructPopupDialog( QString aTitle, QString aAction, HbAbstractItemView::SelectionMode aMode );
       
    85     
       
    86 private:
       
    87     QContactManager& mManager;
       
    88     QList<QContactLocalId> mIdList;
       
    89     
       
    90     HbDialog* mPopup; // own
       
    91     HbListView* mListView; // own
       
    92     HbTextItem* mEmptyView; // own
       
    93     HbLabel* mHeading; // own
       
    94     HbAction* mPrimaryAction; // own
       
    95     HbSearchPanel* mSearch; //own
       
    96     CntListModel* mModel; // own
       
    97     HbStaticVkbHost* mVirtualKeyboard; // own
       
    98     CntFetchMarkAll* mMarkAll; // own
       
    99     QItemSelectionModel* mSelectionModel; // own
       
   100     CntDocumentLoader* mDoc; // own
       
   101     QString mTitle;
       
   102 };
       
   103 
       
   104 #endif /* CNTFETCHCONTACTPOPUP_H_ */