diff -r a36219ae6585 -r 2e64dc50f295 policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/policymanagement/policyengine/policyengineui/src/PolicyEngNotifierplugin.cpp Tue Jul 13 09:51:41 2010 +0530 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of policymanagement components +* +*/ + +#include +#include "PolicyEngUINotifierplugin.h" +#include "PolicyEngineUI.h" + +Q_EXPORT_PLUGIN2(PolicyEngUINotifiersplugin, PolicyEngUINotifierplugin) + +static const struct + { + const char *mTypeString; + } dialogInfos[] = + { + { + "com.nokia.hb.policymanagementdialog/1.0" + } + }; + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::PolicyEngUINotifierplugin() +// ----------------------------------------------------------------------------- +PolicyEngUINotifierplugin::PolicyEngUINotifierplugin() + { + //policyEngUI = new QtPolicyEngineUI(); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin() +// ----------------------------------------------------------------------------- +PolicyEngUINotifierplugin::~PolicyEngUINotifierplugin() + { + //delete policyEngUI; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::createDeviceDialog() +// ----------------------------------------------------------------------------- +HbDeviceDialogInterface* PolicyEngUINotifierplugin::createDeviceDialog( + const QString &deviceDialogType, const QVariantMap ¶meters) + { + Q_UNUSED(deviceDialogType); + // policyEngUI->DisplayNotificationDialog(parameters); + return new PolicyEngineUI(parameters); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::accessAllowed() +// Check if client is allowed to use device dialog widget +// ----------------------------------------------------------------------------- +bool PolicyEngUINotifierplugin::accessAllowed( + const QString &deviceDialogType, const QVariantMap ¶meters, + const QVariantMap &securityInfo) const + { + Q_UNUSED(deviceDialogType); + Q_UNUSED(parameters); + Q_UNUSED(securityInfo); + // This plugin doesn't perform operations that may compromise security. + // All clients are allowed to use. + return true; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::deviceDialogInfo() +// ----------------------------------------------------------------------------- +bool PolicyEngUINotifierplugin::deviceDialogInfo( + const QString &deviceDialogType, const QVariantMap ¶meters, + DeviceDialogInfo *info) const + { + Q_UNUSED(deviceDialogType); + Q_UNUSED(parameters); + info->group = GenericDeviceDialogGroup; + info->flags = NoDeviceDialogFlags; + info->priority = DefaultPriority; + return true; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::deviceDialogTypes() +// Return device dialog types this plugin implements +// ----------------------------------------------------------------------------- +QStringList PolicyEngUINotifierplugin::deviceDialogTypes() const + { + QStringList types; + const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]); + for (int i = 0; i < numTypes; i++) + { + types.append(dialogInfos[i].mTypeString); + } + + return types; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::pluginFlags() +// Return plugin flags +// ----------------------------------------------------------------------------- +HbDeviceDialogPlugin::PluginFlags PolicyEngUINotifierplugin::pluginFlags() const + { + return NoPluginFlags; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngUINotifierplugin::error() +// Return last error +// ----------------------------------------------------------------------------- +int PolicyEngUINotifierplugin::error() const + { + return 0; + }