locationsystemui/locationsysui/privacyverifiernotifierui/posverificationdialogplugin/inc/posverificationcustomdialog.h
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     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: Header file for Custom PosVerification dialog
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef POSVERIFICATIONCUSTOMDIALOG_H
       
    19 #define POSVERIFICATIONCUSTOMDIALOG_H
       
    20 
       
    21 #include <hbdialog.h>
       
    22 #include <hbdevicedialoginterface.h>
       
    23 #include <hblabel.h>
       
    24 #include <hbaction.h>
       
    25 
       
    26 
       
    27 class CustomDocumentLoader;
       
    28 
       
    29 class PosVerificationCustomDialog : public HbDialog,
       
    30         public HbDeviceDialogInterface
       
    31 
       
    32     {
       
    33 Q_OBJECT
       
    34 Q_PROPERTY( QString heading READ getHeading WRITE setHeading )
       
    35 Q_PROPERTY( QString queryText READ getQueryText WRITE setQueryText )
       
    36 Q_PROPERTY( QString queryText2 READ getQueryText2 WRITE setQueryText2 )
       
    37 Q_PROPERTY( QStringList requestor READ getRequestor WRITE setRequestor )
       
    38 
       
    39 public:
       
    40 
       
    41     /*
       
    42      * Constructor
       
    43      */
       
    44     PosVerificationCustomDialog();
       
    45 
       
    46     /**
       
    47      * Destructor
       
    48      */
       
    49     ~PosVerificationCustomDialog();
       
    50 
       
    51 public:
       
    52     /**
       
    53      * This method gets the widget from the application desginer docml file.
       
    54      * param[in]- loader, instance of CustomDocumentLoader
       
    55      */
       
    56     void getWidgets(const CustomDocumentLoader &loader);
       
    57 
       
    58     //from HbDeviceDialogInterface
       
    59 public:
       
    60     /**
       
    61      * Set device dialog widget parameters. This function may be called after the widget is created 
       
    62      * to update widget parameters. parameters contains widget parameters.The structure and meaning
       
    63      * of parameters is a contract between the plugin and a client. 
       
    64      * @param[in] - parameters, QVariantMap, containing the key value pair for the properties
       
    65      * @returns- bool, Returns true on success or false on failure.
       
    66      */
       
    67     bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    68 
       
    69     /**
       
    70      * Returns an error last occurred. Error code ranges are defined in HbDeviceDialog.
       
    71      * The code is passed to a client by device dialog framework
       
    72      * @returns- int, error code 
       
    73      */
       
    74     int deviceDialogError() const;
       
    75 
       
    76     /**
       
    77      * Closes a device dialog widget gracefully. This function may called due to device dialog client
       
    78      * calling HbDeviceDialog::cancel() or by device dialog service if it decides that a dialog needs 
       
    79      * to be closed. Device dialog widget may also close itself without this function being called. 
       
    80      * byClient is true if client initiated the closing. Otherwise the closing was initiated by the device
       
    81      * dialog framework. The widget may also be deleted at any time ungracefully without closeDeviceDialog()
       
    82      * being called.
       
    83      */
       
    84     void closeDeviceDialog(bool byClient);
       
    85 
       
    86     /**
       
    87      * Returns a pointer to a widget that implements the user interface of the device dialog.
       
    88      * @returns-  HbPopup, pointer to the widget
       
    89      */
       
    90     HbPopup * deviceDialogWidget() const;
       
    91     
       
    92 signals:
       
    93     void deviceDialogClosed();
       
    94     void deviceDialogData(QVariantMap data);
       
    95 
       
    96 private:
       
    97 
       
    98     /**
       
    99      * This method is used to set the name of requestors 
       
   100      * requesting for position, in the verification dialog
       
   101      * @param [in] - requestorList, list of names of the requestors
       
   102      */
       
   103     void setRequestor(QStringList& requestorList);
       
   104 
       
   105     /**
       
   106      * This method is used to gets the name of requestors 
       
   107      * requesting for position, in the verification dialog
       
   108      * @returns - QStringList, list of names of the requestors
       
   109      */
       
   110     QStringList getRequestor();
       
   111 
       
   112     /**
       
   113      * This method is used to set the heading for the dialog
       
   114      * @param [in] - heading, string to be set as the heading for the dialog
       
   115      */
       
   116     void setHeading(QString& heading);
       
   117 
       
   118     /**
       
   119      * This method is used to get the heading for the dialog
       
   120      * @returns - QString, heading for the dialog
       
   121      */
       
   122     QString getHeading();
       
   123 
       
   124     /**
       
   125      * This method is used to set the query text to be displayed, depending on the 
       
   126      * policy.
       
   127      * @param [in] - textQuery, string to be set as the query for the dialog
       
   128      */
       
   129     void setQueryText(QString& textQuery);
       
   130 
       
   131     /**
       
   132      * This method is used to get the query text displayed, depending on the 
       
   133      * policy.
       
   134      * @returns - QString, query for the dialog
       
   135      */
       
   136     QString getQueryText();
       
   137 
       
   138     /**
       
   139      * This method is used to set the query text to be displayed, depending on the 
       
   140      * policy.
       
   141      * @param [in] - textQuery, string to be set as the query line 2 for the dialog
       
   142      */
       
   143     void setQueryText2(QString& textQuery);
       
   144 
       
   145     /**
       
   146      * This method is used to get the query text line 2 displayed, depending on the 
       
   147      * policy.
       
   148      * @returns - QString, query line 2 for the dialog
       
   149      */
       
   150     QString getQueryText2();
       
   151 
       
   152     /**
       
   153      * This method sets the properties for the widget.
       
   154      * The property value is validated before the property is set.
       
   155      * @param[in] - parameters, QVariantMap, containing the key value pair for the properties
       
   156      * @returns- bool, Returns true on success or false on failure.
       
   157      */
       
   158     bool setProperties(const QVariantMap& parameters);
       
   159 
       
   160 private slots:
       
   161     /**
       
   162      * This slot is called on acceting the query dialog
       
   163      */
       
   164     void posVerificationdlgAccepted();
       
   165 
       
   166     /**
       
   167      * This slot is called on rejecting the query dialog 
       
   168      */
       
   169     void posVerificationdlgRejected();
       
   170 
       
   171     //member data
       
   172 private:
       
   173     /**
       
   174      * heading label for the device dialog
       
   175      * Owns
       
   176      */
       
   177     HbLabel * mHeadingLabel;
       
   178     
       
   179     /**
       
   180      * primary action (SK1) for the device dialog
       
   181      * owns
       
   182      */
       
   183     HbAction * mPrimaryAction;
       
   184 
       
   185     /**
       
   186      * query text label
       
   187      * owns
       
   188      */
       
   189     HbLabel * mQueryText;
       
   190 
       
   191     /**
       
   192      * query text label (line 2)
       
   193      * Changes as per the first query text
       
   194      * owns
       
   195      */
       
   196     HbLabel * mQueryText2;
       
   197 
       
   198     /**
       
   199      * Widget containing the list of the requestors
       
   200      * owns
       
   201      */
       
   202     HbWidget * mRequestorList;
       
   203     
       
   204     /**
       
   205      * list of names of the reqestors
       
   206      * owns
       
   207      */
       
   208     QStringList mRequestorListItems;
       
   209 
       
   210     /**
       
   211      * secondry action (SK2) for the device dialog
       
   212      * owns
       
   213      */
       
   214     HbAction * mSecondryAction;
       
   215 
       
   216     };
       
   217 
       
   218 #endif // POSVERIFICATIONCUSTOMDIALOG_H