locationsystemui/locationsysui/privacyverifiernotifierui/posverificationdialogplugin/inc/posverificationdialogplugin.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 POSVERIFICATION_DIALOG_PLUGIN_H
       
    19 #define POSVERIFICATION_DIALOG_PLUGIN_H
       
    20 
       
    21 #include <hbdevicedialogplugin.h>
       
    22 #include <qtranslator.h>
       
    23 
       
    24 class PosVerificationDialogPlugin : public HbDeviceDialogPlugin
       
    25     {
       
    26 Q_OBJECT
       
    27 
       
    28 public:
       
    29     /**
       
    30      * Constructor
       
    31      */
       
    32     PosVerificationDialogPlugin();
       
    33 
       
    34     /**
       
    35      * Destrcutor
       
    36      */
       
    37     ~PosVerificationDialogPlugin();
       
    38 
       
    39     /**
       
    40      * Checks if client is allowed use the device dialog that the plugin creates. 
       
    41      * Device dialog service calls this function before creating a device dialog or 
       
    42      * attaching into an existing one if flag HbDeviceDialogPlugin::SecurityCheck is set. 
       
    43      * The implementation is operating system dependent. 
       
    44      * @returns- bool, Returns true if client is allowed to use the device dialog.
       
    45      * @param[in] - deviceDialogType  Device dialog type.  
       
    46      * @param[in] - parameters  Device dialog parameters.  
       
    47      * @param[in] - securityInfo  Information for security check. Content is operating system dependent.
       
    48      * The format is <key, value> pairs. Currently only Symbian is defined.
       
    49      */
       
    50 
       
    51     bool
       
    52             accessAllowed(const QString &notificationType,
       
    53                     const QVariantMap &parameters,
       
    54                     const QVariantMap &securityInfo) const;
       
    55 
       
    56     /**
       
    57      * Create a device dialog instance compatible with the version requested. 
       
    58      * This could always be the latest version if it is backwards compatible with older versions. 
       
    59      * Device dialog framework is unaware of version numbers in type strings. It performs string 
       
    60      * comparison of the whole string when searching for a plugin
       
    61      * @param[in] - deviceDialogType  Device dialog type.
       
    62      * @param[in] - parameters  Device dialog parameters.  
       
    63      * @returns - HbDeviceDialogInterface, device dialog instance
       
    64      */
       
    65 
       
    66     HbDeviceDialogInterface *createDeviceDialog(
       
    67             const QString &deviceDialogType, const QVariantMap &parameters);
       
    68 
       
    69     /**
       
    70      * Gets information of the device dialog created by the plugin. Device dialog manager calls 
       
    71      * this function before creating the device dialog widget to check HbDeviceDialogPlugin::DeviceDialogGroup, 
       
    72      * HbDeviceDialogPlugin::DeviceDialogFlag and priority. 
       
    73      * @returns - true if device dialog information returned is valid.
       
    74      */
       
    75 
       
    76     bool deviceDialogInfo(const QString &deviceDialogType,
       
    77             const QVariantMap &parameters, DeviceDialogInfo *info) const;
       
    78 
       
    79     /**
       
    80      * Returns a list of device dialog types the plugin implements. A plugin may implement 
       
    81      * several device dialog types. By convention device dialog type strings should follow 
       
    82      * inverted domain name format
       
    83      * @returns - list of device dialog types
       
    84      */
       
    85     QStringList deviceDialogTypes() const;
       
    86 
       
    87     /**
       
    88      * @returns - plugin flags
       
    89      */
       
    90     HbDeviceDialogPlugin::PluginFlags pluginFlags() const;
       
    91 
       
    92     /**
       
    93      * Returns an error last occurred. Error code ranges are defined in HbDeviceDialog. The code 
       
    94      * is passed to a client by device dialog framework
       
    95      * @returns- errorcode
       
    96      */
       
    97     int error() const;
       
    98 
       
    99 private:
       
   100 
       
   101     /**
       
   102      * Fix for ou1cimx1#462081
       
   103      * Loads the qt message file for localization and installs the translator.
       
   104      */
       
   105     void installTranslator();
       
   106 
       
   107 private:
       
   108 
       
   109     /**
       
   110      * instance of translator
       
   111      * owns
       
   112      */
       
   113     QTranslator * mTranslator;
       
   114     };
       
   115 
       
   116 #endif // POSVERIFICATION_DIALOG_PLUGIN_H