EXPORT_C void CSTPreferences::SetAccessPointL(const TDesC& aAccessPointName, TUint32 aAccessPointId) { delete iAccessPointName; iAccessPointName = 0; iAccessPointName = aAccessPointName.AllocL(); iAccessPointId = aAccessPointId; NotifyObserversL(ESettingAccesPointId); NotifyObserversL(ESettingAccesPointName); }
/** Set the phone number and Contact ID for the specified speed dial table index. */ TContactItemId CCntDbManager::SetSpeedDialIdForPositionL(const TInt aSpeedDialIndex, const TContactItemId aContactId, const TSpeedDialPhoneNumber& aPhoneNumber, TUint aConnectionId, TBool aSendNotification) { // Get the speed dial table CCntServerSpeedDialTable& table = iIniManager.SpeedDialManager().TableL(iCntFile); // Grab data from the speed dial table TContactItemId contactIdToBroadcast; if ( aContactId == KNullContactId ) { TSpeedDialPhoneNumber phoneNumberFromSpeedDialTable; contactIdToBroadcast = table.SpeedDialContactItem(aSpeedDialIndex, phoneNumberFromSpeedDialTable); } else { contactIdToBroadcast = aContactId; } // Update speed dial array table.SetSpeedDialL(aSpeedDialIndex, aContactId, aPhoneNumber); // Save the changes to the contacts model ini file iIniManager.ScheduleSaveIniFileSettings(CIniFileManager::ESaveSpeedDials); if (aSendNotification) { //BroadCast the SpeedDialsChanged event TContactDbObserverEventV2 event; event.iType = EContactDbObserverEventSpeedDialsChanged; event.iContactId = contactIdToBroadcast; event.iConnectionId = aConnectionId; event.iTypeV2 = EContactDbObserverEventV2Null; event.iAdditionalContactId = 0; NotifyObserversL(event); } return contactIdToBroadcast; }
EXPORT_C void CSTPreferences::SetDownloadPathL(TFileName& aDownloadPath) { delete iDownloadPath; iDownloadPath = 0; iDownloadPath = aDownloadPath.AllocL(); NotifyObserversL(ESettingDownloadPath); }
EXPORT_C void CSTPreferences::AddSTorrentL(const TDesC& aSTorrentPath) { TInt dummy = 0; if (iSTorrents->Find(aSTorrentPath, dummy) == 0) // the storrent is alreasy in the list return; iSTorrents->AppendL(aSTorrentPath); NotifyObserversL(ESettingSTorrent); }
EXPORT_C void CSTPreferences::RemoveSTorrentL(const TDesC& aSTorrentPath) { TInt pos = 0; if (iSTorrents->Find(aSTorrentPath, pos) != 0) // the storrent is not found return; iSTorrents->Delete(pos); NotifyObserversL(ESettingSTorrent); }
void CCntDbManager::RemoveCurrentItemL(TUint aConnectionId) { iIniManager.RemoveCurrentItemL(iCntFile); TContactDbObserverEventV2 event; event.iType = EContactDbObserverEventCurrentItemDeleted; event.iContactId = KNullContactId; event.iConnectionId = aConnectionId; event.iTypeV2 = EContactDbObserverEventV2Null; event.iAdditionalContactId = 0; // Save the changes to the contacts model ini file iIniManager.ScheduleSaveIniFileSettings(CIniFileManager::ESaveCurrentItem); NotifyObserversL(event); }
EXPORT_C TInt CSTPreferences::SetProxyAddressL(const TDesC& aHostName) { TInt res = iProxyAddress.Input(aHostName); if (res == KErrNone) { delete iProxyHostName; iProxyHostName = NULL; iProxyHostName = aHostName.AllocL(); NotifyObserversL(ESettingProxyHostName); } return res; }
void CCntDbManager::SetCardTemplatePrefIdL(TContactItemId aCardTemplatePrefId, TInt aConnectionId) { // This is effectively a Write operation which should not be allowed in low // disk condition. if (LowDiskManagerL().LowDiskL()) { User::Leave(KErrDiskFull); } iPersistenceLayer->ContactProperties().SetCardTemplatePrefIdL(aCardTemplatePrefId); //Notify clients here TContactDbObserverEventV2 event; event.iType = EContactDbObserverEventPreferredTemplateChanged; event.iContactId = aCardTemplatePrefId; event.iConnectionId = aConnectionId; event.iTypeV2 = EContactDbObserverEventV2Null; event.iAdditionalContactId = 0; NotifyObserversL(event); }
/** Process a Backup/Restore event (typically generated by the Database Manager Controller via the Backup/Restore Agent). @param aEvent Database event (limited to Backup/Restore database events). */ void CCntDbManager::HandleBackupRestoreEventL(TContactDbObserverEventV2 aEvent) { // Create and then process appropriate request using state machine. CCntRequest* request = NULL; switch(aEvent.iType) { case EContactDbObserverEventBackupBeginning : case EContactDbObserverEventRestoreBeginning : { request = CReqBackupRestoreBegin::NewLC(); } break; case EContactDbObserverEventBackupRestoreCompleted : // Bad database recovery is automatically carried out in the // Persistence Layer as part of the opening process. case EContactDbObserverEventRestoreBadDatabase : { request = CReqBackupRestoreEnd::NewLC(); } break; default : { // Misuse of API (unexpected event). User::Leave(KErrArgument); } } StateMachineL().ProcessRequestL(request); // ownership transferred // ProcessRequestL received ownership of the request, the request only need // to be popped from CleanupStack. CleanupStack::Pop(request); // Notify all registered observers of Backup/Restore event. NotifyObserversL(aEvent); }
EXPORT_C void CSTPreferences::SetProxyConnectionPort(TInt aProxyConnectionPort) { iProxyConnectionPort = aProxyConnectionPort; NotifyObserversL(ESettingProxyConnectionPort); }
EXPORT_C void CSTPreferences::SetCloseConnectionAfterDownload(TBool aClose) { iCloseConnectionAfterDownload = aClose; NotifyObserversL(ESettingCloseConnectionAfterDownload); }
EXPORT_C void CSTPreferences::SetStartupHashCheck(TBool aHashCheck) { iStartupHashCheck = aHashCheck; NotifyObserversL(ESettingStartupHashCheck); }
EXPORT_C void CSTPreferences::SetRightSoftkeyMode(TSTSoftkeyMode aMode) { iRightSoftkeyMode = aMode; NotifyObserversL(ESettingRightSoftkeyMode); }
EXPORT_C void CSTPreferences::SetPieceSize(TInt aPieceSize) { iPieceSize = aPieceSize; NotifyObserversL(ESettingPieceSize); }
EXPORT_C void CSTPreferences::SetTrackerServicePort(TInt aTrackerServicePort) { iTrackerServicePort=aTrackerServicePort; NotifyObserversL(ESettingTrackerServicePort); }
EXPORT_C void CSTPreferences::SetIncomingPort(TInt aIncomingPort) { iIncomingPort = aIncomingPort; NotifyObserversL(ESettingIncomingPort); }
EXPORT_C void CSTPreferences::SetIncomingConnectionsMode(CNetworkManager::TIncomingConnectionsMode aMode) { iIncomingConnectionsMode = aMode; NotifyObserversL(ESettingIncomingConnectionsMode); }
EXPORT_C void CSTPreferences::SetDHTEnabled(TBool aDHTEnabled) { iDHTEnabled = aDHTEnabled; NotifyObserversL(ESettingDHTEnabled); }
EXPORT_C void CSTPreferences::SetUploadEnabled(TBool aUploadEnabled) { iIsUploadEnabled = aUploadEnabled; NotifyObserversL(ESettingUploadEnabled); }
EXPORT_C void CSTPreferences::SetSubpieceSize(TInt aSubpieceSize) { iSubpieceSize = aSubpieceSize; NotifyObserversL(ESettingSubpieceSize); }
/** Process a database event (typically generated in the Persistence Layer). @param aEvent Database event. */ void CCntDbManager::HandleDatabaseEventV2L(TContactDbObserverEventV2 aEvent) { // Notify all registered observers of the event. NotifyObserversL(aEvent); }