cmmanager/cpdestinationplugin/inc/cpiapitem.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 *   Data item for representing access points in UI.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CPIAPITEM_H
       
    20 #define CPIAPITEM_H
       
    21 
       
    22 // System includes
       
    23 #include <QObject>
       
    24 #include <QPoint>
       
    25 #include <QModelIndex>
       
    26 #include <cpsettingformentryitemdata.h>
       
    27 #include <cmmanagerdefines_shim.h>
       
    28 
       
    29 // User includes
       
    30 
       
    31 // Forward declarations
       
    32 class HbDialog;
       
    33 class HbRadioButtonList;
       
    34 class HbAction;
       
    35 class HbMenu;
       
    36 class CmManagerShim;
       
    37 class CpBearerApPluginInterface;
       
    38 
       
    39 // External data types
       
    40 
       
    41 // Constants
       
    42 
       
    43 // Class declaration
       
    44 class CpIapItem : public CpSettingFormEntryItemData
       
    45     {
       
    46     Q_OBJECT
       
    47     
       
    48 public:
       
    49     CpIapItem(
       
    50         CpItemDataHelper &itemDataHelper, 
       
    51         int iapId, 
       
    52         const QString &iapName, 
       
    53         int destId,
       
    54         bool apProtected,
       
    55         CpBearerApPluginInterface *bearerPlugin);
       
    56     
       
    57     ~CpIapItem();
       
    58     
       
    59 signals:
       
    60     void iapChanged();
       
    61     
       
    62 public slots:
       
    63     void showItemMenu(QPointF position);
       
    64     void moveIap();
       
    65     void showDeleteConfirmation();
       
    66     void shareIap();
       
    67     void queryDialogClosed();
       
    68     void deleteConfirmed();
       
    69     void updateIap();
       
    70     void openIap();
       
    71 
       
    72 protected:
       
    73     
       
    74 protected slots:
       
    75 
       
    76 private:
       
    77     virtual CpBaseSettingView *createSettingView() const;
       
    78     void queryDestination();
       
    79     void saveMove(int id);
       
    80     void saveShare(int id);
       
    81     bool isCmManagerAvailable();
       
    82     HbMenu *createItemMenu(
       
    83         bool cmConnected,
       
    84         const QPointF &position);
       
    85     void showErrorNote(const QString &info);
       
    86 
       
    87 private slots:
       
    88 
       
    89 private: // data 
       
    90     //! Unique ID for access point
       
    91     int                         mIapId;
       
    92     //! Access point name
       
    93     QString                     mIapName;
       
    94     //! ID of the destination referencing this access point
       
    95     int                         mDestId;
       
    96     //! Helper for connecting signals to underlying widgets
       
    97     CpItemDataHelper            *mItemDataHelper;
       
    98     //! Pointer to CmManager for commsdat operations
       
    99     CmManagerShim               *mCmm;
       
   100     //! Plugin that implements settings view for this access point
       
   101     CpBearerApPluginInterface   *mBearerPlugin;
       
   102     
       
   103     //! Variable showing if access point move transaction is ongoing
       
   104     bool                        mMoveOngoing;
       
   105     //! Target destination query dialog. Used for move and share
       
   106     HbDialog                    *mDialog;
       
   107     //! Dialog's OK action
       
   108     HbAction                    *mOk;
       
   109     //! List of available destinations' IDs
       
   110     QList<uint>                 mDestinationList;
       
   111     //! List of available destinations
       
   112     HbRadioButtonList           *mList;
       
   113 };
       
   114 
       
   115 #endif // CPIAPITEM_H