cmmanager/cpdestinationplugin/inc/cpdestinationentryitem.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
child 62 bb1f80fb7db2
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
     1 /*
       
     2 * Copyright (c) 2010 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 * This items represents one Destination in UI.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CPDESTINATIONENTRYITEM_H
       
    20 #define CPDESTINATIONENTRYITEM_H
       
    21 
       
    22 // System includes
       
    23 #include <QSharedPointer>
       
    24 #include <cpsettingformentryitemdata.h>
       
    25 #include <cmmanagerdefines_shim.h>
       
    26 
       
    27 // User includes
       
    28 
       
    29 // Forward declarations
       
    30 class QString;
       
    31 class HbMenu;
       
    32 class HbView;
       
    33 class HbListWidget;
       
    34 class HbListWidgetItem;
       
    35 class HbMainWindow;
       
    36 class HbAction;
       
    37 class HbInputDialog;
       
    38 class CpItemDataHelper;
       
    39 class CpIapItem;
       
    40 class CmConnectionMethodShim;
       
    41 class CmManagerShim;
       
    42 
       
    43 // External data types
       
    44 
       
    45 // Constants
       
    46 
       
    47 // Class declaration
       
    48 class CpDestinationEntryItemData : public CpSettingFormEntryItemData
       
    49 {
       
    50     Q_OBJECT
       
    51 public:
       
    52     explicit CpDestinationEntryItemData(CpItemDataHelper &itemDataHelper);
       
    53     virtual ~CpDestinationEntryItemData();
       
    54     
       
    55     int destinationId();
       
    56     void setDestinationId( int destId );
       
    57     QString destinationName();
       
    58     void setDestinationName(const QString destinationName);
       
    59     
       
    60 signals:
       
    61     void destChanged();
       
    62     
       
    63 public slots:
       
    64     void updateDestinationView();
       
    65     void showItemMenu(QPointF position);
       
    66     void openDestination();
       
    67     void renameDestination();
       
    68     void confirmDestinationDelete();
       
    69     void deleteDestination();
       
    70     void activateArrangeMode();
       
    71     void viewDone();
       
    72     void viewCancel();
       
    73     void updateIndex();
       
    74     void saveNewDestinationName();
       
    75     
       
    76 protected:
       
    77     bool eventFilter(QObject *obj, QEvent *event);
       
    78     
       
    79 protected slots:
       
    80     
       
    81 private:
       
    82     virtual CpBaseSettingView *createSettingView() const;
       
    83     void fetchReferencedAps(
       
    84         QList<QSharedPointer<CmConnectionMethodShim> > &apList, const CmManagerShim *cmm) const;
       
    85     bool isDestinationNameValid(QString &destination, const CmManagerShim *cmm);
       
    86     void createArrangeModeView(HbView *view);
       
    87     void constructSettingView(CpBaseSettingView *view) const;
       
    88     HbMenu *createItemMenu(
       
    89         CMManagerShim::CmmProtectionLevel protLvl,
       
    90         const QPointF position);
       
    91     void lauchNewDestinationNameQuery();
       
    92     void showRenameError(const QString &info);
       
    93     void showErrorNote(const QString &info);
       
    94     QString resolveApIcon(QSharedPointer<CmConnectionMethodShim> cm) const; 
       
    95             
       
    96 private slots:
       
    97     
       
    98 private: // data
       
    99     
       
   100     //! Helper for connecting signals to underlying widgets
       
   101     CpItemDataHelper    *mItemDataHelper;
       
   102     //! Unique Destination ID
       
   103     int                 mDestinationId;
       
   104     //! Destination Name
       
   105     QString             mDestinationName;
       
   106     //! List of access points contained by this object
       
   107     QList<CpIapItem*>   *mAps;
       
   108     //! Pointer to CmManager for commsdat operations
       
   109     CmManagerShim       *mCmm;
       
   110     //! Previous view when arrange mode view is shown
       
   111     HbView              *mPreView;
       
   112     //! List of access points for arrange mode
       
   113     HbListWidget        *mList;
       
   114     //! New Destination name query dialog
       
   115     HbInputDialog      *mDialog;
       
   116     //! New Destination name query's OK action
       
   117     HbAction           *mOkAction;
       
   118 };
       
   119 
       
   120 #endif /* CPDESTINATIONENTRYITEM_H */