示例#1
0
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;	
	}
示例#3
0
EXPORT_C void CSTPreferences::SetDownloadPathL(TFileName& aDownloadPath)
{
	delete iDownloadPath;
	iDownloadPath = 0;
	iDownloadPath = aDownloadPath.AllocL();
	NotifyObserversL(ESettingDownloadPath);
}
示例#4
0
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);
}
示例#5
0
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);
	}
示例#7
0
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);
	}
示例#10
0
EXPORT_C void CSTPreferences::SetProxyConnectionPort(TInt aProxyConnectionPort) {
	iProxyConnectionPort = aProxyConnectionPort;
	NotifyObserversL(ESettingProxyConnectionPort);
}
示例#11
0
EXPORT_C void CSTPreferences::SetCloseConnectionAfterDownload(TBool aClose) {
	iCloseConnectionAfterDownload = aClose;
	NotifyObserversL(ESettingCloseConnectionAfterDownload);
}
示例#12
0
EXPORT_C void CSTPreferences::SetStartupHashCheck(TBool aHashCheck) {
	iStartupHashCheck = aHashCheck;
	NotifyObserversL(ESettingStartupHashCheck);
}
示例#13
0
EXPORT_C void CSTPreferences::SetRightSoftkeyMode(TSTSoftkeyMode aMode) {
	iRightSoftkeyMode = aMode;
	NotifyObserversL(ESettingRightSoftkeyMode);
}
示例#14
0
EXPORT_C void CSTPreferences::SetPieceSize(TInt aPieceSize) {
	iPieceSize = aPieceSize;
	NotifyObserversL(ESettingPieceSize);
}
示例#15
0
EXPORT_C void CSTPreferences::SetTrackerServicePort(TInt aTrackerServicePort) {
	iTrackerServicePort=aTrackerServicePort;
	NotifyObserversL(ESettingTrackerServicePort);
}
示例#16
0
EXPORT_C void CSTPreferences::SetIncomingPort(TInt aIncomingPort) {	
		iIncomingPort = aIncomingPort;
		NotifyObserversL(ESettingIncomingPort);
}
示例#17
0
EXPORT_C void CSTPreferences::SetIncomingConnectionsMode(CNetworkManager::TIncomingConnectionsMode aMode)
{
	iIncomingConnectionsMode = aMode;
	NotifyObserversL(ESettingIncomingConnectionsMode);
}
示例#18
0
EXPORT_C void CSTPreferences::SetDHTEnabled(TBool aDHTEnabled)
{
	iDHTEnabled = aDHTEnabled;
	NotifyObserversL(ESettingDHTEnabled);
}
示例#19
0
EXPORT_C void CSTPreferences::SetUploadEnabled(TBool aUploadEnabled)
{
	iIsUploadEnabled = aUploadEnabled;
	NotifyObserversL(ESettingUploadEnabled);
}
示例#20
0
EXPORT_C void CSTPreferences::SetSubpieceSize(TInt aSubpieceSize)
{
	iSubpieceSize = aSubpieceSize;
	NotifyObserversL(ESettingSubpieceSize);
}
示例#21
0
/**
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);	
	}