coreapplicationuis/hbdeviceinputdialogplugin/inc/hbdeviceinputdialogwidget_p.h
branchRCL_3
changeset 19 924385140d98
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
       
     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  *   
       
    16 ****************************************************************************/
       
    17 
       
    18 #ifndef HBDEVICEINPUTDIALOGWIDGET_P_H
       
    19 #define HBDEVICEINPUTDIALOGWIDGET_P_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QVariantMap>
       
    23 
       
    24 #include <hbdevicedialoginterface.h>
       
    25 #include <hbdevicedialog.h>
       
    26 #include <hbinputdialog.h>
       
    27 #include <hbTranslator.h>
       
    28 
       
    29 class HbDialog;
       
    30 
       
    31 class HbDeviceInputDialogWidget : public HbInputDialog, public HbDeviceDialogInterface
       
    32 {
       
    33     Q_OBJECT
       
    34     Q_PROPERTY(QString primaryActionText READ primaryActionText WRITE setPrimaryActionText)
       
    35     Q_PROPERTY(QString secondaryActionText READ secondaryActionText WRITE setSecondaryActionText)
       
    36     Q_PROPERTY(bool primaryActionNull READ primaryActionNull WRITE setPrimaryActionNull)
       
    37     Q_PROPERTY(bool secondaryActionNull READ secondaryActionNull WRITE setSecondaryActionNull)
       
    38     Q_PROPERTY(QString animationDefinition READ animationDefinition WRITE setAnimationDefinition)
       
    39 
       
    40 public:
       
    41     HbDeviceInputDialogWidget(const QVariantMap &parameters);
       
    42     ~HbDeviceInputDialogWidget();
       
    43 
       
    44     bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    45     int deviceDialogError() const;
       
    46     void closeDeviceDialog(bool byClient);
       
    47     HbDialog *deviceDialogWidget() const;
       
    48 
       
    49 public slots:
       
    50     void primaryActionTriggered();
       
    51     void secondaryActionTriggered();
       
    52     void closeDialog();
       
    53 
       
    54 private:
       
    55     bool preConstructDialog();
       
    56     bool constructDialog(const QVariantMap &parameters);
       
    57     bool checkProperties(const QVariantMap &parameters);
       
    58     void setProperties(const QVariantMap &parameters);
       
    59     void resetProperties();
       
    60     QString primaryActionText() const;
       
    61     void setPrimaryActionText(QString &actionText);
       
    62     QString secondaryActionText() const;
       
    63     void setSecondaryActionText(QString &actionText);
       
    64     bool primaryActionNull() const;
       
    65     void setPrimaryActionNull(bool null);
       
    66     bool secondaryActionNull() const;
       
    67     void setSecondaryActionNull(bool null);
       
    68     void hideEvent(QHideEvent *event);
       
    69     void showEvent(QShowEvent *event);
       
    70     void setAnimationDefinition(QString &animationDefinition);
       
    71     QString animationDefinition() const;
       
    72 
       
    73 signals:
       
    74     void deviceDialogClosed();
       
    75     void deviceDialogData(QVariantMap data);  //used to send the inputted text from server to client
       
    76 
       
    77 private:
       
    78     Q_DISABLE_COPY(HbDeviceInputDialogWidget)
       
    79 
       
    80     int             mLastError;
       
    81     int             mDeviceDialogError;             //DeviceDialogError
       
    82     int 						mHack;
       
    83 
       
    84     QString         mPrimaryActionText;
       
    85     QString         mSecondaryActionText;
       
    86     bool            mPrimaryActionNull;
       
    87     bool            mSecondaryActionNull;
       
    88     int             mSendAction;
       
    89     bool            mShowEventReceived;
       
    90     QString         mAnimationDefinition;
       
    91     QVariantMap     data;
       
    92     HbAction*       mPrimaryAction;
       
    93     HbAction*       mSecondaryAction;
       
    94     HbTranslator*   mHbTranslator;     
       
    95 };
       
    96 
       
    97 #endif // HBDEVICEINPUTDIALOGWIDGET_P_H