usbuis/usbuiqt/inc/usbmainview.h
changeset 43 4712310216c0
equal deleted inserted replaced
3:47c263f7e521 43:4712310216c0
       
     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 USBMAINVIEW_H
       
    19 #define USBMAINVIEW_H
       
    20 
       
    21 #include <hbview.h>
       
    22 #include <QObject>
       
    23 
       
    24 class UsbUiSettingModel;
       
    25 class QGraphicsLinearLayout;
       
    26 class HbListWidgetItem;
       
    27 class HbListWidget;
       
    28 class HbTextEdit;
       
    29 class HbRadioButtonList;
       
    30 
       
    31 class UsbMainView : public HbView
       
    32 {
       
    33     Q_OBJECT
       
    34     friend class TestUsbUiModelActive;
       
    35 
       
    36 public:
       
    37     explicit UsbMainView( QObject *parent = 0 );
       
    38     virtual ~UsbMainView();
       
    39     
       
    40 public slots: 
       
    41     /**
       
    42      * Update view item(s) between the selected rows.
       
    43      * @param topLeft The top row index
       
    44      * @param bottomRight The bottom row index
       
    45      */
       
    46     void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight);
       
    47     
       
    48     /*
       
    49      * Set the personality user has selected in the radio button list
       
    50      * @param personalityIndex The selection index in the radio button list
       
    51      */
       
    52     void setPersonality( int personalityIndex );
       
    53 
       
    54 signals:
       
    55     
       
    56 private:
       
    57     /*
       
    58      * creates the main view window row by row
       
    59      */
       
    60     void createMainView();
       
    61     /*
       
    62      * creates the first row in the view containing an icon and a mode name
       
    63      * @param  localPropertiesGroup main view layout
       
    64      */
       
    65     void createIconNameRow(QGraphicsLinearLayout *localPropertiesGroup);
       
    66     /*
       
    67      * creates the second row from the view containing the description of the selected mode
       
    68      * @param  localPropertiesGroup main view layout
       
    69      */
       
    70     void createDescriptionArea(QGraphicsLinearLayout *localPropertiesGroup);
       
    71     /*
       
    72      * creates the third row from the view containing the radio button list of the existing usb modes
       
    73      * @param  localPropertiesGroup main view layout
       
    74      */
       
    75     void createRadioButtonArea(QGraphicsLinearLayout *localPropertiesGroup);
       
    76        
       
    77 private:
       
    78     // main view layout owned by this class
       
    79     QGraphicsLinearLayout *mMainLayout; 
       
    80     // setting model not owned by the view,
       
    81     // has to be deleted
       
    82     UsbUiSettingModel *mModel;
       
    83     //owned by the view
       
    84     HbListWidgetItem *mListItem;
       
    85     // owned by the view
       
    86     HbListWidget *mlist;
       
    87     // owned by the view
       
    88     HbTextEdit *mlabel;
       
    89     // owned by the view
       
    90     HbRadioButtonList *mradio;
       
    91     // not owned by the view
       
    92     // need to be deleted
       
    93     HbIcon *mIcon ;
       
    94 };
       
    95 
       
    96 #endif /* USBMAINVIEW_H */