phonebookui/pbkcommonui/inc/cntimportsview.h
changeset 31 2a11b5b00470
child 40 b46a585f6909
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 CNTIMPORTSVIEW_H_
       
    19 #define CNTIMPORTSVIEW_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <hbpushbutton.h>
       
    23 #include <hblistview.h>
       
    24 
       
    25 //#include "cntabstractview.h"
       
    26 #include "cntactionmenubuilder.h"
       
    27 #include <hbdocumentloader.h>
       
    28 #include "simutility.h"
       
    29 
       
    30 #include <cntabstractview.h>
       
    31 
       
    32 class CntAbstractViewManager;
       
    33 class HbView;
       
    34 class HbAction;
       
    35 class QStandardItemModel;
       
    36 class SimUtility;
       
    37 class HbDialog;
       
    38 
       
    39 QTM_BEGIN_NAMESPACE
       
    40 class QContact;
       
    41 QTM_END_NAMESPACE
       
    42 
       
    43 QTM_USE_NAMESPACE
       
    44 
       
    45 class CntImportsView : public QObject, public CntAbstractView
       
    46 {
       
    47 
       
    48 Q_OBJECT
       
    49 
       
    50 public slots:
       
    51 
       
    52     void onListViewActivated(const QModelIndex &index);
       
    53     void stopSimImport();
       
    54     void importFetchResultReceivedADN();
       
    55     void importFetchResultReceivedSDN();
       
    56     void adnCacheStatusReady(SimUtility::CacheStatus& cacheStatus, int error);
       
    57      
       
    58 public:
       
    59 CntImportsView();
       
    60     ~CntImportsView();
       
    61 
       
    62 public: // From CntAbstractView
       
    63     void activate( CntAbstractViewManager* aMgr, const CntViewParameters aArgs );
       
    64     void deactivate();
       
    65     bool isDefault() const { return false; }
       
    66     HbView* view() const { return mView; }
       
    67     int viewId() const { return importsView; }
       
    68 	void simInfoErrorMessage(int infoError);
       
    69     bool startSimImport();
       
    70     void fetchSDNContacts();
       
    71 
       
    72 protected:
       
    73     void timerEvent(QTimerEvent *event);
       
    74     
       
    75 private:
       
    76     void showWaitNote();
       
    77     void showSimImportResults() const;
       
    78         
       
    79 #ifdef PBK_UNIT_TEST
       
    80 public slots:
       
    81 #else
       
    82 private slots:
       
    83 #endif
       
    84     void showPreviousView();
       
    85         
       
    86 #ifdef PBK_UNIT_TEST
       
    87 public :
       
    88 #else
       
    89 private :
       
    90 #endif  
       
    91    // QContact* mContact;
       
    92     CntAbstractViewManager* mViewManager;
       
    93 	QContactManager *mContactSimManagerADN;
       
    94 	QContactManager *mContactSimManagerSDN;
       
    95 	QContactManager *mContactSymbianManager;
       
    96     QContactFetchRequest *mFetchRequestADN;
       
    97     QContactFetchRequest *mFetchRequestSDN;
       
    98     HbListView              *mListView;
       
    99     HbDocumentLoader mDocumentLoader;
       
   100     HbView* mView; // own
       
   101     HbAction* mSoftkey;
       
   102 	QStandardItemModel* mModel;
       
   103     SimUtility *mSimUtility;
       
   104     bool mAdnEntriesPresent;
       
   105     HbDialog *mImportSimPopup;
       
   106     int mSaveCount;
       
   107     QList<QContact> mSaveSimContactsList;
       
   108     QList<QContact> mSaveSimContactsListSDN;
       
   109     QTimer *mTimer;
       
   110     bool mFetchIsDone;
       
   111     int mTimerId;
       
   112     bool mAdnStorePresent;
       
   113     bool mSdnStorePresent;
       
   114     bool mSimPresent;
       
   115     int mAdnStoreEntries;
       
   116     bool mSimError;
       
   117     bool mWaitingForAdnCache;
       
   118 };
       
   119 
       
   120 #endif /* CNTIMPORTSVIEW_H_ */