williamr@2: /* williamr@2: * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Can be used to show "Send" list query and to create and send williamr@2: * messages via available sending services. Created messages are williamr@2: * sent directly or message editor is opened for editing, williamr@2: * depending on the type of the selected service. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSENDUI_H williamr@2: #define CSENDUI_H williamr@2: williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CEikMenuPane; williamr@2: class CSendUiImpl; williamr@2: class CMessageData; williamr@2: class CSendingServiceInfo; williamr@2: williamr@2: #define KMaxStringLength 1024; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: williamr@2: /** williamr@2: * Offers "Send" pop-up list and message creation and sending services. williamr@2: * williamr@2: * Can be used to display "Send" list query and to create and send williamr@2: * messages via available services. Sending services can be based williamr@2: * on the MTM or ECom architecture. Created messages are sent williamr@2: * directly or message editor is opened for editing, depending on williamr@2: * the type of selected service. williamr@2: * williamr@2: * @lib SendUi.lib williamr@2: * @since Series 60 3.0 williamr@2: */ williamr@2: class CSendUi : public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: */ williamr@2: IMPORT_C static CSendUi* NewL(); williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: */ williamr@2: IMPORT_C static CSendUi* NewLC(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CSendUi(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Adds "Send" menu item to menupane. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMenuPane Menupane where the "Send" menu item should be added. williamr@2: * @param aIndex The place of the "Send" menu item in menupane. williamr@2: * @param aCommandId Command id for the "Send" menu item. williamr@2: * @param aRequiredCapabilities Capabilities required by services to be williamr@2: * shown in "Send" list query. If no capabilities are required williamr@2: * (KCapabilitiesForAllServices), all available services are williamr@2: * shown in "Send" list query. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void AddSendMenuItemL( williamr@2: CEikMenuPane& aMenuPane, williamr@2: TInt aIndex, williamr@2: TInt aCommandId, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); williamr@2: williamr@2: /** williamr@2: * First displays "Send" pop-up list query and then creates the message. williamr@2: * Editor is launched for editing the message or the message is sent williamr@2: * directly without opening the editor. Functionality depends on the williamr@2: * type of selected service. williamr@2: * williamr@2: * "Send" pop-up list query can be manipulated in three ways. All three williamr@2: * methods can be used or just some of those. williamr@2: * williamr@2: * The first option is to set the required capabilities for services. williamr@2: * Eg. attachments supported. Sending services not matching to required williamr@2: * capabilities are filtered away. Capabilities are defined in williamr@2: * TSendingCapabilities.h. williamr@2: * williamr@2: * The second option is content based filtering. Filtering is based on williamr@2: * the files intended to send. Those files can be set as part of message williamr@2: * data. Filtering is done according the predefined rules. williamr@2: * Eg. If oversized file is intended to send, MMS is filtered away from williamr@2: * "Send" pop-up list. williamr@2: * williamr@2: * The third option is to set the array of service uids not wanted to williamr@2: * be shown in list query. These sending services are filtered away williamr@2: * even if those match to required capabilities. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMessageData Data for the message. williamr@2: * @param aRequiredCapabilities Capabilities required by sending services williamr@2: * to be shown in "Send" pop-up list query. If no capabilities are williamr@2: * required (KCapabilitiesForAllServices), all available services williamr@2: * are shown in "Send" pop-up list query. williamr@2: * @param aServicesToDim Array of service uids (service uid, service williamr@2: * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" williamr@2: * list query. williamr@2: * See predefined sending service uids in SendUiConsts.h . williamr@2: * @param aBioTypeUid BIO message type uid. Deprecated. williamr@2: * @param aLaunchEditorEmbedded ETrue if the editor should be launched williamr@2: * embedded. Otherwise the editor is launched stand-alone. williamr@2: * Note: some services sends the messages without launching the williamr@2: * editor at all. williamr@2: * @param aTitleText Title of the "Send" pop-up list query. If no title williamr@2: * is defined, then the localised default title "Send:" is used. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void ShowQueryAndSendL( williamr@2: const CMessageData* aMessageData, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, williamr@2: CArrayFix* aServicesToDim = NULL, williamr@2: TUid aBioTypeUid = KNullUid, williamr@2: TBool aLaunchEditorEmbedded = ETrue, williamr@2: const TDesC& aTitleText = KNullDesC ); williamr@2: williamr@2: /** williamr@2: * Displays "Send" pop-up list query and returns the user selection. williamr@2: * williamr@2: * "Send" pop-up list query can be manipulated in three ways. All three williamr@2: * methods can be used or just some of those. williamr@2: * williamr@2: * The first option is to set the required capabilities for services. williamr@2: * Eg. attachments supported. Sending services not matching to required williamr@2: * capabilities are filtered away. Capabilities are defined in williamr@2: * TSendingCapabilities.h. williamr@2: * williamr@2: * The second option is content based filtering. Filtering is based on williamr@2: * the files intended to send. Those files can be set as part of message williamr@2: * data. Filtering is done according the predefined rules. williamr@2: * Eg. If oversized file is intended to send, MMS is filtered away from williamr@2: * "Send" pop-up list. williamr@2: * williamr@2: * The third option is to set the array of service uids not wanted to williamr@2: * be shown in list query. These sending services are filtered away williamr@2: * even if those match to required capabilities. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMessageData Data for the message. Attachments are used for williamr@2: * content based filtering. williamr@2: * @param aRequiredCapabilities Capabilities required by sending services williamr@2: * to be shown in "Send" pop-up list query. If no capabilities are williamr@2: * required (KCapabilitiesForAllServices), all available services williamr@2: * are shown in "Send" pop-up list query. williamr@2: * @param aServicesToDim Array of service uids (service uid, service williamr@2: * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" williamr@2: * list query. williamr@2: * See predefined sending service uids in SendUiConsts.h . williamr@2: * @param aTitleText Title of the "Send" pop-up list query. If no title williamr@2: * is defined, then the localised default title "Send:" is used. williamr@2: * @return Uid of the selected service (MTM or ECom). williamr@2: * KNullId is returned if user selects cancel. williamr@2: */ williamr@2: IMPORT_C TUid ShowSendQueryL( williamr@2: const CMessageData* aMessageData = NULL, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, williamr@2: CArrayFix* aServicesToDim = NULL, williamr@2: const TDesC& aTitleText = KNullDesC ); williamr@2: williamr@2: /** williamr@2: * Creates the message and launches the editor for editing the message williamr@2: * or sends the message directly without opening the editor. williamr@2: * Functionality depends on the type of selected service. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aServiceUid Uid of the sending service (MTM or ECom). williamr@2: * @param aMessageData Data for the message. williamr@2: * @param aBioTypeUid BIO message type uid. Deprecated. williamr@2: * @param aLaunchEditorEmbedded ETrue if the editor should be launched williamr@2: * embedded. Otherwise the editor is launched stand-alone. williamr@2: * Note: some sending services sends the messages without williamr@2: * launching the editor at all. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void CreateAndSendMessageL( williamr@2: TUid aServiceUid, williamr@2: const CMessageData* aMessageData, williamr@2: TUid aBioTypeUid = KNullUid, williamr@2: TBool aLaunchEditorEmbedded = ETrue ); williamr@2: williamr@2: /** williamr@2: * Validates that service is available and has required capabilities. williamr@2: * For ex. can be used when calling application creates its own "Send" williamr@2: * menu. williamr@2: * @since Series 60 3.0 williamr@2: * @param aServiceUid Uid of the sending service (MTM or ECom). williamr@2: * @param aRequiredCapabilities Capabilities required for the sending williamr@2: * service. williamr@2: * @return ETrue if service is available and it has required williamr@2: * capabilities,otherwise EFalse. williamr@2: */ williamr@2: IMPORT_C TBool ValidateServiceL( williamr@2: TUid aServiceUid, williamr@2: TSendingCapabilities aRequiredCapabilities ); williamr@2: williamr@2: /** williamr@2: * Returns sending capabilities of the sending service. williamr@2: * @since Series 60 3.0 williamr@2: * @param aServiceUid Uid of the sending service (MTM or ECom). williamr@2: * @param aServiceCapabilities TSendingCapabilities of the sending williamr@2: * service as a return value. williamr@2: * @return Return KErrNone if successful, or one of the system wide williamr@2: * errors if unsuccessful. williamr@2: */ williamr@2: IMPORT_C TInt ServiceCapabilitiesL( williamr@2: TUid aServiceUid, williamr@2: TSendingCapabilities& aServiceCapabilities ); williamr@2: williamr@2: /** williamr@2: * Can be used to check if sending of bio message is supported. Deprecated. williamr@2: * @since Series 60 3.0 williamr@2: * @param aBioMessageUid Uid of the bio message. williamr@2: * @return: Returns always EFalse williamr@2: */ williamr@2: IMPORT_C TBool CanSendBioMessage( TUid aBioMessageUid ) const; williamr@2: williamr@2: /** williamr@2: * Populates given list with the information about services williamr@2: * provided by specified ECom service provider. williamr@2: * Each service provider can provide 1..n services. williamr@2: * Ownership of the pointed objects are transfered to caller. williamr@2: * williamr@2: * Can be used for ex. when creating own "Send" menu, which needs to williamr@2: * include ECom based services. williamr@2: * williamr@2: * NOTE: Can be used only for ECom based services, also for MTMs williamr@2: * williamr@2: * @since Series 60 2.8 williamr@2: * @param aServiceList Service list to be populated. williamr@2: * @param aServiceProvider Id of the specified service provider. williamr@2: * KNullId means all service providers. williamr@2: * Service providers are defined in SendUiConsts.h williamr@2: * @return none williamr@2: */ williamr@2: IMPORT_C void AvailableServicesL( williamr@2: RPointerArray& aServiceList, williamr@2: TUid aServiceProvider = KNullUid); williamr@2: williamr@2: // Menu type enumeration williamr@2: enum TSendUiMenuType williamr@2: { williamr@2: ESendMenu, williamr@2: EWriteMenu williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Adds menu item of given type to menupane. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMenuType Type of the menu, "ESendMenu" or "EWriteMenu" williamr@2: * @param aMenuPane Menupane where the menu item should be added. williamr@2: * @param aIndex The place of the menu item in menupane. williamr@2: * @param aCommandId Command id for the menu item. williamr@2: * @param aRequiredCapabilities Capabilities required from services to be williamr@2: * shown in list query. If no capabilities are required williamr@2: * (KCapabilitiesForAllServices), all available services are williamr@2: * shown in list query. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void AddTypedMenuItemL( williamr@2: TSendUiMenuType aMenuType, williamr@2: CEikMenuPane& aMenuPane, williamr@2: TInt aIndex, williamr@2: TInt aCommandId, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); williamr@2: williamr@2: /** williamr@2: * Displays list query and creates message. williamr@2: * See ShowQueryAndSendL. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" williamr@2: * @param aMessageData Data for the message. williamr@2: * @param aRequiredCapabilities Capabilities required by sending services williamr@2: * to be shown in "Send" pop-up list query. If no capabilities are williamr@2: * required (KCapabilitiesForAllServices), all available services williamr@2: * are shown in "Send" pop-up list query. williamr@2: * @param aServicesToDim Array of service uids (service uid, service williamr@2: * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" williamr@2: * list query. williamr@2: * See predefined sending service uids in SendUiConsts.h . williamr@2: * @param aBioTypeUid BIO message type uid. Deprecated. williamr@2: * @param aLaunchEditorEmbedded ETrue if the editor should be launched williamr@2: * embedded. Otherwise the editor is launched stand-alone. williamr@2: * Note: some services sends the messages without launching the williamr@2: * editor at all. williamr@2: * @param aTitleText Title of the list query. If no title is defined, williamr@2: * then the localised default title is used, e.g. "Send" or williamr@2: * "Write". williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void ShowTypedQueryAndSendL( williamr@2: TSendUiMenuType aMenuType, williamr@2: const CMessageData* aMessageData, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, williamr@2: CArrayFix* aServicesToDim = NULL, williamr@2: TUid aBioTypeUid = KNullUid, williamr@2: TBool aLaunchEditorEmbedded = ETrue, williamr@2: const TDesC& aTitleText = KNullDesC ); williamr@2: williamr@2: /** williamr@2: * Displays list query and returns the user selection. williamr@2: * See ShowSendQueryL. williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu" williamr@2: * @param aMessageData Data for the message. Attachments are used for williamr@2: * content based filtering. williamr@2: * @param aRequiredCapabilities Capabilities required by sending services williamr@2: * to be shown in list query. If no capabilities are required williamr@2: * (KCapabilitiesForAllServices), all available services are williamr@2: * shown in list query. williamr@2: * @param aServicesToDim Array of service uids (service uid, service williamr@2: * provider's uid or service's TechnologyType) _NOT_ wanted to "Send" williamr@2: * list query. williamr@2: * See predefined sending service uids in SendUiConsts.h . williamr@2: * @param aTitleText Title of the list query. If no title is defined, williamr@2: * then the localised default title is used, e.g. "Send" or williamr@2: * "Write" williamr@2: * @return Uid of the selected service (MTM or ECom). williamr@2: * KNullId is returned if user selects cancel. williamr@2: */ williamr@2: IMPORT_C TUid ShowTypedQueryL( williamr@2: TSendUiMenuType aMenuType, williamr@2: const CMessageData* aMessageData = NULL, williamr@2: TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices, williamr@2: CArrayFix* aServicesToDim = NULL, williamr@2: const TDesC& aTitleText = KNullDesC ); williamr@2: williamr@2: /** williamr@2: * Returns the technology type of a service williamr@2: * williamr@2: * @since Series 60 3.0 williamr@2: * @param aServiceId Service of interest williamr@2: * @return Technology type of the provided service. NULL if Mtm williamr@2: * service doesn't exist or service is ECOM based. williamr@2: */ williamr@2: IMPORT_C TUid TechnologyType( TUid aServiceUid ) const; williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: CSendUi(); williamr@2: williamr@2: /** williamr@2: * By default Symbian 2nd phase constructor is private. williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: private: // Data williamr@2: // SendUi API implmentation. Owned. williamr@2: CSendUiImpl* iSendUiImpl; williamr@2: }; williamr@2: williamr@2: #endif // CSENDUI_H williamr@2: williamr@2: // End of File