epoc32/include/mw/sendui.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:   Can be used to show "Send" list query and to create and send
williamr@2
    15
*                messages via available sending services. Created messages are
williamr@2
    16
*                sent directly or message editor is opened for editing,
williamr@2
    17
*                depending on the type of the selected service.
williamr@2
    18
*
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
#ifndef CSENDUI_H
williamr@2
    25
#define CSENDUI_H
williamr@2
    26
williamr@2
    27
#include <TSendingCapabilities.h>
williamr@2
    28
williamr@2
    29
// FORWARD DECLARATIONS
williamr@2
    30
class CEikMenuPane;
williamr@2
    31
class CSendUiImpl;
williamr@2
    32
class CMessageData;
williamr@2
    33
class CSendingServiceInfo;
williamr@2
    34
williamr@2
    35
#define KMaxStringLength 1024;
williamr@2
    36
williamr@2
    37
// CLASS DECLARATION
williamr@2
    38
williamr@2
    39
williamr@2
    40
/**
williamr@2
    41
*  Offers "Send" pop-up list and message creation and sending services.
williamr@2
    42
*  
williamr@2
    43
*  Can be used to display "Send" list query and to create and send
williamr@2
    44
*  messages via available services. Sending services can be based
williamr@2
    45
*  on the MTM or ECom architecture. Created messages are sent
williamr@2
    46
*  directly or message editor is opened for editing, depending on
williamr@2
    47
*  the type of selected service.
williamr@2
    48
*
williamr@2
    49
*  @lib SendUi.lib
williamr@2
    50
*  @since Series 60 3.0
williamr@2
    51
*/
williamr@2
    52
class CSendUi : public CBase
williamr@2
    53
    {
williamr@2
    54
    public:  // Constructors and destructor
williamr@2
    55
        
williamr@2
    56
        /**
williamr@2
    57
        * Two-phased constructor.
williamr@2
    58
        */
williamr@2
    59
        IMPORT_C static CSendUi* NewL();
williamr@2
    60
williamr@2
    61
        /**
williamr@2
    62
        * Two-phased constructor.
williamr@2
    63
        */
williamr@2
    64
        IMPORT_C static CSendUi* NewLC();
williamr@2
    65
williamr@2
    66
        /**
williamr@2
    67
        * Destructor.
williamr@2
    68
        */
williamr@2
    69
        IMPORT_C virtual ~CSendUi();
williamr@2
    70
williamr@2
    71
    public: // New functions
williamr@2
    72
williamr@2
    73
        /**
williamr@2
    74
        * Adds "Send" menu item to menupane.
williamr@2
    75
        *
williamr@2
    76
        * @since Series 60 3.0
williamr@2
    77
        * @param aMenuPane Menupane where the "Send" menu item should be added.
williamr@2
    78
        * @param aIndex The place of the "Send" menu item in menupane.
williamr@2
    79
        * @param aCommandId Command id for the "Send" menu item.
williamr@2
    80
        * @param aRequiredCapabilities Capabilities required by services to be
williamr@2
    81
        *        shown in "Send" list query. If no capabilities are required
williamr@2
    82
        *        (KCapabilitiesForAllServices), all available services are
williamr@2
    83
        *        shown in "Send" list query.
williamr@2
    84
        * @return None.
williamr@2
    85
        */
williamr@2
    86
        IMPORT_C void AddSendMenuItemL(
williamr@2
    87
            CEikMenuPane& aMenuPane,
williamr@2
    88
            TInt aIndex,
williamr@2
    89
            TInt aCommandId,
williamr@2
    90
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
williamr@2
    91
williamr@2
    92
        /**
williamr@2
    93
        * First displays "Send" pop-up list query and then creates the message.
williamr@2
    94
        * Editor is launched for editing the message or the message is sent
williamr@2
    95
        * directly without opening the editor. Functionality depends on the
williamr@2
    96
        * type of selected service.
williamr@2
    97
        *
williamr@2
    98
        * "Send" pop-up list query can be manipulated in three ways. All three
williamr@2
    99
        *  methods can be used or just some of those.
williamr@2
   100
        *
williamr@2
   101
        * The first option is to set the required capabilities for services.
williamr@2
   102
        * Eg. attachments supported. Sending services not matching to required
williamr@2
   103
        * capabilities are filtered away. Capabilities are defined in
williamr@2
   104
        * TSendingCapabilities.h.
williamr@2
   105
        *
williamr@2
   106
        * The second option is content based filtering. Filtering is based on
williamr@2
   107
        * the files intended to send. Those files can be set as part of message
williamr@2
   108
        * data. Filtering is done according the predefined rules.
williamr@2
   109
        * Eg. If oversized file is intended to send, MMS is filtered away from
williamr@2
   110
        * "Send" pop-up list.
williamr@2
   111
        *
williamr@2
   112
        * The third option is to set the array of service uids not wanted to
williamr@2
   113
        * be shown in list query. These sending services are filtered away
williamr@2
   114
        * even if those match to required capabilities.
williamr@2
   115
        *
williamr@2
   116
        * @since Series 60 3.0
williamr@2
   117
        * @param aMessageData Data for the message.
williamr@2
   118
        * @param aRequiredCapabilities Capabilities required by sending services
williamr@2
   119
        *        to be shown in "Send" pop-up list query. If no capabilities are
williamr@2
   120
        *        required (KCapabilitiesForAllServices), all available services
williamr@2
   121
        *        are shown in "Send" pop-up list query.
williamr@2
   122
        * @param aServicesToDim Array of service uids (service uid, service 
williamr@2
   123
        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
williamr@2
   124
        *        list query. 
williamr@2
   125
        *        See predefined sending service uids in SendUiConsts.h .
williamr@2
   126
        * @param aBioTypeUid BIO message type uid. Deprecated.
williamr@2
   127
        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
williamr@2
   128
        *        embedded. Otherwise the editor is launched stand-alone.
williamr@2
   129
        *        Note: some services sends the messages without launching the
williamr@2
   130
        *        editor at all.
williamr@2
   131
        * @param aTitleText Title of the "Send" pop-up list query. If no title
williamr@2
   132
        *        is defined, then the localised default title "Send:" is used.
williamr@2
   133
        * @return None.
williamr@2
   134
        */
williamr@2
   135
        IMPORT_C void ShowQueryAndSendL(
williamr@2
   136
            const CMessageData* aMessageData,
williamr@2
   137
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
williamr@2
   138
            CArrayFix<TUid>* aServicesToDim = NULL,
williamr@2
   139
            TUid aBioTypeUid = KNullUid,
williamr@2
   140
            TBool aLaunchEditorEmbedded = ETrue,
williamr@2
   141
            const TDesC& aTitleText = KNullDesC );
williamr@2
   142
williamr@2
   143
        /**
williamr@2
   144
        * Displays "Send" pop-up list query and returns the user selection.
williamr@2
   145
        *
williamr@2
   146
        * "Send" pop-up list query can be manipulated in three ways. All three
williamr@2
   147
        *  methods can be used or just some of those.
williamr@2
   148
        *
williamr@2
   149
        * The first option is to set the required capabilities for services.
williamr@2
   150
        * Eg. attachments supported. Sending services not matching to required
williamr@2
   151
        * capabilities are filtered away. Capabilities are defined in
williamr@2
   152
        * TSendingCapabilities.h.
williamr@2
   153
        *
williamr@2
   154
        * The second option is content based filtering. Filtering is based on
williamr@2
   155
        * the files intended to send. Those files can be set as part of message
williamr@2
   156
        * data. Filtering is done according the predefined rules.
williamr@2
   157
        * Eg. If oversized file is intended to send, MMS is filtered away from
williamr@2
   158
        * "Send" pop-up list.
williamr@2
   159
        *
williamr@2
   160
        * The third option is to set the array of service uids not wanted to
williamr@2
   161
        * be shown in list query. These sending services are filtered away
williamr@2
   162
        * even if those match to required capabilities.
williamr@2
   163
        * 
williamr@2
   164
        * @since Series 60 3.0
williamr@2
   165
        * @param aMessageData Data for the message. Attachments are used for
williamr@2
   166
        *        content based filtering.
williamr@2
   167
        * @param aRequiredCapabilities Capabilities required by sending services
williamr@2
   168
        *        to be shown in "Send" pop-up list query. If no capabilities are
williamr@2
   169
        *        required (KCapabilitiesForAllServices), all available services
williamr@2
   170
        *        are shown in "Send" pop-up list query.
williamr@2
   171
        * @param aServicesToDim Array of service uids (service uid, service 
williamr@2
   172
        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
williamr@2
   173
        *        list query. 
williamr@2
   174
        *        See predefined sending service uids in SendUiConsts.h .
williamr@2
   175
        * @param aTitleText Title of the "Send" pop-up list query. If no title
williamr@2
   176
        *        is defined, then the localised default title "Send:" is used.        
williamr@2
   177
        * @return Uid of the selected service (MTM or ECom). 
williamr@2
   178
        *        KNullId is returned if user selects cancel.
williamr@2
   179
        */
williamr@2
   180
        IMPORT_C TUid ShowSendQueryL(
williamr@2
   181
            const CMessageData* aMessageData = NULL,
williamr@2
   182
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
williamr@2
   183
            CArrayFix<TUid>* aServicesToDim = NULL,
williamr@2
   184
            const TDesC& aTitleText = KNullDesC );
williamr@2
   185
williamr@2
   186
        /**
williamr@2
   187
        * Creates the message and launches the editor for editing the message
williamr@2
   188
        * or sends the message directly without opening the editor. 
williamr@2
   189
        * Functionality depends on the type of selected service.
williamr@2
   190
        *
williamr@2
   191
        * @since Series 60 3.0
williamr@2
   192
        * @param aServiceUid Uid of the sending service (MTM or ECom).
williamr@2
   193
        * @param aMessageData Data for the message.
williamr@2
   194
        * @param aBioTypeUid BIO message type uid. Deprecated.
williamr@2
   195
        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
williamr@2
   196
        *        embedded. Otherwise the editor is launched stand-alone.
williamr@2
   197
        *        Note: some sending services sends the messages without
williamr@2
   198
        *        launching the editor at all.
williamr@2
   199
        * @return None.
williamr@2
   200
        */
williamr@2
   201
        IMPORT_C void CreateAndSendMessageL(
williamr@2
   202
            TUid aServiceUid,
williamr@2
   203
            const CMessageData* aMessageData,
williamr@2
   204
            TUid aBioTypeUid = KNullUid,
williamr@2
   205
            TBool aLaunchEditorEmbedded = ETrue );
williamr@2
   206
williamr@2
   207
        /**
williamr@2
   208
        * Validates that service is available and has required capabilities.
williamr@2
   209
        * For ex. can be used when calling application creates its own "Send"
williamr@2
   210
        * menu.
williamr@2
   211
        * @since Series 60 3.0
williamr@2
   212
        * @param aServiceUid Uid of the sending service (MTM or ECom).
williamr@2
   213
        * @param aRequiredCapabilities Capabilities required for the sending
williamr@2
   214
        *        service. 
williamr@2
   215
        * @return ETrue if service is available and it has required 
williamr@2
   216
        *         capabilities,otherwise EFalse.
williamr@2
   217
        */
williamr@2
   218
        IMPORT_C TBool ValidateServiceL(
williamr@2
   219
            TUid aServiceUid,
williamr@2
   220
            TSendingCapabilities aRequiredCapabilities );
williamr@2
   221
williamr@2
   222
        /**
williamr@2
   223
        * Returns sending capabilities of the sending service.
williamr@2
   224
        * @since Series 60 3.0
williamr@2
   225
        * @param aServiceUid Uid of the sending service (MTM or ECom).
williamr@2
   226
        * @param aServiceCapabilities TSendingCapabilities of the sending
williamr@2
   227
        *        service as a return value.        
williamr@2
   228
        * @return Return KErrNone if successful, or one of the system wide
williamr@2
   229
        *         errors if unsuccessful.
williamr@2
   230
        */
williamr@2
   231
        IMPORT_C TInt ServiceCapabilitiesL(
williamr@2
   232
            TUid aServiceUid,
williamr@2
   233
            TSendingCapabilities& aServiceCapabilities );       
williamr@2
   234
       
williamr@2
   235
        /**
williamr@2
   236
        * Can be used to check if sending of bio message is supported. Deprecated.
williamr@2
   237
        * @since Series 60 3.0
williamr@2
   238
        * @param aBioMessageUid Uid of the bio message.
williamr@2
   239
        * @return: Returns always EFalse
williamr@2
   240
        */
williamr@2
   241
        IMPORT_C TBool CanSendBioMessage( TUid aBioMessageUid ) const;
williamr@2
   242
williamr@2
   243
        /**
williamr@2
   244
        * Populates given list with the information about services
williamr@2
   245
        * provided by specified ECom service provider.
williamr@2
   246
        * Each service provider can provide 1..n services.
williamr@2
   247
        * Ownership of the pointed objects are transfered to caller.
williamr@2
   248
        *
williamr@2
   249
        * Can be used for ex. when creating own "Send" menu, which needs to
williamr@2
   250
        * include ECom based services.
williamr@2
   251
        *
williamr@2
   252
        * NOTE: Can be used only for ECom based services, also for MTMs
williamr@2
   253
        *
williamr@2
   254
        * @since Series 60 2.8
williamr@2
   255
        * @param aServiceList Service list to be populated.
williamr@2
   256
        * @param aServiceProvider Id of the specified service provider.
williamr@2
   257
        *        KNullId means all service providers.
williamr@2
   258
        *        Service providers are defined in SendUiConsts.h
williamr@2
   259
        * @return none
williamr@2
   260
        */
williamr@2
   261
        IMPORT_C void AvailableServicesL(
williamr@2
   262
            RPointerArray<CSendingServiceInfo>& aServiceList,
williamr@2
   263
            TUid aServiceProvider = KNullUid);
williamr@2
   264
williamr@2
   265
        // Menu type enumeration
williamr@2
   266
        enum TSendUiMenuType
williamr@2
   267
            {
williamr@2
   268
            ESendMenu,
williamr@2
   269
            EWriteMenu
williamr@2
   270
            };
williamr@2
   271
williamr@2
   272
        /**
williamr@2
   273
        * Adds menu item of given type to menupane.
williamr@2
   274
        *
williamr@2
   275
        * @since Series 60 3.0
williamr@2
   276
        * @param aMenuType Type of the menu, "ESendMenu" or "EWriteMenu"
williamr@2
   277
        * @param aMenuPane Menupane where the menu item should be added.
williamr@2
   278
        * @param aIndex The place of the menu item in menupane.
williamr@2
   279
        * @param aCommandId Command id for the menu item.
williamr@2
   280
        * @param aRequiredCapabilities Capabilities required from services to be
williamr@2
   281
        *        shown in list query. If no capabilities are required
williamr@2
   282
        *        (KCapabilitiesForAllServices), all available services are
williamr@2
   283
        *        shown in list query.
williamr@2
   284
        * @return None.
williamr@2
   285
        */
williamr@2
   286
        IMPORT_C void AddTypedMenuItemL(
williamr@2
   287
            TSendUiMenuType aMenuType, 
williamr@2
   288
            CEikMenuPane& aMenuPane,
williamr@2
   289
            TInt aIndex,
williamr@2
   290
            TInt aCommandId,
williamr@2
   291
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices );
williamr@2
   292
williamr@2
   293
        /**
williamr@2
   294
        * Displays list query and creates message.
williamr@2
   295
        * See ShowQueryAndSendL.
williamr@2
   296
        *
williamr@2
   297
        * @since Series 60 3.0
williamr@2
   298
        * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu"
williamr@2
   299
        * @param aMessageData Data for the message.
williamr@2
   300
        * @param aRequiredCapabilities Capabilities required by sending services
williamr@2
   301
        *        to be shown in "Send" pop-up list query. If no capabilities are
williamr@2
   302
        *        required (KCapabilitiesForAllServices), all available services
williamr@2
   303
        *        are shown in "Send" pop-up list query.
williamr@2
   304
        * @param aServicesToDim Array of service uids (service uid, service 
williamr@2
   305
        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
williamr@2
   306
        *        list query. 
williamr@2
   307
        *        See predefined sending service uids in SendUiConsts.h .
williamr@2
   308
        * @param aBioTypeUid BIO message type uid. Deprecated.
williamr@2
   309
        * @param aLaunchEditorEmbedded ETrue if the editor should be launched
williamr@2
   310
        *        embedded. Otherwise the editor is launched stand-alone.
williamr@2
   311
        *        Note: some services sends the messages without launching the
williamr@2
   312
        *        editor at all.
williamr@2
   313
        * @param aTitleText Title of the list query. If no title is defined,
williamr@2
   314
        *        then the localised default title is used, e.g. "Send" or 
williamr@2
   315
        *        "Write".
williamr@2
   316
        * @return None.
williamr@2
   317
        */
williamr@2
   318
        IMPORT_C void ShowTypedQueryAndSendL(
williamr@2
   319
            TSendUiMenuType aMenuType, 
williamr@2
   320
            const CMessageData* aMessageData,
williamr@2
   321
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
williamr@2
   322
            CArrayFix<TUid>* aServicesToDim = NULL,
williamr@2
   323
            TUid aBioTypeUid = KNullUid,
williamr@2
   324
            TBool aLaunchEditorEmbedded = ETrue,
williamr@2
   325
            const TDesC& aTitleText = KNullDesC );
williamr@2
   326
williamr@2
   327
        /**
williamr@2
   328
        * Displays list query and returns the user selection.
williamr@2
   329
        * See ShowSendQueryL.
williamr@2
   330
        * 
williamr@2
   331
        * @since Series 60 3.0
williamr@2
   332
        * @param aMenuType Type of the menu, e.g. "ESendMenu" or "EWriteMenu"
williamr@2
   333
        * @param aMessageData Data for the message. Attachments are used for
williamr@2
   334
        *        content based filtering.
williamr@2
   335
        * @param aRequiredCapabilities Capabilities required by sending services
williamr@2
   336
        *        to be shown in list query. If no capabilities are required
williamr@2
   337
        *        (KCapabilitiesForAllServices), all available services are 
williamr@2
   338
        *        shown in list query.
williamr@2
   339
        * @param aServicesToDim Array of service uids (service uid, service 
williamr@2
   340
        *        provider's uid or service's TechnologyType) _NOT_ wanted to "Send" 
williamr@2
   341
        *        list query. 
williamr@2
   342
        *        See predefined sending service uids in SendUiConsts.h .
williamr@2
   343
        * @param aTitleText Title of the list query. If no title is defined,
williamr@2
   344
        *        then the localised default title is used, e.g. "Send" or 
williamr@2
   345
        *        "Write"
williamr@2
   346
        * @return Uid of the selected service (MTM or ECom). 
williamr@2
   347
        *        KNullId is returned if user selects cancel.
williamr@2
   348
        */
williamr@2
   349
        IMPORT_C TUid ShowTypedQueryL(
williamr@2
   350
            TSendUiMenuType aMenuType, 
williamr@2
   351
            const CMessageData* aMessageData = NULL,
williamr@2
   352
            TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices,
williamr@2
   353
            CArrayFix<TUid>* aServicesToDim = NULL,
williamr@2
   354
            const TDesC& aTitleText = KNullDesC );
williamr@2
   355
williamr@2
   356
        /**
williamr@2
   357
        *   Returns the technology type of a service
williamr@2
   358
        *
williamr@2
   359
        *   @since Series 60 3.0
williamr@2
   360
        *   @param aServiceId Service of interest
williamr@2
   361
        *   @return Technology type of the provided service. NULL if Mtm
williamr@2
   362
        *           service doesn't exist or service is ECOM based.
williamr@2
   363
        */
williamr@2
   364
        IMPORT_C TUid TechnologyType( TUid aServiceUid ) const;
williamr@2
   365
williamr@2
   366
    private:
williamr@2
   367
williamr@2
   368
        /**
williamr@2
   369
        * C++ default constructor.
williamr@2
   370
        */
williamr@2
   371
        CSendUi();
williamr@2
   372
williamr@2
   373
        /**
williamr@2
   374
        * By default Symbian 2nd phase constructor is private.
williamr@2
   375
        */
williamr@2
   376
        void ConstructL();
williamr@2
   377
williamr@2
   378
    private:    // Data
williamr@2
   379
        // SendUi API implmentation. Owned.
williamr@2
   380
        CSendUiImpl*                        iSendUiImpl;
williamr@2
   381
    };
williamr@2
   382
williamr@2
   383
#endif      // CSENDUI_H
williamr@2
   384
williamr@2
   385
// End of File