# HG changeset patch # User hgs # Date 1281099563 -19800 # Node ID 1c556dee8eb10867c0d41c52c0246645059944f9 # Parent 085438c28042a75771de9f9b8b3dbe7a4c209292 201031 diff -r 085438c28042 -r 1c556dee8eb1 dcmofw/dcmoclient/bwins/dcmoclientu.def --- a/dcmofw/dcmoclient/bwins/dcmoclientu.def Fri Jul 23 13:39:21 2010 +0530 +++ b/dcmofw/dcmoclient/bwins/dcmoclientu.def Fri Aug 06 18:29:23 2010 +0530 @@ -1,3 +1,11 @@ EXPORTS ?NewL@RDCMOClient@@SAPAV1@XZ @ 1 NONAME ; class RDCMOClient * RDCMOClient::NewL(void) + ?SearchByGroupValue@RDCMOClient@@UAEXAAVTDes16@@0@Z @ 2 NONAME ; void RDCMOClient::SearchByGroupValue(class TDes16 &, class TDes16 &) + ?GetDCMOStrAttributeValue@RDCMOClient@@UAE?AW4TDCMOStatus@@AAVTDes16@@W4TDCMONode@@0@Z @ 3 NONAME ; enum TDCMOStatus RDCMOClient::GetDCMOStrAttributeValue(class TDes16 &, enum TDCMONode, class TDes16 &) + ?SetDCMOIntAttributeValue@RDCMOClient@@UAE?AW4TDCMOStatus@@AAVTDes16@@W4TDCMONode@@H@Z @ 4 NONAME ; enum TDCMOStatus RDCMOClient::SetDCMOIntAttributeValue(class TDes16 &, enum TDCMONode, int) + ?OpenL@RDCMOClient@@UAEHXZ @ 5 NONAME ; int RDCMOClient::OpenL(void) + ?GetDCMOIntAttributeValue@RDCMOClient@@UAE?AW4TDCMOStatus@@AAVTDes16@@W4TDCMONode@@AAH@Z @ 6 NONAME ; enum TDCMOStatus RDCMOClient::GetDCMOIntAttributeValue(class TDes16 &, enum TDCMONode, int &) + ??1RDCMOClient@@UAE@XZ @ 7 NONAME ; RDCMOClient::~RDCMOClient(void) + ?Close@RDCMOClient@@UAEXXZ @ 8 NONAME ; void RDCMOClient::Close(void) + ?SetDCMOStrAttributeValue@RDCMOClient@@UAE?AW4TDCMOStatus@@AAVTDes16@@W4TDCMONode@@0@Z @ 9 NONAME ; enum TDCMOStatus RDCMOClient::SetDCMOStrAttributeValue(class TDes16 &, enum TDCMONode, class TDes16 &) diff -r 085438c28042 -r 1c556dee8eb1 dcmofw/dcmoclient/eabi/dcmoclientu.def --- a/dcmofw/dcmoclient/eabi/dcmoclientu.def Fri Jul 23 13:39:21 2010 +0530 +++ b/dcmofw/dcmoclient/eabi/dcmoclientu.def Fri Aug 06 18:29:23 2010 +0530 @@ -2,4 +2,14 @@ _ZN11RDCMOClient4NewLEv @ 1 NONAME _ZTI11RDCMOClient @ 2 NONAME ; ## _ZTV11RDCMOClient @ 3 NONAME ; ## + _ZN11RDCMOClient18SearchByGroupValueER6TDes16S1_ @ 4 NONAME + _ZN11RDCMOClient24GetDCMOIntAttributeValueER6TDes169TDCMONodeRi @ 5 NONAME + _ZN11RDCMOClient24GetDCMOStrAttributeValueER6TDes169TDCMONodeS1_ @ 6 NONAME + _ZN11RDCMOClient24SetDCMOIntAttributeValueER6TDes169TDCMONodei @ 7 NONAME + _ZN11RDCMOClient24SetDCMOStrAttributeValueER6TDes169TDCMONodeS1_ @ 8 NONAME + _ZN11RDCMOClient5CloseEv @ 9 NONAME + _ZN11RDCMOClient5OpenLEv @ 10 NONAME + _ZN11RDCMOClientD0Ev @ 11 NONAME + _ZN11RDCMOClientD1Ev @ 12 NONAME + _ZN11RDCMOClientD2Ev @ 13 NONAME diff -r 085438c28042 -r 1c556dee8eb1 dcmofw/dcmoclient/src/dcmoclient.cpp --- a/dcmofw/dcmoclient/src/dcmoclient.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/dcmofw/dcmoclient/src/dcmoclient.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -87,7 +87,7 @@ // Destructor. // ----------------------------------------------------------------------------- // -RDCMOClient::~RDCMOClient() +EXPORT_C RDCMOClient::~RDCMOClient() { Close(); } @@ -95,7 +95,7 @@ // --------------------------------------------------------------------------- // RDCMOClient::OpenL() // --------------------------------------------------------------------------- -TInt RDCMOClient::OpenL() +EXPORT_C TInt RDCMOClient::OpenL() { RDEBUG("RDCMOClient::OpenL()- Begin"); TInt res = KErrNone; @@ -115,7 +115,7 @@ // --------------------------------------------------------------------------- // RDCMOClient::Close() // --------------------------------------------------------------------------- -void RDCMOClient::Close() +EXPORT_C void RDCMOClient::Close() { RDEBUG(" RDCMOClient::Close"); RSessionBase::Close(); //basecall @@ -125,7 +125,7 @@ // ---------------------------------------------------------------------------- // RDCMOClient::GetDCMOIntAttributeValue() // ---------------------------------------------------------------------------- -TDCMOStatus RDCMOClient::GetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt& aValue) +EXPORT_C TDCMOStatus RDCMOClient::GetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt& aValue) { RDEBUG(" RDCMOClient::GetDCMOIntAttributeValue--Begin"); TPckg p(aId); @@ -142,7 +142,7 @@ // ---------------------------------------------------------------------------- // RDCMOClient::GetDCMOStrAttributeValue() // ---------------------------------------------------------------------------- -TDCMOStatus RDCMOClient::GetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue) +EXPORT_C TDCMOStatus RDCMOClient::GetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue) { RDEBUG(" RDCMOClient::GetDCMOStrAttributeValue--Begin"); TPckg p(aId); @@ -158,7 +158,7 @@ // ---------------------------------------------------------------------------- // RDCMOClient::SetDCMOIntAttributeValue() // ---------------------------------------------------------------------------- -TDCMOStatus RDCMOClient::SetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt aValue) +EXPORT_C TDCMOStatus RDCMOClient::SetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt aValue) { RDEBUG(" RDCMOClient::SetDCMOIntAttributeValue--Begin"); TPckg p(aId); @@ -175,7 +175,7 @@ // ---------------------------------------------------------------------------- // RDCMOClient::SetDCMOStrAttributeValue() // ---------------------------------------------------------------------------- -TDCMOStatus RDCMOClient::SetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue) +EXPORT_C TDCMOStatus RDCMOClient::SetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue) { RDEBUG(" RDCMOClient::SetDCMOStrAttributeValue--Begin"); TPckg p(aId); @@ -191,7 +191,7 @@ // ---------------------------------------------------------------------------- // RDCMOClient::SearchByGroupValue() // ---------------------------------------------------------------------------- -void RDCMOClient::SearchByGroupValue(TDes& aGroup, TDes& aAdapterList) +EXPORT_C void RDCMOClient::SearchByGroupValue(TDes& aGroup, TDes& aAdapterList) { RDEBUG(" RDCMOClient::SearchByGroupValue--Begin"); TInt err = SendReceive( EDcmoSearchAdapter, TIpcArgs(&aGroup, &aAdapterList)); diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/inc/FotaDlMgrClient.h --- a/fotaapplication/fotaserver/inc/FotaDlMgrClient.h Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/inc/FotaDlMgrClient.h Fri Aug 06 18:29:23 2010 +0530 @@ -34,7 +34,7 @@ #include #include #include -#include +#include //All user includes #include "FotaDlMgrClient.h" diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/inc/FotaServer.h --- a/fotaapplication/fotaserver/inc/FotaServer.h Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/inc/FotaServer.h Fri Aug 06 18:29:23 2010 +0530 @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "fotaserverPrivateCRKeys.h" #include "FotaIPCTypes.h" diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/inc/fotaupdate.h --- a/fotaapplication/fotaserver/inc/fotaupdate.h Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/inc/fotaupdate.h Fri Aug 06 18:29:23 2010 +0530 @@ -24,7 +24,7 @@ #include "fotaUpdateAgentComms.h" #include "fotaengine.h" #include -#include +#include #include "fotadevicedialogobserver.h" // CONSTANTS _LIT (KUpdateResultFile, "update.resp"); diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/src/fotafullscreendialog.cpp --- a/fotaapplication/fotaserver/src/fotafullscreendialog.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/src/fotafullscreendialog.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -17,7 +17,7 @@ #include "fotafullscreendialog.h" -#include +#include #include #include #include diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/src/fotaupdate.cpp --- a/fotaapplication/fotaserver/src/fotaupdate.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/src/fotaupdate.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -124,7 +124,9 @@ | EFileStream); FLOG(_L("opened rstr 2/2 ")); if (err) + { FLOG(_L(" update result file open err %d"), err); + } User::LeaveIfError(err); FLOG(_L(" 0.1")); CleanupClosePushL(rstr); @@ -534,7 +536,9 @@ usbman.Close(); } if (state != EUsbDeviceStateUndefined) + { ret = ETrue; + } FLOG(_L("CFotaUpdate::IsUSBConnected, value = %d, ret = %d <<"), state, ret); return ret; diff -r 085438c28042 -r 1c556dee8eb1 fotaapplication/fotaserver/src/fsview.cpp --- a/fotaapplication/fotaserver/src/fsview.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/fotaapplication/fotaserver/src/fsview.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -16,7 +16,7 @@ */ #include "fsview.h" -#include "fotaserver.h" +#include "FotaServer.h" // ------------------------------------------------------------------------------------------------ // FSView::FSView() diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineclient/src/Contexts.cpp --- a/policymanagement/policyengine/policyengineclient/src/Contexts.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/policymanagement/policyengine/policyengineclient/src/Contexts.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -311,7 +311,7 @@ delete operator[](i); } - RArray::Close(); + RArray::Close(); } void RElementIdArray::SetListL( const TDesC8& aChilds) diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h --- a/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h Fri Jul 23 13:39:21 2010 +0530 +++ b/policymanagement/policyengine/policyengineserver/inc/PolicyProcessor.h Fri Aug 06 18:29:23 2010 +0530 @@ -28,7 +28,7 @@ #include "RequestContext.h" #include "PolicyStorage.h" #include -#include +#include #include #include diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp --- a/policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/policymanagement/policyengine/policyengineserver/src/PolicyProcessor.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -62,7 +62,7 @@ container->iAttributeType = aAttributeTypes; //append to list - RArray::AppendL( container); + RArray::AppendL( container); //remove from cleanup CleanupStack::Pop( 2, aAttribute); @@ -82,7 +82,7 @@ delete container; } - RArray::Close(); + RArray::Close(); } diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineui/inc/PolicyEngineUI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/policymanagement/policyengine/policyengineui/inc/PolicyEngineUI.h Fri Aug 06 18:29:23 2010 +0530 @@ -0,0 +1,67 @@ +/* +* 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 +* +*/ + +#ifndef POLICYENGINEUI_H +#define POLICYENGINEUI_H + +#include +#include + +class HbDialog; +class HbLineEdit; + +class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface + { +Q_OBJECT + +public: + PolicyEngineUI(const QVariantMap& parameters); + ~PolicyEngineUI(); + void DisplayNotificationDialog(const QVariantMap ¶meters); + void ShowInputDialog(); + bool verifyFingerPrint(); + +public slots: + void onOKSelected(); + void onCancelSelected(); + void establishTrust(); + void cancelTrust(); + void onTrustCreation(); + void codeTextChanged(); +public: + //derived from HbDeviceDialogInterface + bool setDeviceDialogParameters(const QVariantMap ¶meters); + int deviceDialogError() const; + void closeDeviceDialog(bool byClient); + HbDialog *deviceDialogWidget() const; + +signals: + //signal to be sent to client + void deviceDialogClosed(); + void deviceDialogData(QVariantMap data); + +private: + // number of tries user does + int estbTrustCount; + QString iServerName; + QString iFingerprint; + QString iCode; + HbLineEdit *mContentEdit; + HbDialog* mdialog; + }; + +#endif // POLICYENGINEUI_H diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h --- a/policymanagement/policyengine/policyengineui/inc/PolicyEngineUi.h Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 -* -*/ - -#ifndef POLICYENGINEUI_H -#define POLICYENGINEUI_H - -#include -#include - -class HbDialog; -class HbLineEdit; - -class PolicyEngineUI : public HbDialog, public HbDeviceDialogInterface - { -Q_OBJECT - -public: - PolicyEngineUI(const QVariantMap& parameters); - ~PolicyEngineUI(); - void DisplayNotificationDialog(const QVariantMap ¶meters); - void ShowInputDialog(); - bool verifyFingerPrint(); - -public slots: - void onOKSelected(); - void onCancelSelected(); - void establishTrust(); - void cancelTrust(); - void onTrustCreation(); - void codeTextChanged(); -public: - //derived from HbDeviceDialogInterface - bool setDeviceDialogParameters(const QVariantMap ¶meters); - int deviceDialogError() const; - void closeDeviceDialog(bool byClient); - HbDialog *deviceDialogWidget() const; - -signals: - //signal to be sent to client - void deviceDialogClosed(); - void deviceDialogData(QVariantMap data); - -private: - // number of tries user does - int estbTrustCount; - QString iServerName; - QString iFingerprint; - QString iCode; - HbLineEdit *mContentEdit; - HbDialog* mdialog; - }; - -#endif // POLICYENGINEUI_H diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineui/src/PolicyEngineUI.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/policymanagement/policyengine/policyengineui/src/PolicyEngineUI.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -0,0 +1,446 @@ +/* +* 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 "PolicyEngineUI.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Logger.h" + +const int KMaxTries = 4; +const int KMaxCodeLength = 4; + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::PolicyEngineUI() +// ----------------------------------------------------------------------------- +PolicyEngineUI::PolicyEngineUI(const QVariantMap& parameters) + { + estbTrustCount = KMaxTries; + DisplayNotificationDialog(parameters); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::~PolicyEngineUI() +// ----------------------------------------------------------------------------- +PolicyEngineUI::~PolicyEngineUI() + { + + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::DisplayNotificationDialog() +// Read the parameters sent from client +// ----------------------------------------------------------------------------- +void PolicyEngineUI::DisplayNotificationDialog(const QVariantMap& parameters) + { + LOGSTRING( "+ DisplayNotificationDialog +" ); + QVariantMap::const_iterator i = parameters.constBegin(); + + while (i != parameters.constEnd()) + { + if (i.key().toAscii() == "serverdisplayname") + { + iServerName = i.value().toString(); + } + else if (i.key().toAscii() == "fingerprint") + { + iFingerprint = i.value().toString(); + } + ++i; + } + + TBuf<50> server(iServerName.utf16()); + TBuf<10> buffer(iFingerprint.utf16()); + + LOGSTRING2( "serverdisplayname %S", &server ); + LOGSTRING2( "fingerprint %S", &buffer ); + + ShowInputDialog(); + LOGSTRING( "- DisplayNotificationDialog -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::ShowInputDialog() +// Show the accept control dialog +// ----------------------------------------------------------------------------- +void PolicyEngineUI::ShowInputDialog() + { + LOGSTRING( "+ ShowInputDialog +" ); + HbDocumentLoader loader; + bool ok = false; + loader.load(":/xml/dialog.docml", &ok); + if (!ok) + { + return; + } + + HbDialog *dialog1 = + qobject_cast (loader.findWidget("dialog")); + + //set heading content + HbLabel *contentheading = qobject_cast (loader.findWidget( + "qtl_dialog_pri_heading")); + QString heading(hbTrId("txt_device_update_title_security_information")); + contentheading->setPlainText(heading); + + //set body content + HbLabel *contentbody = qobject_cast (loader.findWidget( + "qtl_dialog_pri5")); + + QString body( + (hbTrId("txt_device_update_info_1_server_wants_to_contro").arg( + iServerName))); + contentbody->setTextWrapping(Hb::TextWordWrap); + contentbody->setPlainText(body); + + HbAction *primaryAction = qobject_cast ( + dialog1->actions().at(0)); + HbAction *secondaryAction = qobject_cast ( + dialog1->actions().at(1)); + + //set dialog properties + dialog1->setTimeout(HbPopup::NoTimeout); + dialog1->setDismissPolicy(HbPopup::NoDismiss); + + QObject::connect(primaryAction, SIGNAL(triggered()), this, + SLOT(onOKSelected())); + QObject::connect(secondaryAction, SIGNAL(triggered()), this, + SLOT(onCancelSelected())); + + if (dialog1) + dialog1->show(); + + LOGSTRING( "- ShowInputDialog -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::onOKSelected() +// Show the user input dialog once control is accepted +// ----------------------------------------------------------------------------- +void PolicyEngineUI::onOKSelected() + { + + LOGSTRING( "+ onOKSelected +" ); + + HbDocumentLoader loader; + bool ok = false; + loader.load(":/xml/InputDialog.docml", &ok); + if (!ok) + { + return; + } + + mdialog = qobject_cast (loader.findWidget("dialog")); + + //set heading content + HbLabel *contentheading = qobject_cast (loader.findWidget( + "qtl_dialog_pri_heading")); + QString heading(hbTrId("txt_device_update_title_security_information")); + contentheading->setPlainText(heading); + + //set label + HbLabel *contentlabel = qobject_cast (loader.findWidget( + "HeadingLabel")); + contentlabel->setTextWrapping(Hb::TextWordWrap); + QString label( + (hbTrId("txt_device_update_info_enter_first_4_characters_of").arg( + iServerName))); + contentlabel ->setPlainText(label); + + //set length for editline + mContentEdit = qobject_cast (loader.findWidget("InputLine")); + mContentEdit->setMaxLength(KMaxCodeLength); + + //set dialog properties + mdialog->setTimeout(HbPopup::NoTimeout); + mdialog->setDismissPolicy(HbPopup::NoDismiss); + + HbAction* primaryAction = (HbAction*) (mdialog->actions().at(0)); + HbAction *secondaryAction = (HbAction*) (mdialog->actions().at(1)); + primaryAction->setEnabled(false); + + QObject::connect(primaryAction, SIGNAL(triggered()), this, + SLOT(establishTrust())); + QObject::connect(secondaryAction, SIGNAL(triggered()), this, + SLOT(cancelTrust())); + QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this, + SLOT(codeTextChanged())); + + if (mdialog) + mdialog->show(); + + LOGSTRING( "- onOKSelected -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::onCancelSelected() +// ----------------------------------------------------------------------------- +void PolicyEngineUI::onCancelSelected() + { + LOGSTRING( "+ onCancelSelected +" ); + + QVariantMap result; + + result.insert("keyResponse", -1); + emit + deviceDialogData(result); + + emit + deviceDialogClosed(); + + LOGSTRING( "- onCancelSelected -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::onTrustCreation() +// ----------------------------------------------------------------------------- +void PolicyEngineUI::onTrustCreation() + { + LOGSTRING( "+ onTrustCreation +" ); + QVariantMap result; + + result.insert("keyResponse", 0); + emit + deviceDialogData(result); + + emit + deviceDialogClosed(); + + LOGSTRING( "- onTrustCreation -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::establishTrust() +// ----------------------------------------------------------------------------- +void PolicyEngineUI::establishTrust() + { + LOGSTRING( "+ establishTrust +" ); + bool retVal; // return value from code verification API. + estbTrustCount--; + retVal = verifyFingerPrint(); + + if (retVal) + { + LOGSTRING( "Trust Created" ); + //Reset the counter. + estbTrustCount = 0; + onTrustCreation(); + + } + else + { + //check the number of tries. + if (estbTrustCount == 0) + { + //Access denied. + LOGSTRING( "Access Denied" ); + HbMessageBox *msgBox = new HbMessageBox(); + msgBox->setHeadingWidget(new HbLabel(hbTrId( + "txt_device_update_title_security_information"))); + + msgBox->setText(hbTrId( + "txt_device_update_info_security_info_access_denied")); + msgBox->setTimeout(HbDialog::NoTimeout); + msgBox->setDismissPolicy(HbDialog::NoDismiss); + + HbAction *action = (HbAction*) (msgBox->actions().at(0)); + QObject::connect(action, SIGNAL(triggered()), this, + SLOT(onCancelSelected())); + + msgBox->show(); + } + else + { + LOGSTRING2( "tries left %i", estbTrustCount ); + //Code didnot match. + HbDocumentLoader loader; + bool ok = false; + loader.load(":/xml/InputDialog.docml", &ok); + if (!ok) + { + return; + } + + mdialog = qobject_cast (loader.findWidget("dialog")); + + //set heading content + HbLabel *contentheading = qobject_cast ( + loader.findWidget("qtl_dialog_pri_heading")); + contentheading->setTextWrapping(Hb::TextWordWrap); + QString heading(hbTrId( + "txt_device_update_title_security_information")); + contentheading->setPlainText(heading); + + //set label + HbLabel *contentlabel = qobject_cast ( + loader.findWidget("HeadingLabel")); + QString + label( + (hbTrId( + "txt_device_update_info_security_information_did_no").arg( + estbTrustCount))); + + contentlabel->setTextWrapping(Hb::TextWordWrap); + contentlabel->setPlainText(label); + + mContentEdit = qobject_cast (loader.findWidget( + "InputLine")); + mContentEdit->setMaxLength(KMaxCodeLength); + + mdialog->setTimeout(HbPopup::NoTimeout); + mdialog->setDismissPolicy(HbPopup::NoDismiss); + + HbAction* primaryAction = qobject_cast ( + mdialog->actions().at(0)); + HbAction *secondaryAction = qobject_cast ( + mdialog->actions().at(1)); + primaryAction->setEnabled(false); + + QObject::connect(primaryAction, SIGNAL(triggered()), this, + SLOT(establishTrust())); + QObject::connect(secondaryAction, SIGNAL(triggered()), this, + SLOT(cancelTrust())); + QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this, + SLOT(codeTextChanged())); + + if (mdialog) + mdialog->show(); + } + } + LOGSTRING( "- establishTrust -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::cancelTrust() +// ----------------------------------------------------------------------------- +void PolicyEngineUI::cancelTrust() + { + LOGSTRING( "+ cancelTrust +" ); + //Reset the counter. + estbTrustCount = 0; + + QVariantMap result; + result.insert("keyResponse", -1); + emit + deviceDialogData(result); + + emit + deviceDialogClosed(); + LOGSTRING( "- cancelTrust -" ); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::setDeviceDialogParameters() +// ----------------------------------------------------------------------------- +bool PolicyEngineUI::setDeviceDialogParameters(const QVariantMap ¶meters) + { + Q_UNUSED(parameters); + LOGSTRING( "+ setDeviceDialogParameters +" ); + return true; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::deviceDialogError() +// Get error +// ----------------------------------------------------------------------------- +int PolicyEngineUI::deviceDialogError() const + { + LOGSTRING( "+ deviceDialogError +" ); + return 0; + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::PolicyEngineUI() +// Close device dialog +// ----------------------------------------------------------------------------- +void PolicyEngineUI::closeDeviceDialog(bool byClient) + { + Q_UNUSED(byClient); + LOGSTRING( "+ closeDeviceDialog +" ); + close(); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::PolicyEngineUI() +// Return display widget +// ----------------------------------------------------------------------------- +HbDialog *PolicyEngineUI::deviceDialogWidget() const + { + LOGSTRING( "+ deviceDialogWidget +" ); + return const_cast (this); + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::PolicyEngineUI() +// Verify the user entered code +// ----------------------------------------------------------------------------- +bool PolicyEngineUI::verifyFingerPrint() + { + LOGSTRING( "+ verifyFingerPrint +" ); + + QString enteredCode = mContentEdit->text(); + TBuf<10> buffer(enteredCode.utf16()); + + LOGSTRING2( "User entered code %i", &buffer); + LOGSTRING2( "User entered code %S", &buffer); + + if (enteredCode.compare(iFingerprint, Qt::CaseInsensitive) == 0) + { + LOGSTRING( "+ fingerprint MATCH !!!! +" ); + return true; + } + else + { + LOGSTRING( "+ fingerprint DOESNOT MATCH +" ); + return false; + } + } + + +// ----------------------------------------------------------------------------- +// PolicyEngineUI::codeTextChanged() +// checks the entered text length and enables the OK option accordingly. +// ----------------------------------------------------------------------------- +void PolicyEngineUI::codeTextChanged() + { + QString str = mContentEdit->text(); + + if (str.length() >= KMaxCodeLength) + mdialog->actions().at(0)->setEnabled(true); + else + mdialog->actions().at(0)->setEnabled(false); + } diff -r 085438c28042 -r 1c556dee8eb1 policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp --- a/policymanagement/policyengine/policyengineui/src/PolicyEngineUi.cpp Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,446 +0,0 @@ -/* -* 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 "PolicyEngineUI.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "Logger.h" - -const int KMaxTries = 4; -const int KMaxCodeLength = 4; - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::PolicyEngineUI() -// ----------------------------------------------------------------------------- -PolicyEngineUI::PolicyEngineUI(const QVariantMap& parameters) - { - estbTrustCount = KMaxTries; - DisplayNotificationDialog(parameters); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::~PolicyEngineUI() -// ----------------------------------------------------------------------------- -PolicyEngineUI::~PolicyEngineUI() - { - - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::DisplayNotificationDialog() -// Read the parameters sent from client -// ----------------------------------------------------------------------------- -void PolicyEngineUI::DisplayNotificationDialog(const QVariantMap& parameters) - { - LOGSTRING( "+ DisplayNotificationDialog +" ); - QVariantMap::const_iterator i = parameters.constBegin(); - - while (i != parameters.constEnd()) - { - if (i.key().toAscii() == "serverdisplayname") - { - iServerName = i.value().toString(); - } - else if (i.key().toAscii() == "fingerprint") - { - iFingerprint = i.value().toString(); - } - ++i; - } - - TBuf<50> server(iServerName.utf16()); - TBuf<10> buffer(iFingerprint.utf16()); - - LOGSTRING2( "serverdisplayname %S", &server ); - LOGSTRING2( "fingerprint %S", &buffer ); - - ShowInputDialog(); - LOGSTRING( "- DisplayNotificationDialog -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::ShowInputDialog() -// Show the accept control dialog -// ----------------------------------------------------------------------------- -void PolicyEngineUI::ShowInputDialog() - { - LOGSTRING( "+ ShowInputDialog +" ); - HbDocumentLoader loader; - bool ok = false; - loader.load(":/xml/dialog.docml", &ok); - if (!ok) - { - return; - } - - HbDialog *dialog1 = - qobject_cast (loader.findWidget("dialog")); - - //set heading content - HbLabel *contentheading = qobject_cast (loader.findWidget( - "qtl_dialog_pri_heading")); - QString heading(hbTrId("txt_device_update_title_security_information")); - contentheading->setPlainText(heading); - - //set body content - HbLabel *contentbody = qobject_cast (loader.findWidget( - "qtl_dialog_pri5")); - - QString body( - (hbTrId("txt_device_update_info_1_server_wants_to_contro").arg( - iServerName))); - contentbody->setTextWrapping(Hb::TextWordWrap); - contentbody->setPlainText(body); - - HbAction *primaryAction = qobject_cast ( - dialog1->actions().at(0)); - HbAction *secondaryAction = qobject_cast ( - dialog1->actions().at(1)); - - //set dialog properties - dialog1->setTimeout(HbPopup::NoTimeout); - dialog1->setDismissPolicy(HbPopup::NoDismiss); - - QObject::connect(primaryAction, SIGNAL(triggered()), this, - SLOT(onOKSelected())); - QObject::connect(secondaryAction, SIGNAL(triggered()), this, - SLOT(onCancelSelected())); - - if (dialog1) - dialog1->show(); - - LOGSTRING( "- ShowInputDialog -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::onOKSelected() -// Show the user input dialog once control is accepted -// ----------------------------------------------------------------------------- -void PolicyEngineUI::onOKSelected() - { - - LOGSTRING( "+ onOKSelected +" ); - - HbDocumentLoader loader; - bool ok = false; - loader.load(":/xml/InputDialog.docml", &ok); - if (!ok) - { - return; - } - - mdialog = qobject_cast (loader.findWidget("dialog")); - - //set heading content - HbLabel *contentheading = qobject_cast (loader.findWidget( - "qtl_dialog_pri_heading")); - QString heading(hbTrId("txt_device_update_title_security_information")); - contentheading->setPlainText(heading); - - //set label - HbLabel *contentlabel = qobject_cast (loader.findWidget( - "HeadingLabel")); - contentlabel->setTextWrapping(Hb::TextWordWrap); - QString label( - (hbTrId("txt_device_update_info_enter_first_4_characters_of").arg( - iServerName))); - contentlabel ->setPlainText(label); - - //set length for editline - mContentEdit = qobject_cast (loader.findWidget("InputLine")); - mContentEdit->setMaxLength(KMaxCodeLength); - - //set dialog properties - mdialog->setTimeout(HbPopup::NoTimeout); - mdialog->setDismissPolicy(HbPopup::NoDismiss); - - HbAction* primaryAction = (HbAction*) (mdialog->actions().at(0)); - HbAction *secondaryAction = (HbAction*) (mdialog->actions().at(1)); - primaryAction->setEnabled(false); - - QObject::connect(primaryAction, SIGNAL(triggered()), this, - SLOT(establishTrust())); - QObject::connect(secondaryAction, SIGNAL(triggered()), this, - SLOT(cancelTrust())); - QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this, - SLOT(codeTextChanged())); - - if (mdialog) - mdialog->show(); - - LOGSTRING( "- onOKSelected -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::onCancelSelected() -// ----------------------------------------------------------------------------- -void PolicyEngineUI::onCancelSelected() - { - LOGSTRING( "+ onCancelSelected +" ); - - QVariantMap result; - - result.insert("keyResponse", -1); - emit - deviceDialogData(result); - - emit - deviceDialogClosed(); - - LOGSTRING( "- onCancelSelected -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::onTrustCreation() -// ----------------------------------------------------------------------------- -void PolicyEngineUI::onTrustCreation() - { - LOGSTRING( "+ onTrustCreation +" ); - QVariantMap result; - - result.insert("keyResponse", 0); - emit - deviceDialogData(result); - - emit - deviceDialogClosed(); - - LOGSTRING( "- onTrustCreation -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::establishTrust() -// ----------------------------------------------------------------------------- -void PolicyEngineUI::establishTrust() - { - LOGSTRING( "+ establishTrust +" ); - bool retVal; // return value from code verification API. - estbTrustCount--; - retVal = verifyFingerPrint(); - - if (retVal) - { - LOGSTRING( "Trust Created" ); - //Reset the counter. - estbTrustCount = 0; - onTrustCreation(); - - } - else - { - //check the number of tries. - if (estbTrustCount == 0) - { - //Access denied. - LOGSTRING( "Access Denied" ); - HbMessageBox *msgBox = new HbMessageBox(); - msgBox->setHeadingWidget(new HbLabel(hbTrId( - "txt_device_update_title_security_information"))); - - msgBox->setText(hbTrId( - "txt_device_update_info_security_info_access_denied")); - msgBox->setTimeout(HbDialog::NoTimeout); - msgBox->setDismissPolicy(HbDialog::NoDismiss); - - HbAction *action = (HbAction*) (msgBox->actions().at(0)); - QObject::connect(action, SIGNAL(triggered()), this, - SLOT(onCancelSelected())); - - msgBox->show(); - } - else - { - LOGSTRING2( "tries left %i", estbTrustCount ); - //Code didnot match. - HbDocumentLoader loader; - bool ok = false; - loader.load(":/xml/InputDialog.docml", &ok); - if (!ok) - { - return; - } - - mdialog = qobject_cast (loader.findWidget("dialog")); - - //set heading content - HbLabel *contentheading = qobject_cast ( - loader.findWidget("qtl_dialog_pri_heading")); - contentheading->setTextWrapping(Hb::TextWordWrap); - QString heading(hbTrId( - "txt_device_update_title_security_information")); - contentheading->setPlainText(heading); - - //set label - HbLabel *contentlabel = qobject_cast ( - loader.findWidget("HeadingLabel")); - QString - label( - (hbTrId( - "txt_device_update_info_security_information_did_no").arg( - estbTrustCount))); - - contentlabel->setTextWrapping(Hb::TextWordWrap); - contentlabel->setPlainText(label); - - mContentEdit = qobject_cast (loader.findWidget( - "InputLine")); - mContentEdit->setMaxLength(KMaxCodeLength); - - mdialog->setTimeout(HbPopup::NoTimeout); - mdialog->setDismissPolicy(HbPopup::NoDismiss); - - HbAction* primaryAction = qobject_cast ( - mdialog->actions().at(0)); - HbAction *secondaryAction = qobject_cast ( - mdialog->actions().at(1)); - primaryAction->setEnabled(false); - - QObject::connect(primaryAction, SIGNAL(triggered()), this, - SLOT(establishTrust())); - QObject::connect(secondaryAction, SIGNAL(triggered()), this, - SLOT(cancelTrust())); - QObject::connect(mContentEdit, SIGNAL(contentsChanged()), this, - SLOT(codeTextChanged())); - - if (mdialog) - mdialog->show(); - } - } - LOGSTRING( "- establishTrust -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::cancelTrust() -// ----------------------------------------------------------------------------- -void PolicyEngineUI::cancelTrust() - { - LOGSTRING( "+ cancelTrust +" ); - //Reset the counter. - estbTrustCount = 0; - - QVariantMap result; - result.insert("keyResponse", -1); - emit - deviceDialogData(result); - - emit - deviceDialogClosed(); - LOGSTRING( "- cancelTrust -" ); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::setDeviceDialogParameters() -// ----------------------------------------------------------------------------- -bool PolicyEngineUI::setDeviceDialogParameters(const QVariantMap ¶meters) - { - Q_UNUSED(parameters); - LOGSTRING( "+ setDeviceDialogParameters +" ); - return true; - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::deviceDialogError() -// Get error -// ----------------------------------------------------------------------------- -int PolicyEngineUI::deviceDialogError() const - { - LOGSTRING( "+ deviceDialogError +" ); - return 0; - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::PolicyEngineUI() -// Close device dialog -// ----------------------------------------------------------------------------- -void PolicyEngineUI::closeDeviceDialog(bool byClient) - { - Q_UNUSED(byClient); - LOGSTRING( "+ closeDeviceDialog +" ); - close(); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::PolicyEngineUI() -// Return display widget -// ----------------------------------------------------------------------------- -HbDialog *PolicyEngineUI::deviceDialogWidget() const - { - LOGSTRING( "+ deviceDialogWidget +" ); - return const_cast (this); - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::PolicyEngineUI() -// Verify the user entered code -// ----------------------------------------------------------------------------- -bool PolicyEngineUI::verifyFingerPrint() - { - LOGSTRING( "+ verifyFingerPrint +" ); - - QString enteredCode = mContentEdit->text(); - TBuf<10> buffer(enteredCode.utf16()); - - LOGSTRING2( "User entered code %i", &buffer); - LOGSTRING2( "User entered code %S", &buffer); - - if (enteredCode.compare(iFingerprint, Qt::CaseInsensitive) == 0) - { - LOGSTRING( "+ fingerprint MATCH !!!! +" ); - return true; - } - else - { - LOGSTRING( "+ fingerprint DOESNOT MATCH +" ); - return false; - } - } - - -// ----------------------------------------------------------------------------- -// PolicyEngineUI::codeTextChanged() -// checks the entered text length and enables the OK option accordingly. -// ----------------------------------------------------------------------------- -void PolicyEngineUI::codeTextChanged() - { - QString str = mContentEdit->text(); - - if (str.length() >= KMaxCodeLength) - mdialog->actions().at(0)->setEnabled(true); - else - mdialog->actions().at(0)->setEnabled(false); - } diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/dcmo_control_api/inc/dcmoClient.h --- a/remotemgmt_plat/dcmo_control_api/inc/dcmoClient.h Fri Jul 23 13:39:21 2010 +0530 +++ b/remotemgmt_plat/dcmo_control_api/inc/dcmoClient.h Fri Aug 06 18:29:23 2010 +0530 @@ -37,20 +37,20 @@ * @param None * @return KErrNone Symbian error code */ - TInt OpenL(); + IMPORT_C TInt OpenL(); /** * Close server connection * @param None * @return None */ - void Close(); + IMPORT_C void Close(); /** * ~RDCMOClient. * Virtual Destructor. */ - virtual ~RDCMOClient(); + IMPORT_C virtual ~RDCMOClient(); /** * Get the interger type value @@ -60,7 +60,7 @@ * @param aValue * @return TDCMOStatus */ - TDCMOStatus GetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt& aValue); + IMPORT_C TDCMOStatus GetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt& aValue); /** * Get the string type value @@ -70,7 +70,7 @@ * @param aStrValue * @return TDCMOStatus */ - TDCMOStatus GetDCMOStrAttributeValue (TDes& aCategory, TDCMONode aId, TDes& aStrValue); + IMPORT_C TDCMOStatus GetDCMOStrAttributeValue (TDes& aCategory, TDCMONode aId, TDes& aStrValue); /** * Set the interger type value @@ -80,7 +80,7 @@ * @param aValue * @return TDCMOStatus */ - TDCMOStatus SetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt aValue); + IMPORT_C TDCMOStatus SetDCMOIntAttributeValue(TDes& aCategory, TDCMONode aId, TInt aValue); /** * Set the string type value @@ -90,7 +90,7 @@ * @param aStrValue * @return TDCMOStatus */ - TDCMOStatus SetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue); + IMPORT_C TDCMOStatus SetDCMOStrAttributeValue(TDes& aCategory, TDCMONode aId, TDes& aStrValue); /** * Get All type value @@ -100,7 +100,7 @@ * @param aStrValue * @return TDCMOStatus */ - void SearchByGroupValue(TDes& aGroup, TDes& aAdapterList); + IMPORT_C void SearchByGroupValue(TDes& aGroup, TDes& aAdapterList); private: diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf --- a/remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf Fri Jul 23 13:39:21 2010 +0530 +++ b/remotemgmt_plat/devicemgmt_dialogs_api/group/bld.inf Fri Aug 06 18:29:23 2010 +0530 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 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" @@ -12,7 +12,7 @@ * Contributors: * * Description: File that exports the files belonging to -: Adaptive History List API +: device management Dialogs * */ @@ -24,5 +24,6 @@ PRJ_EXPORTS -../inc/devicedialogconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogconsts.h) -../inc/dmindicatorconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(dmindicatorconsts.h) \ No newline at end of file +../inc/devicedialogconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogconsts.h) +../inc/dmindicatorconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(dmindicatorconsts.h) +../inc/devicedialogsymbian.h MW_LAYER_PLATFORM_EXPORT_PATH(devicedialogsymbian.h) diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h --- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h Fri Jul 23 13:39:21 2010 +0530 +++ b/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogconsts.h Fri Aug 06 18:29:23 2010 +0530 @@ -1,9 +1,19 @@ /* - * devicedialogconsts.h - * - * Created on: Apr 20, 2010 - * Author: gnataraj - */ +* Copyright (c) 2010 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: Orbit specific constants for the device dialog. +* +*/ #ifndef DEVICEDIALOGCONSTS_H_ #define DEVICEDIALOGCONSTS_H_ diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogsymbian.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/remotemgmt_plat/devicemgmt_dialogs_api/inc/devicedialogsymbian.h Fri Aug 06 18:29:23 2010 +0530 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2010 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: Symbian specific constants for the device dialog. +* +*/ + + + +#ifndef DEVICEDIALOGSYMBIAN_H +#define DEVICEDIALOGSYMBIAN_H + +// INCLUDES + +// CONSTANTS +const TUint KSyncMLMaxServerMsgLength = 200; + +// MACROS + +// FORWARD DECLARATIONS +class TSyncMLAppLaunchNotifParams; +class TSyncMLDlgNotifParams; + +enum TSyncMLSessionTypes + { + ESyncMLUnknownSession, + ESyncMLSyncSession, + ESyncMLMgmtSession, + }; + +enum TSyncMLDlgNoteTypes + { + ESyncMLInfoNote, + ESyncMLErrorNote, + ESyncMLOkQuery, + ESyncMLYesNoQuery + }; + +enum TSyncMLSANSupport + { + ESANNotSpecified, + ESANSilent, + ESANUserInformative, + ESANUserInteractive + }; + +/** +* Struct to allow the sending of parameters to SyncML application +* starter notifier plugin. +* +* @lib SyncMLNotifier +* @since Series 60 3.0 +*/ +class TSyncMLAppLaunchNotifParams + { + public: + // Type of the SyncML session to be initiated. + TSyncMLSessionTypes iSessionType; + // Identifier of the job requested. + TInt iJobId; + // Identifier of the profile used + TInt iProfileId; + // Server alert Ui mode + TInt iUimode; + }; +/** +* Struct to allow the sending of parameters to SyncML server +* dialog notifier plugin. +* +* @lib SyncMLNotifier +* @since Series 60 3.0 +*/ +class TSyncMLDlgNotifParams + { + public: + // Type of the query or note to be shown. + TSyncMLDlgNoteTypes iNoteType; + // Message to be shown on the screen. + TBufC iServerMsg; + // Timeout of the note (in seconds). 0 = No timeout. + TInt iMaxTime; + //Max length + TInt iMaxLength; + }; + + +#endif // DEVICEDIALOGSYMBIAN_H + +// End of File diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h --- a/remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h Fri Jul 23 13:39:21 2010 +0530 +++ b/remotemgmt_plat/devicemgmt_dialogs_api/inc/dmindicatorconsts.h Fri Aug 06 18:29:23 2010 +0530 @@ -1,9 +1,19 @@ /* - * dmindicatorconsts.h - * - * Created on: Apr 20, 2010 - * Author: gnataraj - */ +* Copyright (c) 2010 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: constants for the device indicator. +* +*/ #ifndef DMINDICATORCONSTS_H_ #define DMINDICATORCONSTS_H_ diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/group/bld.inf --- a/remotemgmt_plat/group/bld.inf Fri Jul 23 13:39:21 2010 +0530 +++ b/remotemgmt_plat/group/bld.inf Fri Aug 06 18:29:23 2010 +0530 @@ -24,7 +24,6 @@ #include "../device_management_parameter_api/group/bld.inf" #include "../data_synchronization_plugin_api/group/bld.inf" #include "../sync_alert_handler_api/group/bld.inf" -#include "../syncml_notifier_api/group/bld.inf" #include "../syncml_client_api/group/bld.inf" #include "../device_management_plugin_api/group/bld.inf" #include "../dm_tree_apis/group/bld.inf" @@ -45,7 +44,6 @@ #include "../adaptive_history_list_session_api/group/bld.inf" #include "../fota_engine_api/group/bld.inf" #include "../update_package_storage_plugin_api/group/bld.inf" -#include "../syncml_notifier_roaming_api/group/bld.inf" #include "../dcmo_adapter_api/group/bld.inf" #include "../dcmo_control_api/group/bld.inf" #include "../ds_capability_mgmt_plugin_api/group/bld.inf" diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_api/group/bld.inf --- a/remotemgmt_plat/syncml_notifier_api/group/bld.inf Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2006 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: File that exports the files belonging to -: SyncML Notifier API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/SyncMLNotifierParams.h MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifierParams.h) -../inc/SyncMLNotifier.h MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifier.h) diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifier.h --- a/remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifier.h Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2005 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: Partial declaration of the notifier API. -* -*/ - - - -#ifndef SYNCMLNOTIFIER_H -#define SYNCMLNOTIFIER_H - -// INCLUDES -#include - -// CONSTANTS -// Notifier id for app starter notifier -const TUid KSyncMLAppLaunchNotifierUid = {0x101F8769}; - -// Notifier id for server dialog notifier -const TUid KSyncMLDlgNotifierUid = {0x101F876A}; -const TUid KSyncMLFwUpdNotifierUid = {0x102072BF}; // Notifier id for firmware update notifier - -// FUNCTION PROTOTYPES -// Notifier array (entry point) -IMPORT_C CArrayPtr* NotifierArray(); - -#endif // SYNCMLNOTIFIER_H - -// End of File diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifierParams.h --- a/remotemgmt_plat/syncml_notifier_api/inc/SyncMLNotifierParams.h Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,259 +0,0 @@ -/* -* Copyright (c) 2005 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: Partial declaration of the notifier API. -* -*/ - - - -#ifndef SYNCMLNOTIFIERPARAMS_H -#define SYNCMLNOTIFIERPARAMS_H - -// INCLUDES - -// CONSTANTS -const TUint KSyncMLMaxServerMsgLength = 200; -const TUint KSyncMLMaxProfileNameLength = 50; -const TUint KSyncMLMaxDefaultResponseMsgLength = 300; -const TUint KSyncMLMaxAlertResultLength = 150; -const TUint KSyncMLChoiceItemsLengthBuffer = 400; -const TUint KSyncMLMaxChoiceItemLength = 100; -const TUint KSyncMLChunknameLength = 25; - -// MACROS - -// FORWARD DECLARATIONS -class TSyncMLAppLaunchNotifParams; -class TSyncMLDlgNotifParams; -class TSyncMLAppLaunchNotifRetVal; -class TSyncMLDlgNotifRetVal; -class TSyncMLFwUpdNotifParams; -class TSyncMLFwUpdNotifRetVal; -class TSyncMLDlgNotifReturnParams; - - -// DATA TYPES -typedef TPckgBuf TSyncMLAppLaunchNotifParamsPckg; -typedef TPckgBuf TSyncMLDlgNotifParamsPckg; -typedef TPckgBuf TSyncMLFwUpdNotifParamsPckg; -typedef TPckgBuf TSyncMLAppLaunchNotifRetValPckg; -typedef TPckgBuf TSyncMLDlgNotifRetValPckg; -typedef TPckgBuf TSyncMLFwUpdNotifRetValPckg; -typedef TPckgBuf TSyncMLDlgNotifReturnParamsPckg; - - -enum TSyncMLSessionTypes - { - ESyncMLUnknownSession, - ESyncMLSyncSession, - ESyncMLMgmtSession, - }; - -enum TSyncMLDlgNoteTypes - { - ESyncMLInfoNote, - ESyncMLErrorNote, - ESyncMLOkQuery, - ESyncMLYesNoQuery, - ESyncMLQueryNote, // Deprecated. Use ESyncMLOkQuery or ESyncMLYesNoQuery instead - ESyncMLInputQuery, //For 1102 User Input alert - ESyncMLSingleChoiceQuery, //1103 - ESyncMLMultiChoiceQuery //1104 - }; - -enum TSyncMLFwUpdNoteTypes - { - ESyncMLFwUpdUnknown, - ESyncMLFwUpdErrorNote, - ESyncMLFwUpdResultNote, - ESyncMLFwUpdStartQuery, - ESyncMLFwUpdRebootNote, - ESyncMLFwUpdNoReminder, //Enum for No Reminder & Install Later note - ESyncMLFwUpdLargeNotEnoughMemory, //Enum for large object No Enough memory situation - ESyncMLFwUpdOmaDLNotEnoughMemory, //Enum for Oma Download No Enough memory situation - ESyncMLFwUpdOmaDLUserCancel, //Enum for Oma Download User cancel situation - ESyncMLFwUpdOmaDLPostponed, //Enum for Oma Download postponed - ESyncMLFwUpdOmaDLCancelled, //Enum for Oma Download cancelled - ESyncMLFwUpdOmaDLResume, //Enum for Oma Download Resume - ESyncMLFwUpdStartQueryEnc //Enum for starting installation on encrypted memory - - }; - - -enum TSyncMLFwUpdNoteInfo - { - KErrCommsLineFail2, //Enum for Oma Download connection failure with resume supported - KErrGeneralResume, //Enum for Oma Download general error with resume supported - KErrGeneralNoResume, //Enum for Oma Download general error without resume supported - KErrBadUsbPower, //Enum for low battery error when USB charging is supported - KErrBadPowerForEnc, //Enum for low battery error during encryption - KErrDeviceMemoryBusy //Enum to show drive busy error when encryption or decryption is in progress - }; - - -enum TSyncMLSANSupport - { - ESANNotSpecified, - ESANSilent, - ESANUserInformative, - ESANUserInteractive - }; - -enum TSyncMLUserInputTypes - { - ESyncMLInputTypeAlphaNumeric, - ESyncMLInputTypeNumeric, - ESyncMLInputTypeDate, - ESyncMLInputTypeTime, - ESyncMLInputTypePhoneNumber, - ESyncMLInputTypeIPAddress - }; - - enum TSyncMLUserInputEchoTypes - { - ESyncMLEchoTypeText, - ESyncMLEchoTypePassword - }; - - -// CLASS DECLARATION - -/** -* Struct to allow the sending of parameters to SyncML application -* starter notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.0 -*/ -class TSyncMLAppLaunchNotifParams - { - public: - // Type of the SyncML session to be initiated. - TSyncMLSessionTypes iSessionType; - // Identifier of the job requested. - TInt iJobId; - // Identifier of the profile used - TInt iProfileId; - // Server alert Ui mode - TInt iUimode; - }; - -/** -* Struct to allow the delivery of return values from SyncML application -* starter notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.0 -*/ -class TSyncMLAppLaunchNotifRetVal - { - public: - // Identifier of the session requested. - TUid iSecureId; - }; - - -/** -* Struct to allow the sending of parameters to SyncML server -* dialog notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.0 -*/ -class TSyncMLDlgNotifParams - { - public: - // Type of the query or note to be shown. - TSyncMLDlgNoteTypes iNoteType; - // Message to be shown on the screen. - TBufC iServerMsg; - // Timeout of the note (in seconds). 0 = No timeout. - TInt iMaxTime; - //Response message in case of 1102 alert - TBuf iDR; - //Input type - TInt iIT; - //Echo type - TInt iET; - //Max length - TInt iMaxLength; - //For choice alerts - TBufC iItemLength; - TBufC iChunkName; - //Number of choice items - TInt iNumberOfItems; - }; - - - -//For 1102 server alert -class TSyncMLDlgNotifReturnParams - { - public: - TInt iretval; //which stores the yes/no/end key pressed - TBuf irettext; - }; - - -/** -* Struct to allow the delivery of return values from SyncML server -* dialog notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.0 -*/ -class TSyncMLDlgNotifRetVal - { - // Included for future use. - }; - -/** -* Struct to allow the sending of parameters to SyncML firmware -* update notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.1 -*/ -class TSyncMLFwUpdNotifParams - { - public: - // Type of the SyncML session to be initiated. - TSyncMLFwUpdNoteTypes iNoteType; - - // Generic integer parameter. - // Usage: - // ESyncMLFwUpdErrorNote: Symbian error code. - // ESyncMLFwUpdResultNote: Symbian error code. - // ESyncMLFwUpdStartQuery: Firmware update profile identifier. - TInt iIntParam; - TInt iMemoryNeeded;// Parameter to hold how much memory is to be - // freed for downloading the package. - TBool iEncryptReq; //To tell if encrypt query should be shown to user. - }; - -/** -* Struct to allow the delivery of return values from SyncML firmware -* update notifier plugin. -* -* @lib SyncMLNotifier -* @since Series 60 3.1 -*/ -class TSyncMLFwUpdNotifRetVal - { - // Included for future use. - }; - -#endif // SYNCMLNOTIFIERPARAMS_H - -// End of File diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_api/syncml_notifier_api.metaxml --- a/remotemgmt_plat/syncml_notifier_api/syncml_notifier_api.metaxml Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - SyncML Notifier API - SyncML Notifier API which indicates the UIDs and the message formats that should be used/understood by the notifier side implementation for the notifications sent by the SyncMLFW subsystem. - c++ - syncmlfw - - - - - - - - yes - no - - diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_roaming_api/group/bld.inf --- a/remotemgmt_plat/syncml_notifier_roaming_api/group/bld.inf Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2006 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: File that exports the files belonging to -: SyncML Notifier Roaming API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/SyncMLNotifierDomainCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(SyncMLNotifierDomainCRKeys.h) diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_roaming_api/inc/SyncMLNotifierDomainCRKeys.h --- a/remotemgmt_plat/syncml_notifier_roaming_api/inc/SyncMLNotifierDomainCRKeys.h Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2007 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: SyncMLNotifier Domain CenRep key definitions -* -*/ - - -#ifndef SYNCMLNOTIFIER_DOMAIN_CR_KEYS_H -#define SYNCMLNOTIFIER_DOMAIN_CR_KEYS_H - -// CONSTANTS - -// SyncMLNotifier key UID -const TUid KCRUidNSmlNotifierDomainKeys = {0x101F8769}; - -// CenRep key used in variation of the aspects of -// the roaming feature. The flag values are -// commented below. -const TUint32 KNSmlDMBlockedInRoaming = 0x00000001; - - -// CenRep key for variable DM UI UID -const TUint32 KNSmlDMAppName = 0x00000002; - -// CenRep key for variable DM UI UID -const TUint32 KNSmlDMChargingNote = 0x00000003; - -#endif // NSMLDMSYNCAPP_PRIVATE_CR_KEYS_H - -// End of File diff -r 085438c28042 -r 1c556dee8eb1 remotemgmt_plat/syncml_notifier_roaming_api/syncml_notifier_roaming_api.metaxml --- a/remotemgmt_plat/syncml_notifier_roaming_api/syncml_notifier_roaming_api.metaxml Fri Jul 23 13:39:21 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - SyncML Notifier Roaming API - Notifier variation settings - c++ - omads - - - - - - - - yes - no - - diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp --- a/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/common/alertqueue/src/NSmlDMAlertParser11.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -21,7 +21,7 @@ #include "NSmlAlertQueue.h" #include "nsmldebug.h" #include -#include +#include // --------------------------------------------------------- // CNSmlDSAlertParser11(CSmlAlertInfo& aAlertInfo, CSyncMLHistoryPushMsg& aHistoryInfo ) // Returns pointer to the buffer diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/common/sosserver/inc/nsmlsosthread.h --- a/syncmlfw/common/sosserver/inc/nsmlsosthread.h Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/common/sosserver/inc/nsmlsosthread.h Fri Aug 06 18:29:23 2010 +0530 @@ -19,8 +19,7 @@ #ifndef __NSMLTHREADSTART_H__ #define __NSMLTHREADSTART_H__ -#include -#include +#include #include #include #include diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/common/sosserver/src/nsmlsosthread.cpp --- a/syncmlfw/common/sosserver/src/nsmlsosthread.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/common/sosserver/src/nsmlsosthread.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -843,7 +843,7 @@ }*/ - TSyncMLAppLaunchNotifParamsPckg data( aParam ); + if ( !KNSmlWaitNotifierForEver ) { diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/settings/src/NSmlDMSettings.cpp --- a/syncmlfw/dm/settings/src/NSmlDMSettings.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/settings/src/NSmlDMSettings.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -16,7 +16,7 @@ */ -#include +#include #include #include #include diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/syncagent/inc/NSmlDMAgent.h --- a/syncmlfw/dm/syncagent/inc/NSmlDMAgent.h Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/syncagent/inc/NSmlDMAgent.h Fri Aug 06 18:29:23 2010 +0530 @@ -22,11 +22,10 @@ // INCLUDES #include +#include +#include #include "NSmlAgentBase.h" - -#include "SyncMLNotifierParams.h" #include "NSmlPrivateAPI.h" -#include // FORWARD DECLARATIONS class MSyncMLProgressObserver; @@ -271,8 +270,7 @@ private: TRequestStatus& iCallerStatus; -// RNotifier iNotifier; - TSyncMLAppLaunchNotifRetValPckg iResBuf; + TInt& iCreatorId; CNSmlAgentNotifierTimeOut iNotifierTimeOut; diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/syncagent/inc/NSmlDMCmds.h --- a/syncmlfw/dm/syncagent/inc/NSmlDMCmds.h Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/syncagent/inc/NSmlDMCmds.h Fri Aug 06 18:29:23 2010 +0530 @@ -70,21 +70,12 @@ void FreeDMDevinfo(); TInt AlertParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const; //#ifdef RD_DM_TEXT_INPUT_ALERT //For User Input Server alert - TInt AlertInputTypeParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const; - TInt AlertEchoTypeParameter ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const; - TBool CheckDRPresence( const SmlPcdata_t* aData, const TDesC8& aParamID ) const; - TPtrC8 AlertDefaultResponseParam ( const SmlPcdata_t* aData, const TDesC8& aParamID ) const; //#endif //singlechoice - HBufC8* AlertChoiceItemsLC( SmlItemList_t* aItemList, HBufC8*& aLengthBuf,TInt& aNumItems ) const; void HandleAlertsL( SmlAlert_t* aAlert, TInt& aStatusId); void HandleAlertErrorL(); - void HandleChoiceAlertsL( SmlAlert_t* aAlert, TInt& aStatusId); - void SendMultiChoiceDataToServerL(TDes8& aData,TInt& aStatusId); void HandleConfirmationAlertL( SmlAlert_t* aAlert, TInt& aStatusId); void HandleDisplayAlertL( SmlAlert_t* aAlert, TInt& aStatusId); - void HandleUserInputalertL( SmlAlert_t* aAlert, TInt& aStatusId); - TInt FindMaxLength(TInt aSourceLength, TInt aDestLength); //singlechoice HBufC8* AlertDataLC( const SmlItemList_t* aItemList ) const; TInt InitStatusToAtomicOrSequenceL( const TDesC8& aCmd, const SmlAtomic_t* aAtomic ) const; diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/syncagent/inc/nsmldmagconstants.h --- a/syncmlfw/dm/syncagent/inc/nsmldmagconstants.h Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/syncagent/inc/nsmldmagconstants.h Fri Aug 06 18:29:23 2010 +0530 @@ -33,9 +33,7 @@ _LIT8( KNSmlDMAgentDisplayAlert, "1100" ); _LIT8( KNSmlDMAgentContinueOrAbortAlert, "1101" ); //#ifdef RD_DM_TEXT_INPUT_ALERT //for User Input Server alert -_LIT8( KNSmlDMAgentUserInputAlert, "1102" ); -_LIT8( KNSmlDMAgentSingleChoiceAlert, "1103" ); -_LIT8( KNSmlDMAgentMultipleChoiceAlert, "1104" ); + //#endif // DM protocol version _LIT8( KNSmlDMAgentVerProto, "DM/1.1" ); diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/syncagent/src/nsmldmagent.cpp --- a/syncmlfw/dm/syncagent/src/nsmldmagent.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/syncagent/src/nsmldmagent.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -50,7 +50,6 @@ #include "NSmlPrivateAPI.h" // FOTA end #include -const TUid KUidNotifier = { 0x101F8769 }; const TInt KNotifierTimeout = 300000000; // 5 min timeout _LIT8 ( KNSmlDMFotaNode, "FUMO" ); @@ -208,10 +207,7 @@ aAlertCode == KNSmlDMAgentNextMessage || aAlertCode == KNSmlDMAgentSessionAbortAlert || aAlertCode == KNSmlDMAgentDisplayAlert || - aAlertCode == KNSmlDMAgentContinueOrAbortAlert - || aAlertCode == KNSmlDMAgentUserInputAlert - || aAlertCode == KNSmlDMAgentSingleChoiceAlert - || aAlertCode == KNSmlDMAgentMultipleChoiceAlert ) + aAlertCode == KNSmlDMAgentContinueOrAbortAlert ) { return ETrue; } @@ -1899,16 +1895,6 @@ SetActive(); } - //connect to repository - CRepository* rep = CRepository::NewLC( KCRUidPolicyManagementUtilInternalKeys ); - - //get parameters - TSyncMLAppLaunchNotifParams params; - TPckg data( params ); - User::LeaveIfError( rep->Get( KSyncMLSessionParamsKey, data)); - - CleanupStack::PopAndDestroy( rep); - iNotifierTimeOut.LaunchNotifierTimer( this ); // User::LeaveIfError( iNotifier.Connect() ); // iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf ); @@ -1957,7 +1943,6 @@ if ( ret == KErrNone ) { - TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier. // Check the response and error code. If there is a fail, dump the job. // Also compare sid to creator id saved for current job to secure that listener owns the job. diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/dm/syncagent/src/nsmldmcmds.cpp --- a/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/dm/syncagent/src/nsmldmcmds.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -25,7 +25,7 @@ #include #include // FOTA end -#include +#include #include #include @@ -81,12 +81,9 @@ // FOTA const TInt KNSmlDmNoRequest = -1; // FOTA end -const TInt KNSmlDmChoiceChunkMinSize = 32; -const TInt KNSmlDmChoiceChunkMaxSize = 10000; _LIT8 ( KNSmlDMMetaTypeUserRequest, "org.openmobilealliance.dm.firmwareupdate.userrequest" ); _LIT8 ( KNSmlDMMetaFormatUserRequest, "chr" ); -_LIT(KChunkName,"AlertItems"); const TUid dmagentuid = { @@ -326,169 +323,6 @@ return valueNum; } -//#ifdef RD_DM_TEXT_INPUT_ALERT -// --------------------------------------------------------- -// CNSmlDMCmds::AlertInputTypeParameter() -// For 1102-User Input server alert -// For Input Type optional parameter -// --------------------------------------------------------- -TInt CNSmlDMCmds::AlertInputTypeParameter( const SmlPcdata_t* aData, const TDesC8& aParamID ) const - { - _DBG_FILE("CNSmlDMCmds::AlertInputTypeParameter: begin"); - TInt valueNum = 0;//alphanumeric by default - if ( aData ) - { - if ( aData->content ) - { - TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length ); - TrimRightSpaceAndNull( parameters ); - TInt startPos = parameters.Find( aParamID ); - if ( startPos >= 0 ) - { - if ( parameters.Length() > startPos + aParamID.Length() ) - { - TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) ); - TInt length = 0; - TChar character = strPart[length]; - - switch( character ) - { - case 'A': //Alphanumeric - valueNum = ESyncMLInputTypeAlphaNumeric; - break; - case 'N': //Numeric - valueNum = ESyncMLInputTypeNumeric; - break; - case 'D': //Date - valueNum = ESyncMLInputTypeDate; - break; - case 'T': //Time - valueNum = ESyncMLInputTypeTime; - break; - case 'P': //Phone number - valueNum = ESyncMLInputTypePhoneNumber; - break; - case 'I': //Ip address - valueNum = ESyncMLInputTypeIPAddress; - break; - } - } - } - } - } - _DBG_FILE("CNSmlDMCmds::AlertInputTypeParameter: end"); - return valueNum; - } - -// --------------------------------------------------------- -// CNSmlDMCmds::AlertEchoTypeParameter() -// For 1102-User Input server alert -// For Echo Type optional parameter -// --------------------------------------------------------- -TInt CNSmlDMCmds::AlertEchoTypeParameter( const SmlPcdata_t* aData, const TDesC8& aParamID ) const - { - _DBG_FILE("CNSmlDMCmds::AlertEchoTypeParameter: begin"); - TInt valueNum = 0;//Text by default - if ( aData ) - { - if ( aData->content ) - { - TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length ); - TrimRightSpaceAndNull( parameters ); - TInt startPos = parameters.Find( aParamID ); - if ( startPos >= 0 ) - { - if ( parameters.Length() > startPos + aParamID.Length() ) - { - TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) ); - TInt length = 0; - TChar character = strPart[length]; - switch( character ) - { - - case 'T': valueNum = ESyncMLEchoTypeText; - break; - case 'P': valueNum = ESyncMLEchoTypePassword; - break; - default: - break; - } - } - } - } - } - _DBG_FILE("CNSmlDMCmds::AlertEchoTypeParameter: end"); - return valueNum; - } -// --------------------------------------------------------- -// CNSmlDMCmds::CheckDRPresence() -// For 1102-User Input server alert -// For Default Response item existence verification -// --------------------------------------------------------- -TBool CNSmlDMCmds::CheckDRPresence( const SmlPcdata_t* aData, const TDesC8& aParamID ) const - { - if ( aData ) - { - if ( aData->content ) - { - TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length ); - TrimRightSpaceAndNull( parameters ); - TInt startPos = parameters.Find( aParamID ); - if ( startPos >= 0 ) - { - return ETrue; - } - } - } - return EFalse; - } - -// --------------------------------------------------------- -// CNSmlDMCmds::AlertDefaultResponseParam() -// For 1102-User Input server alert -// For Default Response optional parameter -// --------------------------------------------------------- -TPtrC8 CNSmlDMCmds::AlertDefaultResponseParam( const SmlPcdata_t* aData, const TDesC8& aParamID ) const - { - _DBG_FILE("CNSmlDMCmds::AlertDefaultResponseParam: begin"); - TLex8 value; - if ( aData ) - { - if ( aData->content ) - { - TPtr8 parameters( (TUint8*) aData->content, aData->length, aData->length ); - TrimRightSpaceAndNull( parameters ); - TInt startPos = parameters.Find( aParamID ); - if ( startPos >= 0 ) - { - if ( parameters.Length() > startPos + aParamID.Length() ) - { - TPtrC8 strPart = parameters.Right( parameters.Length() - ( startPos + aParamID.Length() ) ); - TInt length = 0; - while ( length < strPart.Length() ) - { - TChar character = strPart[length]; - if ( character != '&' ) - { - ++length; - } - else - { - break; - } - } - TPtrC8 valueStr = strPart.Left( length ); - value.Assign( valueStr ); - - } - } - } - } - _DBG_FILE("CNSmlDMCmds::AlertDefaultResponseParam: end"); - return value.Remainder(); - } -//#endif - // --------------------------------------------------------- // CNSmlDMCmds::AlertDataLC() // @@ -1135,10 +969,7 @@ alertCode == KNSmlDMAgentNextMessage || alertCode == KNSmlDMAgentSessionAbortAlert || alertCode == KNSmlDMAgentServerInitAlert || - alertCode == KNSmlDMAgentClientInitAlert - || alertCode == KNSmlDMAgentUserInputAlert - || alertCode == KNSmlDMAgentSingleChoiceAlert - || alertCode == KNSmlDMAgentMultipleChoiceAlert) + alertCode == KNSmlDMAgentClientInitAlert ) { HandleAlertsL(aAlert,statusID); } @@ -1179,10 +1010,7 @@ void CNSmlDMCmds::HandleAlertsL( SmlAlert_t* aAlert, TInt& aStatusId) { TPtr8 alertCode = AlertCode( aAlert ); - if ( alertCode == KNSmlDMAgentDisplayAlert || alertCode == KNSmlDMAgentContinueOrAbortAlert - || alertCode == KNSmlDMAgentUserInputAlert - || alertCode == KNSmlDMAgentSingleChoiceAlert - || alertCode == KNSmlDMAgentMultipleChoiceAlert ) + if ( alertCode == KNSmlDMAgentDisplayAlert || alertCode == KNSmlDMAgentContinueOrAbortAlert ) { if ( !aAlert->itemList ) { @@ -1205,15 +1033,7 @@ { HandleConfirmationAlertL(aAlert,aStatusId); } - else if(alertCode == KNSmlDMAgentUserInputAlert) - { - HandleUserInputalertL(aAlert,aStatusId); - } - else if(alertCode == KNSmlDMAgentSingleChoiceAlert - || alertCode == KNSmlDMAgentMultipleChoiceAlert) - { - HandleChoiceAlertsL(aAlert,aStatusId); - } + else // { @@ -1221,262 +1041,6 @@ } } -// --------------------------------------------------------- -// CNSmlDMCmds::HandleChoiceAlertsL -// Handles Choice Alert commands from a server. -// --------------------------------------------------------- -void CNSmlDMCmds::HandleChoiceAlertsL( SmlAlert_t* aAlert, TInt& aStatusId) - { - const TChar KDRSeparator('-'); - const TChar KChoiceItemSeparator(','); - TPtr8 alertCode = AlertCode( aAlert ); - // MINDT - TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMINDT ); - // MAXDT - TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXDT ); - if ( mindt > maxdt ) - { - maxdt = mindt; - } - TSyncMLDlgNotifParams notifyParams; - TInt maxlen = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXLEN ); - - //check if iDR, Default response parameter is there or not - //DRPresent is used for destroying how many items in the pop up stack - TBool DRPresent = CheckDRPresence( aAlert->itemList->item->data, KNSmlDMAgentDR ); - if( DRPresent ) - { - TPtrC8 DrPtr = AlertDefaultResponseParam( aAlert->itemList->item->data, KNSmlDMAgentDR ); - HBufC8* hptr = HBufC8::NewLC( DrPtr.Length()+ 4 ); //cs 1dr - TPtr8 DrBuf(hptr->Des()); - if(alertCode == KNSmlDMAgentMultipleChoiceAlert) - { - _DBG_FILE("drbuf multichoice"); - DrBuf.Append(KDRSeparator); - DrBuf.Append(DrPtr); - DrBuf.Append(KDRSeparator); - } - else - { - DrBuf.Append(DrPtr); - } - HBufC* DrBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( DrBuf ); - CleanupStack::PushL( DrBuf16 ); //cs 2dr - notifyParams.iDR = *DrBuf16; - } - HBufC8* alertData = AlertDataLC( aAlert->itemList ); //cs 1 - if ( alertData->Length() == 0) - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(2);//alertData,hptr,DrBuf16 - } - CleanupStack::PopAndDestroy();//alertData - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand ); - HandleAlertErrorL(); - return; - } - - HBufC8* alertDataWithMDT = HBufC8::NewLC(alertData->Length()+KNSmlDMAgentMINDT().Length()+KNSmlDMAgentMAXDT().Length()+6); //cs 2 - TPtr8 dataBuf = alertDataWithMDT->Des(); - dataBuf.Append(*alertData); - HBufC* dataBuf16 = NULL; - TRAPD(errC, dataBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(dataBuf)); - if( errC == KErrCorrupt ) - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(2); //alertData hptr,DrBuf16,alertDataWithMDT - } - CleanupStack::PopAndDestroy(2); //alertData alertDataWithMDT - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed ); - return; - } - CleanupStack::PushL(dataBuf16); //cs 3 - //RNotifier notifier; - //User::LeaveIfError( notifier.Connect() ); - //CleanupClosePushL(notifier); //cs - TPckgBuf resBuf; - /* - //TO reduce cyclomatic complexity - if( dataBuf16->Length() > KSyncMLMaxServerMsgLength ) - { - notifyParams.iServerMsg = (*dataBuf16).Left(KSyncMLMaxServerMsgLength) ; - } - else - { - notifyParams.iServerMsg = *dataBuf16; - } */ - TInt datalength = FindMaxLength(dataBuf16->Length(),KSyncMLMaxServerMsgLength); - notifyParams.iServerMsg = (*dataBuf16).Left(datalength); - notifyParams.iMaxTime = maxdt; - notifyParams.iMaxLength = maxlen; - TRequestStatus status; - _DBG_FILE("starting of choice alerts"); - //Retrieve items list - HBufC8* lengthbuf = HBufC8::NewLC(100); //cs 4 - TInt NumItems = 0 ; - HBufC8* listitems = AlertChoiceItemsLC(aAlert->itemList,lengthbuf,NumItems); //cs 5 - if(!NumItems) - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(2); - } - CleanupStack::PopAndDestroy(5); - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand ); - return; - } - notifyParams.iNumberOfItems = NumItems; - HBufC* choiceitemslength = NULL; - TRAPD(errL, choiceitemslength = CnvUtfConverter::ConvertToUnicodeFromUtf8L(lengthbuf->Des())); - if( errL/* == KErrCorrupt*/ )//useful for low memory and other cases - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(2); - } - CleanupStack::PopAndDestroy(5); - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed ); - return; - } - CleanupStack::PushL(choiceitemslength); //cs 6 - - /* if( choiceitemslength->Length() > KSyncMLChoiceItemsLengthBuffer ) - { - notifyParams.iItemLength = (*choiceitemslength).Left(KSyncMLChoiceItemsLengthBuffer) ; - } - else - { - notifyParams.iItemLength = *choiceitemslength; - } */ - datalength = FindMaxLength(choiceitemslength->Length(),KSyncMLChoiceItemsLengthBuffer); - notifyParams.iItemLength = (*choiceitemslength).Left(datalength); - if( alertCode == KNSmlDMAgentMultipleChoiceAlert) - { - _DBG_FILE("multiple choice alerts"); - notifyParams.iNoteType = ESyncMLMultiChoiceQuery; - } - else - { - _DBG_FILE("single choice alerts"); - notifyParams.iNoteType = ESyncMLSingleChoiceQuery; - } - if(iChunk.Handle()) - iChunk.Close(); - else - { - TTime now; - now.HomeTime(); - TInt64 rand = now.Int64(); - // Use timestamp to get a unique seed - TInt randnum = Math::Rand( rand ); - TBuf chunkname; - chunkname.AppendNum(randnum); - chunkname.Append(KChunkName); - notifyParams.iChunkName = chunkname; - TInt err1 = iChunk.CreateGlobal( chunkname, - KNSmlDmChoiceChunkMinSize, KNSmlDmChoiceChunkMaxSize ); - DBG_FILE_CODE(err1,_S8("chunk creating error is ")); - if( err1 < 0 && err1 != KErrAlreadyExists ) - User::LeaveIfError(err1); - if( err1 == KErrAlreadyExists ) - { err1 = iChunk.OpenGlobal(chunkname,EFalse); - DBG_FILE_CODE(err1,_S8("chunk opening error is ")); - User::LeaveIfError(err1); - } - } - TInt size1 = iChunk.Size(); - DBG_FILE_CODE(size1,_S8("chunk size is ")); - - RMemWriteStream chunkStream ( iChunk.Base(), iChunk.Size() ); - CleanupClosePushL ( chunkStream ); //cs - chunkStream.WriteL ( listitems->Des() ); - CleanupStack::PopAndDestroy(1);//chunkstream - TPckgBuf pkgBuf( notifyParams ); - TSyncMLDlgNotifReturnParams emptybuf; - TSyncMLDlgNotifReturnParamsPckg resultBuf( emptybuf ); -/* RNotifier notifier; - User::LeaveIfError( notifier.Connect() ); - CleanupClosePushL(notifier); //cs 7 - _DBG_FILE("starting choice notifier"); - notifier.StartNotifierAndGetResponse( status, KNSmlSyncDialogUid, pkgBuf, resultBuf ); - _DBG_FILE("notifier returned"); - User::WaitForRequest( status ); - CleanupStack::PopAndDestroy(4);//notifier,lengthbuf,listitems,choiceitemslength -*/ - CleanupStack::PopAndDestroy(3);//lengthbuf,listitems,choiceitemslength - iChunk.Close(); - TBuf8 rettext; - rettext.Copy( resultBuf().irettext.Left( KSyncMLMaxAlertResultLength ) ); - if ( status != KErrNone ) - { - TInt error = TNSmlError::ESmlStatusOperationCancelled ; - iStatusToServer->SetStatusCodeL( aStatusId, error ); - HandleAlertErrorL(); - } - else - { - //For sending data to server - if( alertCode == KNSmlDMAgentMultipleChoiceAlert) - { - SendMultiChoiceDataToServerL(rettext,aStatusId); - } - else - { - SmlPcdata_t* data = NULL; - PcdataNewL( data, rettext); - CleanupStack::PushL( data ); - iStatusToServer->AddItemDataL( aStatusId, data ); - CleanupStack::PopAndDestroy(); //data - } - } - if( DRPresent ) - CleanupStack::PopAndDestroy(2); //hptr,DrBuf16 - - CleanupStack::PopAndDestroy(3); //notifier,alertData,alertDataWithMDT,dataBuf16 - } - -// --------------------------------------------------------- -// CNSmlDMCmds::SendMultiChoiceDataToServerL -// Sends Multiple Choice Alert status to server. -// --------------------------------------------------------- -void CNSmlDMCmds::SendMultiChoiceDataToServerL(TDes8& aData,TInt& aStatusId) - { - const TChar KDRSeparator('-'); - TPtrC8 temp1,temp2; - TInt prevcommapos = 0; - SmlPcdata_t* data = NULL; - for(TInt i=0;iAddItemDataL( aStatusId, data ); - CleanupStack::PopAndDestroy(); //data - data = NULL; - - } - } - - } // --------------------------------------------------------- // CNSmlDMCmds::HandleConfirmationAlertL @@ -1535,21 +1099,7 @@ if(!IsHbSyncmlNotifierEnabledL()) { _DBG_FILE("starting notifier"); -/* RNotifier notifier; - User::LeaveIfError(notifier.Connect()); - CleanupClosePushL(notifier); - - - notifier.StartNotifierAndGetResponse(status, KNSmlSyncDialogUid, pkgBuf, - resBuf); - User::WaitForRequest(status); - - - - //TBool ret = resBuf(); - - CleanupStack::PopAndDestroy(); - */ + } else { @@ -1572,126 +1122,9 @@ iStatusToServer->SetStatusCodeL( aStatusId, error ); HandleAlertErrorL(); } - CleanupStack::PopAndDestroy(3); //alertData alertDataWithMDT,databuf16,notifier + CleanupStack::PopAndDestroy(3); //alertData alertDataWithMDT,databuf16 } -// --------------------------------------------------------- -// CNSmlDMCmds::HandleUserInputalertL -// Handles user Text Input Alert command from a server. -// --------------------------------------------------------- - void CNSmlDMCmds::HandleUserInputalertL( SmlAlert_t* aAlert, TInt& aStatusId) - { - // MINDT - TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMINDT ); - // MAXDT - TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXDT ); - if ( mindt > maxdt ) - { - maxdt = mindt; - } - TSyncMLDlgNotifParams notifyParams; - TInt maxlen = AlertParameter( aAlert->itemList->item->data, KNSmlDMAgentMAXLEN ); - TInt InputType = AlertInputTypeParameter( aAlert->itemList->item->data, KNSmlDMAgentIT ); - TInt EchoType = AlertEchoTypeParameter( aAlert->itemList->item->data, KNSmlDMAgentET ); - //check if iDR, Default response parameter is there or not - //DRPresent is used for destroying how many items in the pop up stack - TBool DRPresent = CheckDRPresence( aAlert->itemList->item->data, KNSmlDMAgentDR ); - if( DRPresent ) - { - TPtrC8 DrPtr = AlertDefaultResponseParam( aAlert->itemList->item->data, KNSmlDMAgentDR ); - HBufC8* hptr = HBufC8::NewLC( DrPtr.Length()+ 4 ); //cs - TPtr8 DrBuf(hptr->Des()); - - DrBuf.Append(DrPtr); - - HBufC* DrBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( DrBuf ); - CleanupStack::PushL( DrBuf16 );//cs - notifyParams.iDR = *DrBuf16; - } - HBufC8* alertData = AlertDataLC( aAlert->itemList );//cs - if ( alertData->Length() == 0) - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(3);//alertData,hptr,DrBuf16 - } - else - { - CleanupStack::PopAndDestroy();//alertData - } - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusIncompleteCommand ); - HandleAlertErrorL(); - return; - } - HBufC8* alertDataWithMDT = HBufC8::NewLC(alertData->Length()+KNSmlDMAgentMINDT().Length()+KNSmlDMAgentMAXDT().Length()+6);//cs - TPtr8 dataBuf = alertDataWithMDT->Des(); - dataBuf.Append(*alertData); - HBufC* dataBuf16 = NULL; - TRAPD(errC, dataBuf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(dataBuf)); - if( errC == KErrCorrupt ) - { - if( DRPresent ) - { - CleanupStack::PopAndDestroy(4); //alertData hptr,DrBuf16,alertDataWithMDT - } - else - { - CleanupStack::PopAndDestroy(2); //alertData alertDataWithMDT - } - iStatusToServer->SetStatusCodeL( aStatusId, TNSmlError::ESmlStatusCommandFailed ); - return; - } - CleanupStack::PushL(dataBuf16); //cs -/* RNotifier notifier; - User::LeaveIfError( notifier.Connect() ); - CleanupClosePushL(notifier); //cs -*/ - TPckgBuf resBuf; - if( dataBuf16->Length() > KSyncMLMaxServerMsgLength ) - { - notifyParams.iServerMsg = (*dataBuf16).Left(KSyncMLMaxServerMsgLength) ; - } - else - { - notifyParams.iServerMsg = *dataBuf16; - } - notifyParams.iMaxTime = maxdt; - notifyParams.iMaxLength = maxlen; - notifyParams.iET = EchoType; - notifyParams.iIT = InputType; - TRequestStatus status; - //Note type to Text input note - notifyParams.iNoteType = ESyncMLInputQuery; - TPckgBuf pkgBuf( notifyParams ); - TSyncMLDlgNotifReturnParams emptybuf; - TSyncMLDlgNotifReturnParamsPckg resultBuf( emptybuf ); -/* notifier.StartNotifierAndGetResponse( status, KNSmlSyncDialogUid, pkgBuf, resultBuf ); - User::WaitForRequest( status ); -*/ - TBuf8 rettext; - rettext.Copy( resultBuf().irettext.Left( KSyncMLMaxDefaultResponseMsgLength ) ); -/* if ( status == KErrCancel || status == KErrTimedOut || status == KErrAbort ) - { - TInt error = TNSmlError::ESmlStatusOperationCancelled ; - iStatusToServer->SetStatusCodeL( aStatusId, error ); - HandleAlertErrorL(); - } -*/ - //For sending data to server - SmlPcdata_t* data = NULL; - PcdataNewL( data, rettext); - CleanupStack::PushL( data ); - iStatusToServer->AddItemDataL( aStatusId, data ); - CleanupStack::PopAndDestroy(); //data - if( DRPresent ) - CleanupStack::PopAndDestroy(5); //alertData,alertDataWithMDT,dataBuf16,hptr,DrBuf16 -// CleanupStack::PopAndDestroy(6); //notifier,alertData,alertDataWithMDT,dataBuf16,hptr,DrBuf16 - else - //#endif -// CleanupStack::PopAndDestroy(4); //notifier,alertData,alertDataWithMDT,dataBuf16 - CleanupStack::PopAndDestroy(3); //alertData,alertDataWithMDT,dataBuf16 - } - // --------------------------------------------------------- // CNSmlDMCmds::HandleDisplayAlertL // Handles Display Alert command from a server. @@ -1745,14 +1178,7 @@ TPckgBuf pkgBuf( notifyParams ); if(!IsHbSyncmlNotifierEnabledL()) { - /* RNotifier notifier; - User::LeaveIfError(notifier.Connect()); - CleanupClosePushL(notifier); - notifier.StartNotifierAndGetResponse(status, KNSmlSyncDialogUid, pkgBuf, - resBuf); - User::WaitForRequest(status); - CleanupStack::PopAndDestroy(); //notifier -*/ + } else { @@ -2410,131 +1836,3 @@ aStatusCode = TNSmlError::ESmlStatusIncompleteCommand; } } - -// --------------------------------------------------------------------------------------------------------------- -// CNSmlDMCmds::AlertChoiceItemsLC() -// Retrieves the choice alerts information -// --------------------------------------------------------------------------------------------------------------- -HBufC8* CNSmlDMCmds::AlertChoiceItemsLC(SmlItemList_t* aItemList,HBufC8*& aLengthBuf ,TInt& aNumItems ) const - { - /*cleanupstack contains - * top : tempdata - * : unicodeData - * bottom: aLengthBuf - */ - const TChar KDRSeparator('-'); -const TChar KChoiceItemSeparator(','); - HBufC8* unicodeData = HBufC8::NewLC(200); - HBufC8* tempdata = NULL; - HBufC8* lengthbuf = aLengthBuf; - TBuf<20> lennum; - SmlItemList_t* temp; - if ( aItemList )//Not null - { - if(aItemList->next)//removing header of dialog - { - temp = aItemList->next; - while(temp->next) - { - if ( temp->next->item ) - { - if ( temp->next->item->data ) - { - if ( temp->next->item->data->content ) - { - TPtr8 data( (TUint8*) temp->next->item->data->content, temp->next->item->data->length, temp->next->item->data->length ); - TrimRightSpaceAndNull( data ); - tempdata = data.AllocLC(); - TInt length = data.Length();//item length - //add length to buffer and add comma - if(lengthbuf->Des().MaxLength() > (lengthbuf->Des().Length() + 5/*bytes*/) ) - { - if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200 - { - lennum.Num(KSyncMLMaxChoiceItemLength); - lengthbuf->Des().Append(lennum); - lengthbuf->Des().Append(KChoiceItemSeparator); - } - else - { - lennum.Num(length); - lengthbuf->Des().Append(lennum); - lengthbuf->Des().Append(KChoiceItemSeparator); - } - } - else - { - //Pop the aLengthBuf from cleanupstack and realloc - CleanupStack::Pop(3); //tempdata,unicodeData,aLengthBuf - lengthbuf = lengthbuf->ReAllocL(lengthbuf->Des().Length() + 100); - CleanupStack::PushL(lengthbuf); - CleanupStack::PushL(unicodeData); - CleanupStack::PushL(tempdata); - if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200 - { - lengthbuf->Des().AppendNum(KSyncMLMaxChoiceItemLength); - lengthbuf->Des().Append(KChoiceItemSeparator); - } - else - { - lengthbuf->Des().AppendNum(length); //Append(length); - lengthbuf->Des().Append(KChoiceItemSeparator); - } - } - if(unicodeData->Des().MaxLength()> (unicodeData->Des().Length() + length)) - { - if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200 - { - unicodeData->Des().Append(tempdata->Des().Left(KSyncMLMaxChoiceItemLength)); - } - else - { - unicodeData->Des().Append(tempdata->Des()); - } - } - else - { - CleanupStack::Pop(2);//tempdata,unicodeData - unicodeData = unicodeData->ReAllocL(unicodeData->Des().Length() + length + 200); - CleanupStack::PushL(unicodeData); - CleanupStack::PushL(tempdata); - if(length > KSyncMLMaxChoiceItemLength ) // choice item length restricting to 200 - { - unicodeData->Des().Append(tempdata->Des().Left(KSyncMLMaxChoiceItemLength)); - } - else - { - unicodeData->Des().Append(tempdata->Des()); - } - } - CleanupStack::PopAndDestroy(tempdata); - aNumItems++; - data.Zero(); - } - } - } - temp = temp->next; - } - } - } - _DBG_FILE("CNSmlDMCmds::AlertDataLC: end"); - aLengthBuf = lengthbuf; - return unicodeData; - } - -// --------------------------------------------------------------------------------------------------------------- -// CNSmlDMCmds::FindMaxLength() -// --------------------------------------------------------------------------------------------------------------- -TInt CNSmlDMCmds::FindMaxLength(TInt aSourceLength, TInt aDestLength) - { - TInt length = 0; - if(aSourceLength > aDestLength ) - { - length = aDestLength; - } - else - { - length = aSourceLength; - } - return length; - } diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h --- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/inc/testprofileutil.h Fri Aug 06 18:29:23 2010 +0530 @@ -25,7 +25,8 @@ #include #include #include - +#include +#include //SyncML Includes @@ -34,7 +35,6 @@ #include #include #include -#include // CONSTANTS @@ -229,8 +229,7 @@ TSmlTransportId iConnectionId; TSmlDataProviderId iDataProviderId; - MProfileEngineExtended* iProfileEngine; - // Reserved pointer for future extension + // Reserved pointer for future extension //TAny* iReserved; public: // Friend classes @@ -334,7 +333,9 @@ void CloseSyncSession(); - private: + void OfflineModeL(); + + private: TInt iInterruptStage; @@ -347,9 +348,6 @@ TStatus iPrgPrevStatus; TStatus iPrgCurStatus; - - MProfileEngineExtended* iProfileEngine; - }; diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp --- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testprofileutilBlocks.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -690,11 +690,14 @@ TInt Ctestprofileutil::OffLineL( CStifItemParser& /*aItem*/ ) { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - - + CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs); + TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, + ECoreAppUIsNetworkConnectionNotAllowed); + + if(repository) + delete repository; + + User::LeaveIfError(err); return KErrNone; } @@ -708,11 +711,14 @@ TInt Ctestprofileutil::GeneralL( CStifItemParser& /*aItem*/ ) { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL(0); - iProfileEngine->Release(); - - + CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs); + TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, + ECoreAppUIsNetworkConnectionAllowed); + if(repository) + delete repository; + User::LeaveIfError(err); + + return KErrNone; } diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp --- a/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/ds/dsutils/ProfileUtil/testprofileutil/src/testsync.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -267,55 +267,25 @@ switch(iInterruptStage) { case 1:if(aStatus==ESmlConnecting) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } - break; + OfflineModeL(); + break; case 2:if(aStatus==ESmlConnected) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } - - break; + OfflineModeL(); + break; case 3:if(aStatus==ESmlLoggingOn) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } + OfflineModeL(); break; case 4:if(aStatus==ESmlLoggedOn) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } + OfflineModeL(); break; case 5:if(aStatus==ESmlSendingModificationsToServer) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } - break; - + OfflineModeL(); + break; case 6:if(aStatus==ESmlReceivingModificationsFromServer) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } + OfflineModeL(); break; case 7:if(aStatus==ESmlSendingMappingsToServer) - { - iProfileEngine = CreateProfileEngineExtendedL(); - iProfileEngine->SetActiveProfileL( 5); - iProfileEngine->Release(); - } + OfflineModeL(); break; default: break; @@ -332,5 +302,15 @@ //Do Nothing } +void CSync::OfflineModeL() +{ + CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs); + TInt err = repository->Set(KCoreAppUIsNetworkConnectionAllowed, + ECoreAppUIsNetworkConnectionNotAllowed); + if(repository) + delete repository; + User::LeaveIfError(err); + +} diff -r 085438c28042 -r 1c556dee8eb1 syncmlfw/ds/syncagent/src/nsmldscmds.cpp --- a/syncmlfw/ds/syncagent/src/nsmldscmds.cpp Fri Jul 23 13:39:21 2010 +0530 +++ b/syncmlfw/ds/syncagent/src/nsmldscmds.cpp Fri Aug 06 18:29:23 2010 +0530 @@ -18,8 +18,6 @@ #define SYNCML_V3 // INCLUDE FILES #include -#include -#include #include #include #include @@ -1539,38 +1537,8 @@ iAgent->Interrupt( TNSmlError::ESmlAlertInvalid, EFalse, EFalse ); return; } - - //Read min and max times - // MINDT - TInt mindt = AlertParameter( aAlert->itemList->item->data, KNSmlDSAgentMINDT ); - // MAXDT - TInt maxdt = AlertParameter( aAlert->itemList->item->data, KNSmlDSAgentMAXDT ); - - HBufC* alertData = AlertDataLC( aAlert->itemList ); - - //Fill notifier params - TSyncMLDlgNotifParams params; - params.iNoteType = ESyncMLInfoNote; - params.iServerMsg = TBufC(alertData->Des()); - - CleanupStack::PopAndDestroy(); //alertData - - //Pack data and start notifier - RNotifier notifier; - User::LeaveIfError( notifier.Connect() ); - CleanupClosePushL(notifier); - - TPckgBuf resBuf; - TRequestStatus status; - - TSyncMLDlgNotifParamsPckg data(params); - - notifier.StartNotifierAndGetResponse( status, KSyncMLDlgNotifierUid, data, resBuf ); - User::WaitForRequest(status); - - CleanupStack::PopAndDestroy(); //notifier, - + // SyncmlNotifier Dependency is removed return; }