williamr@2: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2: // All rights reserved.
williamr@2: // This component and the accompanying materials are made available
williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2: // which accompanies this distribution, and is available
williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2: //
williamr@2: // Initial Contributors:
williamr@2: // Nokia Corporation - initial contribution.
williamr@2: //
williamr@2: // Contributors:
williamr@2: //
williamr@2: // Description:
williamr@2: //
williamr@2: 
williamr@2: #include <msvuids.h>
williamr@2: #include <smcmmain.h>
williamr@2: 
williamr@2: /** 
williamr@2: Gets the message header for a message context.
williamr@2: 
williamr@2: The current context must be set to a message entry with type KUidMsvMessageEntryValue.
williamr@2: If the current context is not set, or is set to an entry not of type
williamr@2: KUidMsvMessageEntryValuethen a panic will occur.
williamr@2: 
williamr@2: The message header object is the SMS MTM encapsulation of an SMS message. The
williamr@2: contents of the message header has been extracted from the current context.
williamr@2: 
williamr@2: @return
williamr@2: The (non-const) message header object.
williamr@2: 
williamr@2: @panic	SMCM	1
williamr@2: The current context has not been set (debug only).
williamr@2: 
williamr@2: @panic	SMCM	2
williamr@2: The current context was not of type KUidMsvMessageEntry (debug only).
williamr@2: 
williamr@2: @see	CSmsHeader
williamr@2: */
williamr@2: inline CSmsHeader& CSmsClientMtm::SmsHeader()
williamr@2: 	{
williamr@2: 	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
williamr@2: 	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
williamr@2: 	return *iSmsHeader;
williamr@2: 	}
williamr@2: 
williamr@2: /** 
williamr@2: Gets the (const) message header for a message context.
williamr@2: 
williamr@2: The current context must be set to a message entry with type KUidMsvMessageEntryValue.
williamr@2: If the current context is not set, or is set to an entry not of type
williamr@2: KUidMsvMessageEntryValuethen a panic will occur.
williamr@2: 
williamr@2: The message header object is the SMS MTM encapsulation of an SMS message. The
williamr@2: contents of the message header has been extracted from the current context.
williamr@2: 
williamr@2: @return
williamr@2: The (const) message header object.
williamr@2: 
williamr@2: @panic	SMCM	1
williamr@2: The current context has not been set (debug only).
williamr@2: 
williamr@2: @panic	SMCM	2
williamr@2: The current context was not of type KUidMsvMessageEntry (debug only).
williamr@2: 
williamr@2: @see	CSmsHeader
williamr@2: */
williamr@2: inline const CSmsHeader& CSmsClientMtm::SmsHeader() const
williamr@2: 	{
williamr@2: 	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
williamr@2: 	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
williamr@2: 	return *iSmsHeader;
williamr@2: 	}
williamr@2: 
williamr@2: /** 
williamr@2: Gets the current SMS service settings.
williamr@2: 
williamr@2: The current context must be set. If the current context is not set then a panic
williamr@2: will occur.
williamr@2: 
williamr@2: The SMS service settings must have been set or a panic will occur. The 
williamr@2: CSmsClientMtm::RestoreServiceAndSettingsL API can restore the SMS service 
williamr@2: settings. This also sets the SMS service ID.
williamr@2: 
williamr@2: @return
williamr@2: The current (non-const) SMS service settings.
williamr@2: 
williamr@2: @panic	SMCM	1
williamr@2: The current context has not been set (debug only).
williamr@2: 
williamr@2: @panic	SMCM	11
williamr@2: The SMS Service settings have not been set (debug only).
williamr@2: 
williamr@2: @see	CSmsClientMtm::RestoreServiceAndSettingsL
williamr@2: */
williamr@2: inline CSmsSettings& CSmsClientMtm::ServiceSettings()
williamr@2: 	{
williamr@2: 	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
williamr@2: 	__ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
williamr@2: 	return *iServiceSettings;
williamr@2: 	}
williamr@2: 
williamr@2: /**
williamr@2: Gets the current (const) SMS service settings.
williamr@2: 
williamr@2: The current context must be set. If the current context is not set then a panic
williamr@2: will occur.
williamr@2: 
williamr@2: The SMS service settings must have been set or a panic will occur. The 
williamr@2: CSmsClientMtm::RestoreServiceAndSettingsL API can restore the SMS service 
williamr@2: settings. This also sets the SMS service ID.
williamr@2: 
williamr@2: @return
williamr@2: The current (const) SMS service settings.
williamr@2: 
williamr@2: @panic	SMCM	1
williamr@2: The current context has not been set (debug only).
williamr@2: 
williamr@2: @panic	SMCM	11
williamr@2: The SMS Service settings have not been set (debug only).
williamr@2: 
williamr@2: @see	CSmsClientMtm::RestoreServiceAndSettingsL
williamr@2: */
williamr@2: inline const CSmsSettings& CSmsClientMtm::ServiceSettings() const
williamr@2: 	{	
williamr@2: 	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
williamr@2: 	__ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
williamr@2: 	return *iServiceSettings;
williamr@2: 	}
williamr@2: 
williamr@2: /**
williamr@2: Gets the ID of the current SMS service.
williamr@2: 
williamr@2: If there is no current SMS service, the ID will be a value of 0. The 
williamr@2: CSmsClientMtm::RestoreServiceAndSettingsL API can set the SMS service IS. This 
williamr@2: also restores the SMS service settings.
williamr@2: 
williamr@2: @return
williamr@2: The ID for the current SMS service
williamr@2: 
williamr@2: @see	CSmsClientMtm::RestoreServiceAndSettingsL
williamr@2: */
williamr@2: inline TInt CSmsClientMtm::ServiceId() const
williamr@2: 	{
williamr@2: 	return iServiceId;
williamr@2: 	}