/** * @glsymbols * @glfunref{GetSync} * @gldefref{OBJECT_TYPE} */ SyncType Type() const { GLint result = 0; OGLPLUS_GLFUNC(GetSynciv)(_sync, GL_OBJECT_TYPE, 1, nullptr, &result); return SyncType(result); }
//=============================================== // CNSmlProfileContentHandler::Charecters() // // //=============================================== TInt CNSmlProfileContentHandler::Charecters(TDesC& aBuf, TInt /*aStart*/, TInt /*aLength*/) { TInt aValue; if (iDSSettingInProgress) { if(iState == EProfileDisplayName) { if(aBuf.Length() > KNSmlMaxProfileNameLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, aBuf) ; } iState = EStateHandled; } if(iState == EProfileServerURL) { if(aBuf.Length() > KDSMaxURLLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { SetServerURL(aBuf); } iState = EStateHandled; } if(iState == EProfileIAPId) { if(aBuf.Length() > KAccessPointNameMaxLen) { _LIT(KDefaultValue ,"-1"); aBuf = KDefaultValue; } TInt iapId = AccessPointIdL(aBuf); iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileIAPId, iapId) ; iState = EStateHandled; } if(iState == EProfileTransportId) { _LIT16(KHexCode,"0x"); TBuf<64> tempBuf(aBuf); TInt temp = tempBuf.Find(KHexCode); tempBuf.Delete(0, temp + 2); iLex = tempBuf; TInt64 aVal; User::LeaveIfError(iLex.Val(aVal ,EHex)); if (aVal != KUidNSmlMediumTypeInternet.iUid && aVal != KUidNSmlMediumTypeBluetooth.iUid) { aVal = KUidNSmlMediumTypeInternet.iUid; } iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileTransportId, aVal) ; iState = EStateHandled; } if(iState == EProfileSyncServerUsername) { if(aBuf.Length() > KNSmlMaxUsernameLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileSyncServerUsername, aBuf) ; } iState = EStateHandled; } if(iState == EProfileSyncServerPassword) { if(aBuf.Length() > KNSmlMaxPasswordLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileSyncServerPassword, aBuf) ; } iState = EStateHandled; } if(iState == EProfileServerAlertedAction) { iLex = aBuf; User::LeaveIfError(iLex.Val(aValue)); TInt typeId = ServerAlertType(aValue); if(aValue != ESmlEnableSync && aValue != ESmlConfirmSync && aValue != ESmlDisableSync) { aValue = ESmlEnableSync; } iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileServerAlertedAction, typeId) ; iState = EStateHandled; } if(iState == EProfileHidden) { iLex = aBuf; User::LeaveIfError(iLex.Val(aValue)); SetVisibility(aValue); iState = EStateHandled; } if(iState == EProfileHttpAuthUsed) { iLex = aBuf; User::LeaveIfError(iLex.Val(aValue)); if (aValue != 0 && aValue != 1) { aValue = 1; } iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileHttpAuthUsed, aValue) ; iState = EStateHandled; } if(iState == EProfileHttpAuthUsername) { if(iCustomProfileArray->At(iCounter)->IntValue(EDSProfileTransportId) == KUidNSmlMediumTypeBluetooth.iUid || !iCustomProfileArray->At(iCounter)->IntValue(EDSProfileHttpAuthUsed)) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileHttpAuthUsername, KEmpty) ; } else if (aBuf.Length() > KNSmlMaxHttpAuthUsernameLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileHttpAuthUsername, aBuf) ; } iState = EStateHandled; } if(iState == EProfileHttpAuthPassword) { if(iCustomProfileArray->At(iCounter)->IntValue(EDSProfileTransportId) == KUidNSmlMediumTypeBluetooth.iUid || !iCustomProfileArray->At(iCounter)->IntValue(EDSProfileHttpAuthUsed)) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileHttpAuthPassword, KEmpty) ; } else if(aBuf.Length() > KNSmlMaxHttpAuthPasswordLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileHttpAuthPassword, aBuf) ; } iState = EStateHandled; } if(iState == EProfileServerId) { if(aBuf.Length() > KNSmlMaxServerIdLength) { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileDisplayName, KEmpty) ; } else { iCustomProfileArray->At(iCounter)->SetStrValue( EDSProfileServerId, aBuf) ; } iState = EStateHandled; } if(iState == EProfileProtocolVersion) { iLex = aBuf; User::LeaveIfError(iLex.Val(aValue)); if(aValue != ESmlVersion1_1_2 && aValue != ESmlVersion1_2) { aValue = ESmlVersion1_2; } iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileProtocolVersion, aValue) ; iState = EStateHandled; } if(iState == ESyncType) { TInt syncType = SyncType (aBuf); iSyncTypeArray->AppendL(syncType); iState = EStateHandled; } if(iState == EDefaultProfile) { if(aBuf.Compare(_L("true")) == 0) { aValue = 1; } else { aValue = 0; } iCustomProfileArray->At(iCounter)->SetIntValue( EDSProfileDefaultProfile, aValue ); iState = EStateHandled; } } else if (iDSContentInProgress) { if(iState == EProfileDisplayName) { if(aBuf.Length() > KNSmlMaxProfileNameLength) { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSProfileName, KEmpty) ; iInvalidContent = ETrue; } else { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSProfileName ,aBuf); } iState = EStateHandled; } if(iState == EProfileServerId) { if(aBuf.Length() > KNSmlMaxServerIdLength || iInvalidContent) { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSProfileName, KEmpty) ; iContentArray->At(iContentCounter)->SetStrValue( EXMLDSServerId, KEmpty) ; } else { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSServerId ,aBuf); } iState = EStateHandled; } if(iState == EAdapterServerDataSource ) { if(aBuf.Length() > KDSMaxRemoteNameLength) { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSServerDataSource, KEmpty) ; } else { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSServerDataSource, aBuf); } iState = EStateHandled; } if(iState == EAdapterImplementationId ) { if(aBuf.Length() > KNSmlMaxAdapterIdLength) { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSAdapaterId, KEmpty) ; } else { iContentArray->At(iContentCounter)->SetStrValue( EXMLDSAdapaterId, aBuf); } iState = EStateHandled; } } return 1; }
USE_NAMESPACE SyncTypeArray::SyncTypeArray(){ syncTypeArray = new ArrayList(); SyncType TWO_WAY = SyncType(1); SyncType SLOW = SyncType(2); SyncType ONE_WAY_FROM_CLIENT = SyncType(3); SyncType REFRESH_FROM_CLIENT = SyncType(4); SyncType ONE_WAY_FROM_SERVER = SyncType(5); SyncType REFRESH_FROM_SERVER = SyncType(6); SyncType SERVER_ALERTED = SyncType(7); SyncType SMART_ONE_WAY_FROM_CLIENT = SyncType(50); SyncType SMART_ONE_WAY_FROM_SERVER = SyncType(51); SyncType INCREMENTAL_SMART_ONE_WAY_FROM_CLIENT = SyncType(52); SyncType INCREMENTAL_SMART_ONE_WAY_FROM_SERVER = SyncType(53); syncTypeArray->add(TWO_WAY); syncTypeArray->add(SLOW); syncTypeArray->add(ONE_WAY_FROM_CLIENT); syncTypeArray->add(REFRESH_FROM_CLIENT); syncTypeArray->add(ONE_WAY_FROM_SERVER); syncTypeArray->add(REFRESH_FROM_SERVER); syncTypeArray->add(SERVER_ALERTED); syncTypeArray->add(SMART_ONE_WAY_FROM_CLIENT); syncTypeArray->add(SMART_ONE_WAY_FROM_SERVER); syncTypeArray->add(INCREMENTAL_SMART_ONE_WAY_FROM_CLIENT); syncTypeArray->add(INCREMENTAL_SMART_ONE_WAY_FROM_SERVER); }