epoc32/include/mw/sendui.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/sendui.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/sendui.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,385 @@
     1.4 -sendui.h
     1.5 +/*
     1.6 +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:   Can be used to show "Send" list query and to create and send
    1.19 +*                messages via available sending services. Created messages are
    1.20 +*                sent directly or message editor is opened for editing,
    1.21 +*                depending on the type of the selected service.
    1.22 +*
    1.23 +*/
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +#ifndef CSENDUI_H
    1.29 +#define CSENDUI_H
    1.30 +
    1.31 +#include <TSendingCapabilities.h>
    1.32 +
    1.33 +// FORWARD DECLARATIONS
    1.34 +class CEikMenuPane;
    1.35 +class CSendUiImpl;
    1.36 +class CMessageData;
    1.37 +class CSendingServiceInfo;
    1.38 +
    1.39 +#define KMaxStringLength 1024;
    1.40 +
    1.41 +// CLASS DECLARATION
    1.42 +
    1.43 +
    1.44 +/**
    1.45 +*  Offers "Send" pop-up list and message creation and sending services.
    1.46 +*  
    1.47 +*  Can be used to display "Send" list query and to create and send
    1.48 +*  messages via available services. Sending services can be based
    1.49 +*  on the MTM or ECom architecture. Created messages are sent
    1.50 +*  directly or message editor is opened for editing, depending on
    1.51 +*  the type of selected service.
    1.52 +*
    1.53 +*  @lib SendUi.lib
    1.54 +*  @since Series 60 3.0
    1.55 +*/
    1.56 +class CSendUi : public CBase
    1.57 +    {
    1.58 +    public:  // Constructors and destructor
    1.59 +        
    1.60 +        /**
    1.61 +        * Two-phased constructor.
    1.62 +        */
    1.63 +        IMPORT_C static CSendUi* NewL();
    1.64 +
    1.65 +        /**
    1.66 +        * Two-phased constructor.
    1.67 +        */
    1.68 +        IMPORT_C static CSendUi* NewLC();
    1.69 +
    1.70 +        /**
    1.71 +        * Destructor.
    1.72 +        */
    1.73 +        IMPORT_C virtual ~CSendUi();
    1.74 +
    1.75 +    public: // New functions
    1.76 +
    1.77 +        /**
    1.78 +        * Adds "Send" menu item to menupane.
    1.79 +        *
    1.80 +        * @since Series 60 3.0
    1.81 +        * @param aMenuPane Menupane where the "Send" menu item should be added.
    1.82 +        * @param aIndex The place of the "Send" menu item in menupane.
    1.83 +        * @param aCommandId Command id for the "Send" menu item.
    1.84 +        * @param aRequiredCapabilities Capabilities required by services to be
    1.85 +        *        shown in "Send" list query. If no capabilities are required
    1.86 +        *        (KCapabilitiesForAllServices), all available services are
    1.87 +        *        shown in "Send" list query.
    1.88 +        * @return None.
    1.89 +        */
    1.90 +        IMPORT_C void AddSendMenuItemL(
    1.91 +            CEikMenuPane& aMenuPane,
    1.92 +            TInt aIndex,
    1.93 +            TInt aCommandId,
    1.94 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
    1.95 +
    1.96 +        /**
    1.97 +        * First displays "Send" pop-up list query and then creates the message.
    1.98 +        * Editor is launched for editing the message or the message is sent
    1.99 +        * directly without opening the editor. Functionality depends on the
   1.100 +        * type of selected service.
   1.101 +        *
   1.102 +        * "Send" pop-up list query can be manipulated in three ways. All three
   1.103 +        *  methods can be used or just some of those.
   1.104 +        *
   1.105 +        * The first option is to set the required capabilities for services.
   1.106 +        * Eg. attachments supported. Sending services not matching to required
   1.107 +        * capabilities are filtered away. Capabilities are defined in
   1.108 +        * TSendingCapabilities.h.
   1.109 +        *
   1.110 +        * The second option is content based filtering. Filtering is based on
   1.111 +        * the files intended to send. Those files can be set as part of message
   1.112 +        * data. Filtering is done according the predefined rules.
   1.113 +        * Eg. If oversized file is intended to send, MMS is filtered away from
   1.114 +        * "Send" pop-up list.
   1.115 +        *
   1.116 +        * The third option is to set the array of service uids not wanted to
   1.117 +        * be shown in list query. These sending services are filtered away
   1.118 +        * even if those match to required capabilities.
   1.119 +        *
   1.120 +        * @since Series 60 3.0
   1.121 +        * @param aMessageData Data for the message.
   1.122 +        * @param aRequiredCapabilities Capabilities required by sending services
   1.123 +        *        to be shown in "Send" pop-up list query. If no capabilities are
   1.124 +        *        required (KCapabilitiesForAllServices), all available services
   1.125 +        *        are shown in "Send" pop-up list query.
   1.126 +        * @param aServicesToDim Array of service uids (service uid, service 
   1.127 +        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
   1.128 +        *        list query. 
   1.129 +        *        See predefined sending service uids in SendUiConsts.h .
   1.130 +        * @param aBioTypeUid BIO message type uid. Deprecated.
   1.131 +        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
   1.132 +        *        embedded. Otherwise the editor is launched stand-alone.
   1.133 +        *        Note: some services sends the messages without launching the
   1.134 +        *        editor at all.
   1.135 +        * @param aTitleText Title of the "Send" pop-up list query. If no title
   1.136 +        *        is defined, then the localised default title "Send:" is used.
   1.137 +        * @return None.
   1.138 +        */
   1.139 +        IMPORT_C void ShowQueryAndSendL(
   1.140 +            const CMessageData* aMessageData,
   1.141 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
   1.142 +            CArrayFix<TUid>* aServicesToDim = NULL,
   1.143 +            TUid aBioTypeUid = KNullUid,
   1.144 +            TBool aLaunchEditorEmbedded = ETrue,
   1.145 +            const TDesC& aTitleText = KNullDesC );
   1.146 +
   1.147 +        /**
   1.148 +        * Displays "Send" pop-up list query and returns the user selection.
   1.149 +        *
   1.150 +        * "Send" pop-up list query can be manipulated in three ways. All three
   1.151 +        *  methods can be used or just some of those.
   1.152 +        *
   1.153 +        * The first option is to set the required capabilities for services.
   1.154 +        * Eg. attachments supported. Sending services not matching to required
   1.155 +        * capabilities are filtered away. Capabilities are defined in
   1.156 +        * TSendingCapabilities.h.
   1.157 +        *
   1.158 +        * The second option is content based filtering. Filtering is based on
   1.159 +        * the files intended to send. Those files can be set as part of message
   1.160 +        * data. Filtering is done according the predefined rules.
   1.161 +        * Eg. If oversized file is intended to send, MMS is filtered away from
   1.162 +        * "Send" pop-up list.
   1.163 +        *
   1.164 +        * The third option is to set the array of service uids not wanted to
   1.165 +        * be shown in list query. These sending services are filtered away
   1.166 +        * even if those match to required capabilities.
   1.167 +        * 
   1.168 +        * @since Series 60 3.0
   1.169 +        * @param aMessageData Data for the message. Attachments are used for
   1.170 +        *        content based filtering.
   1.171 +        * @param aRequiredCapabilities Capabilities required by sending services
   1.172 +        *        to be shown in "Send" pop-up list query. If no capabilities are
   1.173 +        *        required (KCapabilitiesForAllServices), all available services
   1.174 +        *        are shown in "Send" pop-up list query.
   1.175 +        * @param aServicesToDim Array of service uids (service uid, service 
   1.176 +        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
   1.177 +        *        list query. 
   1.178 +        *        See predefined sending service uids in SendUiConsts.h .
   1.179 +        * @param aTitleText Title of the "Send" pop-up list query. If no title
   1.180 +        *        is defined, then the localised default title "Send:" is used.        
   1.181 +        * @return Uid of the selected service (MTM or ECom). 
   1.182 +        *        KNullId is returned if user selects cancel.
   1.183 +        */
   1.184 +        IMPORT_C TUid ShowSendQueryL(
   1.185 +            const CMessageData* aMessageData = NULL,
   1.186 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
   1.187 +            CArrayFix<TUid>* aServicesToDim = NULL,
   1.188 +            const TDesC& aTitleText = KNullDesC );
   1.189 +
   1.190 +        /**
   1.191 +        * Creates the message and launches the editor for editing the message
   1.192 +        * or sends the message directly without opening the editor. 
   1.193 +        * Functionality depends on the type of selected service.
   1.194 +        *
   1.195 +        * @since Series 60 3.0
   1.196 +        * @param aServiceUid Uid of the sending service (MTM or ECom).
   1.197 +        * @param aMessageData Data for the message.
   1.198 +        * @param aBioTypeUid BIO message type uid. Deprecated.
   1.199 +        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
   1.200 +        *        embedded. Otherwise the editor is launched stand-alone.
   1.201 +        *        Note: some sending services sends the messages without
   1.202 +        *        launching the editor at all.
   1.203 +        * @return None.
   1.204 +        */
   1.205 +        IMPORT_C void CreateAndSendMessageL(
   1.206 +            TUid aServiceUid,
   1.207 +            const CMessageData* aMessageData,
   1.208 +            TUid aBioTypeUid = KNullUid,
   1.209 +            TBool aLaunchEditorEmbedded = ETrue );
   1.210 +
   1.211 +        /**
   1.212 +        * Validates that service is available and has required capabilities.
   1.213 +        * For ex. can be used when calling application creates its own "Send"
   1.214 +        * menu.
   1.215 +        * @since Series 60 3.0
   1.216 +        * @param aServiceUid Uid of the sending service (MTM or ECom).
   1.217 +        * @param aRequiredCapabilities Capabilities required for the sending
   1.218 +        *        service. 
   1.219 +        * @return ETrue if service is available and it has required 
   1.220 +        *         capabilities,otherwise EFalse.
   1.221 +        */
   1.222 +        IMPORT_C TBool ValidateServiceL(
   1.223 +            TUid aServiceUid,
   1.224 +            TSendingCapabilities aRequiredCapabilities );
   1.225 +
   1.226 +        /**
   1.227 +        * Returns sending capabilities of the sending service.
   1.228 +        * @since Series 60 3.0
   1.229 +        * @param aServiceUid Uid of the sending service (MTM or ECom).
   1.230 +        * @param aServiceCapabilities TSendingCapabilities of the sending
   1.231 +        *        service as a return value.        
   1.232 +        * @return Return KErrNone if successful, or one of the system wide
   1.233 +        *         errors if unsuccessful.
   1.234 +        */
   1.235 +        IMPORT_C TInt ServiceCapabilitiesL(
   1.236 +            TUid aServiceUid,
   1.237 +            TSendingCapabilities& aServiceCapabilities );       
   1.238 +       
   1.239 +        /**
   1.240 +        * Can be used to check if sending of bio message is supported. Deprecated.
   1.241 +        * @since Series 60 3.0
   1.242 +        * @param aBioMessageUid Uid of the bio message.
   1.243 +        * @return: Returns always EFalse
   1.244 +        */
   1.245 +        IMPORT_C TBool CanSendBioMessage( TUid aBioMessageUid ) const;
   1.246 +
   1.247 +        /**
   1.248 +        * Populates given list with the information about services
   1.249 +        * provided by specified ECom service provider.
   1.250 +        * Each service provider can provide 1..n services.
   1.251 +        * Ownership of the pointed objects are transfered to caller.
   1.252 +        *
   1.253 +        * Can be used for ex. when creating own "Send" menu, which needs to
   1.254 +        * include ECom based services.
   1.255 +        *
   1.256 +        * NOTE: Can be used only for ECom based services, also for MTMs
   1.257 +        *
   1.258 +        * @since Series 60 2.8
   1.259 +        * @param aServiceList Service list to be populated.
   1.260 +        * @param aServiceProvider Id of the specified service provider.
   1.261 +        *        KNullId means all service providers.
   1.262 +        *        Service providers are defined in SendUiConsts.h
   1.263 +        * @return none
   1.264 +        */
   1.265 +        IMPORT_C void AvailableServicesL(
   1.266 +            RPointerArray<CSendingServiceInfo>& aServiceList,
   1.267 +            TUid aServiceProvider = KNullUid);
   1.268 +
   1.269 +        // Menu type enumeration
   1.270 +        enum TSendUiMenuType
   1.271 +            {
   1.272 +            ESendMenu,
   1.273 +            EWriteMenu
   1.274 +            };
   1.275 +
   1.276 +        /**
   1.277 +        * Adds menu item of given type to menupane.
   1.278 +        *
   1.279 +        * @since Series 60 3.0
   1.280 +        * @param aMenuType Type of the menu, "ESendMenu" or "EWriteMenu"
   1.281 +        * @param aMenuPane Menupane where the menu item should be added.
   1.282 +        * @param aIndex The place of the menu item in menupane.
   1.283 +        * @param aCommandId Command id for the menu item.
   1.284 +        * @param aRequiredCapabilities Capabilities required from services to be
   1.285 +        *        shown in list query. If no capabilities are required
   1.286 +        *        (KCapabilitiesForAllServices), all available services are
   1.287 +        *        shown in list query.
   1.288 +        * @return None.
   1.289 +        */
   1.290 +        IMPORT_C void AddTypedMenuItemL(
   1.291 +            TSendUiMenuType aMenuType, 
   1.292 +            CEikMenuPane& aMenuPane,
   1.293 +            TInt aIndex,
   1.294 +            TInt aCommandId,
   1.295 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
   1.296 +
   1.297 +        /**
   1.298 +        * Displays list query and creates message.
   1.299 +        * See ShowQueryAndSendL.
   1.300 +        *
   1.301 +        * @since Series 60 3.0
   1.302 +        * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu"
   1.303 +        * @param aMessageData Data for the message.
   1.304 +        * @param aRequiredCapabilities Capabilities required by sending services
   1.305 +        *        to be shown in "Send" pop-up list query. If no capabilities are
   1.306 +        *        required (KCapabilitiesForAllServices), all available services
   1.307 +        *        are shown in "Send" pop-up list query.
   1.308 +        * @param aServicesToDim Array of service uids (service uid, service 
   1.309 +        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
   1.310 +        *        list query. 
   1.311 +        *        See predefined sending service uids in SendUiConsts.h .
   1.312 +        * @param aBioTypeUid BIO message type uid. Deprecated.
   1.313 +        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
   1.314 +        *        embedded. Otherwise the editor is launched stand-alone.
   1.315 +        *        Note: some services sends the messages without launching the
   1.316 +        *        editor at all.
   1.317 +        * @param aTitleText Title of the list query. If no title is defined,
   1.318 +        *        then the localised default title is used, e.g. "Send" or 
   1.319 +        *        "Write".
   1.320 +        * @return None.
   1.321 +        */
   1.322 +        IMPORT_C void ShowTypedQueryAndSendL(
   1.323 +            TSendUiMenuType aMenuType, 
   1.324 +            const CMessageData* aMessageData,
   1.325 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
   1.326 +            CArrayFix<TUid>* aServicesToDim = NULL,
   1.327 +            TUid aBioTypeUid = KNullUid,
   1.328 +            TBool aLaunchEditorEmbedded = ETrue,
   1.329 +            const TDesC& aTitleText = KNullDesC );
   1.330 +
   1.331 +        /**
   1.332 +        * Displays list query and returns the user selection.
   1.333 +        * See ShowSendQueryL.
   1.334 +        * 
   1.335 +        * @since Series 60 3.0
   1.336 +        * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu"
   1.337 +        * @param aMessageData Data for the message. Attachments are used for
   1.338 +        *        content based filtering.
   1.339 +        * @param aRequiredCapabilities Capabilities required by sending services
   1.340 +        *        to be shown in list query. If no capabilities are required
   1.341 +        *        (KCapabilitiesForAllServices), all available services are 
   1.342 +        *        shown in list query.
   1.343 +        * @param aServicesToDim Array of service uids (service uid, service 
   1.344 +        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
   1.345 +        *        list query. 
   1.346 +        *        See predefined sending service uids in SendUiConsts.h .
   1.347 +        * @param aTitleText Title of the list query. If no title is defined,
   1.348 +        *        then the localised default title is used, e.g. "Send" or 
   1.349 +        *        "Write"
   1.350 +        * @return Uid of the selected service (MTM or ECom). 
   1.351 +        *        KNullId is returned if user selects cancel.
   1.352 +        */
   1.353 +        IMPORT_C TUid ShowTypedQueryL(
   1.354 +            TSendUiMenuType aMenuType, 
   1.355 +            const CMessageData* aMessageData = NULL,
   1.356 +            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
   1.357 +            CArrayFix<TUid>* aServicesToDim = NULL,
   1.358 +            const TDesC& aTitleText = KNullDesC );
   1.359 +
   1.360 +        /**
   1.361 +        *   Returns the technology type of a service
   1.362 +        *
   1.363 +        *   @since Series 60 3.0
   1.364 +        *   @param aServiceId Service of interest
   1.365 +        *   @return Technology type of the provided service. NULL if Mtm
   1.366 +        *           service doesn't exist or service is ECOM based.
   1.367 +        */
   1.368 +        IMPORT_C TUid TechnologyType( TUid aServiceUid ) const;
   1.369 +
   1.370 +    private:
   1.371 +
   1.372 +        /**
   1.373 +        * C++ default constructor.
   1.374 +        */
   1.375 +        CSendUi();
   1.376 +
   1.377 +        /**
   1.378 +        * By default Symbian 2nd phase constructor is private.
   1.379 +        */
   1.380 +        void ConstructL();
   1.381 +
   1.382 +    private:    // Data
   1.383 +        // SendUi API implmentation. Owned.
   1.384 +        CSendUiImpl*                        iSendUiImpl;
   1.385 +    };
   1.386 +
   1.387 +#endif      // CSENDUI_H
   1.388 +
   1.389 +// End of File