policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp
branchRCL_3
changeset 61 b183ec05bd8c
equal deleted inserted replaced
59:13d7c31c74e0 61:b183ec05bd8c
       
     1 /*
       
     2 * Copyright (c) 2000 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: Implementation of policymanagement components
       
    15 *
       
    16 */
       
    17 
       
    18 #include <QtPlugin>
       
    19 #include "PolicyEngUINotifierplugin.h"
       
    20 #include "PolicyEngineUI.h"
       
    21 
       
    22 Q_EXPORT_PLUGIN2(PolicyEngUINotifiersplugin, PolicyEngUINotifierplugin)
       
    23 
       
    24 static const struct
       
    25     {
       
    26     const char *mTypeString;
       
    27     } dialogInfos[] =
       
    28     {
       
    29         {
       
    30         "com.nokia.hb.policymanagementdialog/1.0"
       
    31         }
       
    32     };
       
    33 
       
    34     
       
    35 // -----------------------------------------------------------------------------
       
    36 // PolicyEngUINotifierplugin::PolicyEngUINotifierplugin()
       
    37 // -----------------------------------------------------------------------------    
       
    38 PolicyEngUINotifierplugin::PolicyEngUINotifierplugin()
       
    39     {
       
    40     //policyEngUI = new QtPolicyEngineUI();
       
    41     }
       
    42 
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin()
       
    46 // -----------------------------------------------------------------------------    
       
    47 PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin()
       
    48     {
       
    49     //delete policyEngUI;
       
    50     }
       
    51 
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // PolicyEngUINotifierplugin::createDeviceDialog()
       
    55 // -----------------------------------------------------------------------------    
       
    56 HbDeviceDialogInterface* PolicyEngUINotifierplugin::createDeviceDialog(
       
    57         const QString &deviceDialogType, const QVariantMap &parameters)
       
    58     {
       
    59 	Q_UNUSED(deviceDialogType);
       
    60     // policyEngUI->DisplayNotificationDialog(parameters);
       
    61     return new PolicyEngineUI(parameters);
       
    62     }
       
    63 
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // PolicyEngUINotifierplugin::accessAllowed()
       
    67 // Check if client is allowed to use device dialog widget
       
    68 // -----------------------------------------------------------------------------    
       
    69 bool PolicyEngUINotifierplugin::accessAllowed(
       
    70         const QString &deviceDialogType, const QVariantMap &parameters,
       
    71         const QVariantMap &securityInfo) const
       
    72     {
       
    73 	Q_UNUSED(deviceDialogType);
       
    74 	Q_UNUSED(parameters);
       
    75 	Q_UNUSED(securityInfo);
       
    76     // This plugin doesn't perform operations that may compromise security.
       
    77     // All clients are allowed to use.
       
    78     return true;
       
    79     }
       
    80 
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // PolicyEngUINotifierplugin::deviceDialogInfo()
       
    84 // -----------------------------------------------------------------------------    
       
    85 bool PolicyEngUINotifierplugin::deviceDialogInfo(
       
    86         const QString &deviceDialogType, const QVariantMap &parameters,
       
    87         DeviceDialogInfo *info) const
       
    88     {
       
    89 	Q_UNUSED(deviceDialogType);
       
    90 	Q_UNUSED(parameters);
       
    91     info->group = GenericDeviceDialogGroup;
       
    92     info->flags = NoDeviceDialogFlags;
       
    93     info->priority = DefaultPriority;
       
    94     return true;
       
    95     }
       
    96 
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // PolicyEngUINotifierplugin::deviceDialogTypes()
       
   100 // Return device dialog types this plugin implements
       
   101 // -----------------------------------------------------------------------------    
       
   102 QStringList PolicyEngUINotifierplugin::deviceDialogTypes() const
       
   103     {
       
   104     QStringList types;
       
   105     const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]);
       
   106     for (int i = 0; i < numTypes; i++)
       
   107         {
       
   108         types.append(dialogInfos[i].mTypeString);
       
   109         }
       
   110 
       
   111     return types;
       
   112     }
       
   113 
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // PolicyEngUINotifierplugin::pluginFlags()
       
   117 // Return plugin flags
       
   118 // -----------------------------------------------------------------------------    
       
   119 HbDeviceDialogPlugin::PluginFlags PolicyEngUINotifierplugin::pluginFlags() const
       
   120     {
       
   121     return NoPluginFlags;
       
   122     }
       
   123 
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 // PolicyEngUINotifierplugin::error()
       
   127 // Return last error
       
   128 // -----------------------------------------------------------------------------    
       
   129 int PolicyEngUINotifierplugin::error() const
       
   130     {
       
   131     return 0;
       
   132     }