williamr@2: // Copyright (c) 2004-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: #ifndef __RSENDAS_H__
williamr@2: #define __RSENDAS_H__
williamr@2: 
williamr@2: #include <e32base.h>
williamr@2: 
williamr@2: class CSendAsMessageTypes;
williamr@2: class CSendAsAccounts;
williamr@2: 
williamr@2: /**
williamr@2: The default number of message slots available to a session. This determines the
williamr@2: number of outstanding requests the client may have with the server at any one
williamr@2: time.
williamr@2: */
williamr@2: const TInt KSendAsDefaultMessageSlots = 4;
williamr@2: 
williamr@2: /**
williamr@2: Encapsulates a session with the SendAs Server.
williamr@2: 
williamr@2: This class allows a user to determine the message types available to the SendAs
williamr@2: server and also provides functionality for clients to filter this list to find 
williamr@2: the UIDs required to create messages.
williamr@2: 
williamr@2: @publishedAll
williamr@2: @released
williamr@2: */
williamr@2: class RSendAs : public RSessionBase
williamr@2: 	{
williamr@2: public:
williamr@2: 
williamr@2: /**
williamr@2: Defines the condition-checking of message capabilities. These are progressively
williamr@2: added to refine the list of available MTMs.
williamr@2: */
williamr@2: 	enum TSendAsConditionType
williamr@2: 		{
williamr@2: 		/**
williamr@2: 		No MTMs are removed as a result of applying this condition to the
williamr@2: 		filtering.
williamr@2: 		*/
williamr@2: 		ESendAsNoCondition,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities match the given value will remain as a
williamr@2: 		result of applying this condition to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsEquals,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities do not match the given value will remain 
williamr@2: 		as a result of applying this condition to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsNotEquals,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities greater than the given value will remain
williamr@2: 		as a result of applying this condition to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsGreaterThan,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities less than the given value will remain as a
williamr@2: 		result of applying this condition to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsLessThan,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities result non-zero value when bitwise ANDed
williamr@2: 		with the given value will remain as a result of applying this condition
williamr@2: 		to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsBitwiseAnd,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities result non-zero value when bitwise ORed
williamr@2: 		with the given value will remain as a result of applying this condition
williamr@2: 		to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsBitwiseOr,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities result non-zero value when bitwise NANDed
williamr@2: 		with the given value will remain as a result of applying this condition
williamr@2: 		to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsBitwiseNand,
williamr@2: 		/**
williamr@2: 		Only MTMs whose capabilities result non-zero value when bitwise NORed
williamr@2: 		with the given value will remain as a result of applying this condition
williamr@2: 		to the filtering.
williamr@2: 		*/
williamr@2: 		ESendAsBitwiseNor
williamr@2: 		};
williamr@2: 
williamr@2: public:
williamr@2: 	IMPORT_C TInt Connect();
williamr@2: 	IMPORT_C TInt Connect(TInt aMessageSlots);
williamr@2: 	
williamr@2: 	IMPORT_C void FilteredMessageTypesL(CSendAsMessageTypes& aMessageTypeInfo);
williamr@2: 	IMPORT_C TInt FilterAgainstCapability(TUid aMessageCapability);
williamr@2: 	IMPORT_C TInt FilterAgainstCapability(TUid aMessageCapability, TInt aValue, TSendAsConditionType aConditionType);
williamr@2: 	IMPORT_C TInt ResetMessageFilter();
williamr@2: 	
williamr@2: 	IMPORT_C void AvailableAccountsL(TUid aMessageType, CSendAsAccounts& aAccounts);
williamr@2: 
williamr@2: private:
williamr@2: 	TAny* iAny; // Future proofing.
williamr@2: 	};
williamr@2: 
williamr@2: #endif	//  __RSENDAS_H__