src/hbcore/devicedialogbase/hbdevicedialogplugin.h
changeset 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbCore module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBDEVICEDIALOGPLUGIN_H
       
    27 #define HBDEVICEDIALOGPLUGIN_H
       
    28 
       
    29 #include <QObject>
       
    30 #include <QVariantMap>
       
    31 #include <QStringList>
       
    32 #include <QtPlugin>
       
    33 #include <QFlags>
       
    34 
       
    35 #include <hbglobal.h>
       
    36 #include <hbdevicedialog.h>
       
    37 
       
    38 class HbDeviceDialogInterface;
       
    39 
       
    40 class HbDeviceDialogPluginInterface
       
    41 {
       
    42 public:
       
    43     virtual HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
       
    44         const QVariantMap &parameters) = 0;
       
    45     virtual ~HbDeviceDialogPluginInterface() {}
       
    46 };
       
    47 Q_DECLARE_INTERFACE(HbDeviceDialogPluginInterface, "com.nokia.hb.HbDeviceDialogPlugin/1.0")
       
    48 
       
    49 class HB_CORE_EXPORT HbDeviceDialogPlugin : public QObject, public HbDeviceDialogPluginInterface
       
    50 {
       
    51     Q_OBJECT
       
    52     Q_INTERFACES(HbDeviceDialogPluginInterface)
       
    53 
       
    54 public:
       
    55     enum PluginFlag{
       
    56         NoPluginFlags = 0x00,
       
    57         PreloadPlugin = 0x01,
       
    58         KeepPluginLoaded = 0x02
       
    59     };
       
    60     Q_DECLARE_FLAGS(PluginFlags, PluginFlag)
       
    61 
       
    62     enum DeviceDialogGroup{
       
    63         GenericDeviceDialogGroup,
       
    64         DeviceNotificationDialogGroup,
       
    65         IndicatorGroup,
       
    66         SecurityGroup,
       
    67         CriticalGroup
       
    68     };
       
    69 
       
    70     enum DeviceDialogFlag{
       
    71         NoDeviceDialogFlags = 0x00,
       
    72         SharedDeviceDialog = 0x01,
       
    73         SecurityCheck = 0x02,
       
    74         NoLocalisableData = 0x04 // deprecated
       
    75     };
       
    76     Q_DECLARE_FLAGS(DeviceDialogFlags, DeviceDialogFlag)
       
    77 
       
    78     enum {
       
    79         DefaultPriority = 0
       
    80     };
       
    81 
       
    82     struct DeviceDialogInfo {
       
    83         DeviceDialogGroup group;
       
    84         int flags;
       
    85         int priority;
       
    86         quint32 spare[8];
       
    87     };
       
    88 
       
    89     virtual bool accessAllowed(const QString &deviceDialogType,
       
    90         const QVariantMap &parameters, const QVariantMap &securityInfo) const = 0;
       
    91     virtual bool deviceDialogInfo(const QString &deviceDialogType,
       
    92         const QVariantMap &parameters, DeviceDialogInfo *info) const = 0;
       
    93     virtual QStringList deviceDialogTypes() const = 0;
       
    94     virtual PluginFlags pluginFlags() const = 0;
       
    95     virtual int error() const = 0;
       
    96     virtual ~HbDeviceDialogPlugin();
       
    97 
       
    98 protected:
       
    99 
       
   100     HbDeviceDialogPlugin();
       
   101 };
       
   102 
       
   103 #endif // HBDEVICEDIALOGPLUGIN_H