testfwuis/symbianunittestui/qt/dialogsettings.h
changeset 2 453d490c84a5
equal deleted inserted replaced
1:753e33780645 2:453d490c84a5
       
     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: Dialog class to set options when running tests.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIALOGSETTINGS_H_
       
    19 #define DIALOGSETTINGS_H_
       
    20 #include <QDialog>
       
    21 #include <QStringList>
       
    22 
       
    23 class QCheckBox;
       
    24 class QLabel;
       
    25 class QLineEdit;
       
    26 class QComboBox;
       
    27 class QPushButton;
       
    28 class Settings;
       
    29 
       
    30 class DialogSettings: public QDialog
       
    31     {
       
    32     Q_OBJECT
       
    33     
       
    34 public:
       
    35     DialogSettings(QWidget* parent = 0);
       
    36     virtual ~DialogSettings();
       
    37     
       
    38 public:
       
    39     void restoreSettings();
       
    40     
       
    41 private:
       
    42     void createTimeoutSettings();
       
    43     void setupTimeoutSettingsEventHandlers();
       
    44     void createOutputFormatSettings();
       
    45     void setupOutputFormatSettingsEventHandlers();
       
    46     void createMemSimSettings();
       
    47     void setupMemSimSettingsEventHandlers();
       
    48     void createButtons();
       
    49     void setupButtonsEventHandlers();
       
    50     void load();
       
    51     void setLayout();    
       
    52     QWidget* setTimeoutCtlsLayout();
       
    53     QWidget* setOutputCtlsLayout();
       
    54     QWidget* setButtonsLayout();
       
    55     QWidget* setMemAllocFailureSimCtrlLayout();
       
    56     void setBtnSaveEnabled();
       
    57     bool getTimeout(int *);
       
    58     
       
    59 signals:
       
    60     void settingsSaved(const Settings*);
       
    61     
       
    62 private slots:
       
    63     void setLineEditTimeoutEnabled(int chkState);
       
    64     void setComboxFormatEnabled(int chkState);
       
    65     void setMemAllocFailureSim(int chkState);
       
    66     void changeIndex(int);
       
    67     void changeText(const QString&);
       
    68     void saveSettings();
       
    69     
       
    70 private:    
       
    71     QCheckBox*      chkBoxTimeout;
       
    72     QCheckBox*      chkBoxMemAllocFailureSim;
       
    73     QCheckBox*      chkBoxOutputFormat;
       
    74     QLabel*         labelTimeoutUnit;
       
    75     QLineEdit*      lineEditTimeout;
       
    76     QComboBox*      comboBoxOutputFormat;
       
    77     QPushButton*    btnSave;
       
    78     QPushButton*    btnCancel;
       
    79     
       
    80     // Populated data
       
    81     QStringList listFormats;
       
    82     
       
    83     // Data
       
    84     Settings* savedSettings;
       
    85     };
       
    86 
       
    87 #endif /* DIALOGSETTINGS_H_ */