messagingfw/senduiservices/src/SendUi.cpp
author hgs
Wed, 03 Nov 2010 22:41:46 +0530
changeset 62 db3f5fa34ec7
parent 60 9f5ae1728557
child 59 d1d846af7341
permissions -rw-r--r--
201044_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:   Can be used to show "Send" list query and to create and send
hgs
parents:
diff changeset
    15
*                messages via available sending services. Created messages are
hgs
parents:
diff changeset
    16
*                sent directly or message editor is opened for editing,
hgs
parents:
diff changeset
    17
*                depending on the type of the selected service.
hgs
parents:
diff changeset
    18
*
hgs
parents:
diff changeset
    19
*/
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
// INCLUDE FILES
hgs
parents:
diff changeset
    25
#include <sendui.h>
hgs
parents:
diff changeset
    26
#include "SendUiImpl.h"
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
// ============================ MEMBER FUNCTIONS ===============================
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    32
// CSendUi::CSendUi
hgs
parents:
diff changeset
    33
// C++ default constructor can NOT contain any code, that
hgs
parents:
diff changeset
    34
// might leave.
hgs
parents:
diff changeset
    35
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    36
//
hgs
parents:
diff changeset
    37
CSendUi::CSendUi()
hgs
parents:
diff changeset
    38
    {
hgs
parents:
diff changeset
    39
    }
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    42
// CSendUi::ConstructL
hgs
parents:
diff changeset
    43
// Symbian 2nd phase constructor can leave.
hgs
parents:
diff changeset
    44
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    45
//
hgs
parents:
diff changeset
    46
void CSendUi::ConstructL()
hgs
parents:
diff changeset
    47
    {
hgs
parents:
diff changeset
    48
    iSendUiImpl = CSendUiImpl::NewL();
hgs
parents:
diff changeset
    49
    }
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    52
// CSendUi::NewL
hgs
parents:
diff changeset
    53
// Two-phased constructor.
hgs
parents:
diff changeset
    54
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    55
//
hgs
parents:
diff changeset
    56
EXPORT_C CSendUi* CSendUi::NewL()
hgs
parents:
diff changeset
    57
    {
hgs
parents:
diff changeset
    58
    CSendUi* self = CSendUi::NewLC();
hgs
parents:
diff changeset
    59
    
hgs
parents:
diff changeset
    60
    CleanupStack::Pop( self );
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
    return self;
hgs
parents:
diff changeset
    63
    }
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
// ---------------------------------------------------------
hgs
parents:
diff changeset
    66
// CSendUi::NewLC
hgs
parents:
diff changeset
    67
// Two-phased constructor.
hgs
parents:
diff changeset
    68
// ---------------------------------------------------------
hgs
parents:
diff changeset
    69
//
hgs
parents:
diff changeset
    70
EXPORT_C CSendUi* CSendUi::NewLC()
hgs
parents:
diff changeset
    71
    {
hgs
parents:
diff changeset
    72
    CSendUi* self = new (ELeave) CSendUi;
hgs
parents:
diff changeset
    73
hgs
parents:
diff changeset
    74
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    75
    self->ConstructL();
hgs
parents:
diff changeset
    76
hgs
parents:
diff changeset
    77
    return self;
hgs
parents:
diff changeset
    78
    }
hgs
parents:
diff changeset
    79
   
hgs
parents:
diff changeset
    80
// Destructor
hgs
parents:
diff changeset
    81
EXPORT_C CSendUi::~CSendUi()
hgs
parents:
diff changeset
    82
    {
hgs
parents:
diff changeset
    83
    delete iSendUiImpl;
hgs
parents:
diff changeset
    84
    }
hgs
parents:
diff changeset
    85
hgs
parents:
diff changeset
    86
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    87
// CSendUi::AddSendMenuItemL
hgs
parents:
diff changeset
    88
//
hgs
parents:
diff changeset
    89
// (other items were commented in a header).
hgs
parents:
diff changeset
    90
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    91
//
hgs
parents:
diff changeset
    92
EXPORT_C void CSendUi::AddSendMenuItemL(
hgs
parents:
diff changeset
    93
    CEikMenuPane&               aMenuPane,
hgs
parents:
diff changeset
    94
    TInt                        aIndex,
hgs
parents:
diff changeset
    95
    TInt                        aCommandId,
hgs
parents:
diff changeset
    96
    TSendingCapabilities        aRequiredCapabilities )
hgs
parents:
diff changeset
    97
    {
hgs
parents:
diff changeset
    98
    iSendUiImpl->AddTypedMenuItemL(
hgs
parents:
diff changeset
    99
        ESendMenu,
hgs
parents:
diff changeset
   100
        aMenuPane,
hgs
parents:
diff changeset
   101
        aIndex,
hgs
parents:
diff changeset
   102
        aCommandId,
hgs
parents:
diff changeset
   103
        aRequiredCapabilities);
hgs
parents:
diff changeset
   104
    }
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   107
// CSendUi::ShowQueryAndSendL
hgs
parents:
diff changeset
   108
// First shows "Send" pop-up list query and then creates the message.
hgs
parents:
diff changeset
   109
// Editor is launched for editing the message or the message is sent
hgs
parents:
diff changeset
   110
// directly without opening the editor. Functionality depends on the
hgs
parents:
diff changeset
   111
// type of selected sending service.
hgs
parents:
diff changeset
   112
// (other items were commented in a header).
hgs
parents:
diff changeset
   113
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   114
//
hgs
parents:
diff changeset
   115
EXPORT_C void CSendUi::ShowQueryAndSendL(
hgs
parents:
diff changeset
   116
    const CMessageData*     aMessageData,
hgs
parents:
diff changeset
   117
    TSendingCapabilities    aRequiredCapabilities,
hgs
parents:
diff changeset
   118
    CArrayFix<TUid>*        aServicesToDim,
hgs
parents:
diff changeset
   119
    TUid                    /*aBioTypeUid*/,
hgs
parents:
diff changeset
   120
    TBool                   aLaunchEditorEmbedded,
hgs
parents:
diff changeset
   121
    const TDesC&            aTitleText )
hgs
parents:
diff changeset
   122
    {
hgs
parents:
diff changeset
   123
    iSendUiImpl->ShowTypedQueryAndSendL(
hgs
parents:
diff changeset
   124
        ESendMenu,
hgs
parents:
diff changeset
   125
        aMessageData,
hgs
parents:
diff changeset
   126
        aRequiredCapabilities,
hgs
parents:
diff changeset
   127
        aServicesToDim,
hgs
parents:
diff changeset
   128
        aLaunchEditorEmbedded,
hgs
parents:
diff changeset
   129
        aTitleText );
hgs
parents:
diff changeset
   130
    }
hgs
parents:
diff changeset
   131
hgs
parents:
diff changeset
   132
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   133
// CSendUi::ShowSendQueryL
hgs
parents:
diff changeset
   134
// Shows "Send" pop-up list query and returns the user selection.
hgs
parents:
diff changeset
   135
// (other items were commented in a header).
hgs
parents:
diff changeset
   136
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   137
//
hgs
parents:
diff changeset
   138
EXPORT_C TUid CSendUi::ShowSendQueryL(
hgs
parents:
diff changeset
   139
    const CMessageData*     aMessageData,
hgs
parents:
diff changeset
   140
    TSendingCapabilities    aRequiredCapabilities,
hgs
parents:
diff changeset
   141
    CArrayFix<TUid>*        aServicesToDim,
hgs
parents:
diff changeset
   142
    const TDesC&            aTitleText )
hgs
parents:
diff changeset
   143
    {
hgs
parents:
diff changeset
   144
    return iSendUiImpl->ShowTypedQueryL(
hgs
parents:
diff changeset
   145
        ESendMenu,
hgs
parents:
diff changeset
   146
        aMessageData,
hgs
parents:
diff changeset
   147
        aRequiredCapabilities,
hgs
parents:
diff changeset
   148
        aServicesToDim,
hgs
parents:
diff changeset
   149
        aTitleText );
hgs
parents:
diff changeset
   150
    }
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   153
// CSendUi::CreateAndSendMessageL
hgs
parents:
diff changeset
   154
// Creates the message and launches the editor for editing the message
hgs
parents:
diff changeset
   155
// or sends the message directly without opening the editor. 
hgs
parents:
diff changeset
   156
// Functionality depends on the type of selected sending service.
hgs
parents:
diff changeset
   157
// (other items were commented in a header).
hgs
parents:
diff changeset
   158
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   159
//
hgs
parents:
diff changeset
   160
EXPORT_C void CSendUi::CreateAndSendMessageL(
hgs
parents:
diff changeset
   161
    TUid                    aServiceUid,
hgs
parents:
diff changeset
   162
    const CMessageData*     aMessageData,
hgs
parents:
diff changeset
   163
    TUid                    /*aBioTypeUid*/,
hgs
parents:
diff changeset
   164
    TBool                   aLaunchEditorEmbedded )
hgs
parents:
diff changeset
   165
    {
hgs
parents:
diff changeset
   166
    iSendUiImpl->CreateAndSendMessageL(
hgs
parents:
diff changeset
   167
        aServiceUid,
hgs
parents:
diff changeset
   168
        aMessageData,
hgs
parents:
diff changeset
   169
        aLaunchEditorEmbedded );
hgs
parents:
diff changeset
   170
    }
hgs
parents:
diff changeset
   171
hgs
parents:
diff changeset
   172
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   173
// CSendUi::ValidateServiceL
hgs
parents:
diff changeset
   174
// Validates that service is available and has required capabilities.
hgs
parents:
diff changeset
   175
// (other items were commented in a header).
hgs
parents:
diff changeset
   176
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   177
//
hgs
parents:
diff changeset
   178
EXPORT_C TBool CSendUi::ValidateServiceL(
hgs
parents:
diff changeset
   179
    TUid                    aServiceUid,
hgs
parents:
diff changeset
   180
    TSendingCapabilities    aRequiredCapabilities )
hgs
parents:
diff changeset
   181
    {
hgs
parents:
diff changeset
   182
    return iSendUiImpl->QueryCapabilities(
hgs
parents:
diff changeset
   183
        iSendUiImpl->ResolveServiceIndex( aServiceUid ), 
hgs
parents:
diff changeset
   184
        aRequiredCapabilities );
hgs
parents:
diff changeset
   185
    }
hgs
parents:
diff changeset
   186
hgs
parents:
diff changeset
   187
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   188
// CSendUi::ServiceCapabilitiesL
hgs
parents:
diff changeset
   189
// Returns sending capabilities of the sending service.
hgs
parents:
diff changeset
   190
// (other items were commented in a header).
hgs
parents:
diff changeset
   191
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   192
//
hgs
parents:
diff changeset
   193
EXPORT_C TInt CSendUi::ServiceCapabilitiesL(
hgs
parents:
diff changeset
   194
    TUid                    aServiceUid,
hgs
parents:
diff changeset
   195
    TSendingCapabilities&   aServiceCapabilities )
hgs
parents:
diff changeset
   196
    {
hgs
parents:
diff changeset
   197
    return iSendUiImpl->ServiceCapabilities(
hgs
parents:
diff changeset
   198
        aServiceUid, aServiceCapabilities );
hgs
parents:
diff changeset
   199
    }
hgs
parents:
diff changeset
   200
hgs
parents:
diff changeset
   201
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   202
// CSendUi::CanSendBioMessage
hgs
parents:
diff changeset
   203
// Can be used to check if sending of bio message is supported.
hgs
parents:
diff changeset
   204
// (other items were commented in a header).
hgs
parents:
diff changeset
   205
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   206
//
hgs
parents:
diff changeset
   207
EXPORT_C TBool CSendUi::CanSendBioMessage( TUid /*aBioMessageUid*/ ) const
hgs
parents:
diff changeset
   208
    {
hgs
parents:
diff changeset
   209
    return EFalse;
hgs
parents:
diff changeset
   210
    }
hgs
parents:
diff changeset
   211
hgs
parents:
diff changeset
   212
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   213
// CSendUi::AvailableServicesL
hgs
parents:
diff changeset
   214
// Populates given list with the information about services
hgs
parents:
diff changeset
   215
// provided by specified ECom service provider.
hgs
parents:
diff changeset
   216
// (other items were commented in a header).
hgs
parents:
diff changeset
   217
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   218
//
hgs
parents:
diff changeset
   219
EXPORT_C void CSendUi::AvailableServicesL(
hgs
parents:
diff changeset
   220
    RPointerArray<CSendingServiceInfo>& aServiceList,
hgs
parents:
diff changeset
   221
    TUid aServiceProvider)
hgs
parents:
diff changeset
   222
    {
hgs
parents:
diff changeset
   223
    iSendUiImpl->AvailableServicesL( aServiceList, aServiceProvider );
hgs
parents:
diff changeset
   224
    }
hgs
parents:
diff changeset
   225
hgs
parents:
diff changeset
   226
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   227
// CSendUi::AddTypedMenuItemL
hgs
parents:
diff changeset
   228
//
hgs
parents:
diff changeset
   229
// (other items were commented in a header).
hgs
parents:
diff changeset
   230
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   231
//
hgs
parents:
diff changeset
   232
EXPORT_C void CSendUi::AddTypedMenuItemL(
hgs
parents:
diff changeset
   233
    TSendUiMenuType             aMenuType,
hgs
parents:
diff changeset
   234
    CEikMenuPane&               aMenuPane,
hgs
parents:
diff changeset
   235
    TInt                        aIndex,
hgs
parents:
diff changeset
   236
    TInt                        aCommandId,
hgs
parents:
diff changeset
   237
    TSendingCapabilities        aRequiredCapabilities )
hgs
parents:
diff changeset
   238
    {
hgs
parents:
diff changeset
   239
    iSendUiImpl->AddTypedMenuItemL(
hgs
parents:
diff changeset
   240
        aMenuType,
hgs
parents:
diff changeset
   241
        aMenuPane,
hgs
parents:
diff changeset
   242
        aIndex,
hgs
parents:
diff changeset
   243
        aCommandId,
hgs
parents:
diff changeset
   244
        aRequiredCapabilities);
hgs
parents:
diff changeset
   245
    }
hgs
parents:
diff changeset
   246
hgs
parents:
diff changeset
   247
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   248
// CSendUi::ShowTypedQueryAndSendL
hgs
parents:
diff changeset
   249
// First shows list query and then creates the message.
hgs
parents:
diff changeset
   250
// Editor is launched for editing the message or the message is sent
hgs
parents:
diff changeset
   251
// directly without opening the editor. Functionality depends on the
hgs
parents:
diff changeset
   252
// type of selected sending service.
hgs
parents:
diff changeset
   253
// (other items were commented in a header).
hgs
parents:
diff changeset
   254
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   255
//
hgs
parents:
diff changeset
   256
EXPORT_C void CSendUi::ShowTypedQueryAndSendL(
hgs
parents:
diff changeset
   257
    TSendUiMenuType         aMenuType,
hgs
parents:
diff changeset
   258
    const CMessageData*     aMessageData,
hgs
parents:
diff changeset
   259
    TSendingCapabilities    aRequiredCapabilities,
hgs
parents:
diff changeset
   260
    CArrayFix<TUid>*        aServicesToDim,
hgs
parents:
diff changeset
   261
    TUid                    /*aBioTypeUid*/,
hgs
parents:
diff changeset
   262
    TBool                   aLaunchEditorEmbedded,
hgs
parents:
diff changeset
   263
    const TDesC&            aTitleText )
hgs
parents:
diff changeset
   264
    {
hgs
parents:
diff changeset
   265
    iSendUiImpl->ShowTypedQueryAndSendL(
hgs
parents:
diff changeset
   266
        aMenuType,
hgs
parents:
diff changeset
   267
        aMessageData,
hgs
parents:
diff changeset
   268
        aRequiredCapabilities,
hgs
parents:
diff changeset
   269
        aServicesToDim,
hgs
parents:
diff changeset
   270
        aLaunchEditorEmbedded,
hgs
parents:
diff changeset
   271
        aTitleText );
hgs
parents:
diff changeset
   272
    }
hgs
parents:
diff changeset
   273
hgs
parents:
diff changeset
   274
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   275
// CSendUi::ShowTypedQueryL
hgs
parents:
diff changeset
   276
// Shows list query and returns the user selection.
hgs
parents:
diff changeset
   277
// (other items were commented in a header).
hgs
parents:
diff changeset
   278
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   279
//
hgs
parents:
diff changeset
   280
EXPORT_C TUid CSendUi::ShowTypedQueryL(
hgs
parents:
diff changeset
   281
    TSendUiMenuType         aMenuType,
hgs
parents:
diff changeset
   282
    const CMessageData*     aMessageData,
hgs
parents:
diff changeset
   283
    TSendingCapabilities    aRequiredCapabilities,
hgs
parents:
diff changeset
   284
    CArrayFix<TUid>*        aServicesToDim,
hgs
parents:
diff changeset
   285
    const TDesC&            aTitleText )
hgs
parents:
diff changeset
   286
    {
hgs
parents:
diff changeset
   287
    return iSendUiImpl->ShowTypedQueryL(
hgs
parents:
diff changeset
   288
        aMenuType,
hgs
parents:
diff changeset
   289
        aMessageData,
hgs
parents:
diff changeset
   290
        aRequiredCapabilities,
hgs
parents:
diff changeset
   291
        aServicesToDim,
hgs
parents:
diff changeset
   292
        aTitleText );
hgs
parents:
diff changeset
   293
    }
hgs
parents:
diff changeset
   294
hgs
parents:
diff changeset
   295
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   296
// CSendUi::TechnologyType
hgs
parents:
diff changeset
   297
// 
hgs
parents:
diff changeset
   298
// (other items were commented in a header).
hgs
parents:
diff changeset
   299
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   300
//
hgs
parents:
diff changeset
   301
EXPORT_C TUid CSendUi::TechnologyType( TUid aServiceUid ) const
hgs
parents:
diff changeset
   302
    {
hgs
parents:
diff changeset
   303
    return iSendUiImpl->TechnologyType( aServiceUid );
hgs
parents:
diff changeset
   304
    }
hgs
parents:
diff changeset
   305
hgs
parents:
diff changeset
   306
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   307
// CSendUi::AddSendMenuItemToMenuPaneL
hgs
parents:
diff changeset
   308
//
hgs
parents:
diff changeset
   309
// (other items were commented in a header).
hgs
parents:
diff changeset
   310
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   311
//
hgs
parents:
diff changeset
   312
EXPORT_C void CSendUi::AddSendMenuItemToMenuPaneL(
hgs
parents:
diff changeset
   313
    TBool&                       aResult,
hgs
parents:
diff changeset
   314
    CEikMenuPane&               aMenuPane,
hgs
parents:
diff changeset
   315
    TInt                        aIndex,
hgs
parents:
diff changeset
   316
    TInt                        aCommandId,
hgs
parents:
diff changeset
   317
    TSendingCapabilities        aRequiredCapabilities)
hgs
parents:
diff changeset
   318
    {
hgs
parents:
diff changeset
   319
    iSendUiImpl->AddTypedMenuItemToMenuPaneL(
hgs
parents:
diff changeset
   320
        aResult,
hgs
parents:
diff changeset
   321
        ESendMenu,
hgs
parents:
diff changeset
   322
        aMenuPane,
hgs
parents:
diff changeset
   323
        aIndex,
hgs
parents:
diff changeset
   324
        aCommandId,
hgs
parents:
diff changeset
   325
        aRequiredCapabilities
hgs
parents:
diff changeset
   326
        );
hgs
parents:
diff changeset
   327
    }
hgs
parents:
diff changeset
   328
hgs
parents:
diff changeset
   329
// ========================== OTHER EXPORTED FUNCTIONS =========================
hgs
parents:
diff changeset
   330
hgs
parents:
diff changeset
   331
// End of File
hgs
parents:
diff changeset
   332