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