mmsengine/clientmtm/src/mmssendmessageoperation.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:   Operation class for SendAs API send support
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include    "mmssendmessageoperation.h"
       
    23 #include    "mmscmds.h"
       
    24 
       
    25 // EXTERNAL DATA STRUCTURES
       
    26 
       
    27 // EXTERNAL FUNCTION PROTOTYPES  
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // LOCAL CONSTANTS AND MACROS
       
    34 
       
    35 // MODULE DATA STRUCTURES
       
    36 
       
    37 // LOCAL FUNCTION PROTOTYPES
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 
       
    41 // ============================= LOCAL FUNCTIONS ===============================
       
    42 
       
    43 // ============================ MEMBER FUNCTIONS ===============================
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CMmsSendMessageOperation::CMmsSendMessageOperation
       
    47 // C++ default constructor can NOT contain any code, that
       
    48 // might leave.
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 CMmsSendMessageOperation::CMmsSendMessageOperation(
       
    52     CMsvSession& aMsvSession,
       
    53     TRequestStatus& aObserverRequestStatus ):
       
    54     CMsvSendOperation( aMsvSession, aObserverRequestStatus )
       
    55     {
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CMmsSendMessageOperation::ConstructL
       
    60 // Symbian 2nd phase constructor can leave.
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void CMmsSendMessageOperation::ConstructL(
       
    64     const CMsvEntrySelection& aSelection,
       
    65     const TDesC8& aParameter )
       
    66     {
       
    67     iOperation = iMsvSession.TransferCommandL(
       
    68         aSelection,
       
    69         EMmsScheduledSend,
       
    70         (TDesC8&)aParameter,
       
    71         iStatus);
       
    72     // assigns iMtm, iService and sets active
       
    73     Start(iOperation);
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CMmsSendMessageOperation::NewL
       
    78 // Two-phased constructor.
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 CMmsSendMessageOperation* CMmsSendMessageOperation::NewL(
       
    82     CMsvSession& aMsvSession, 
       
    83     const CMsvEntrySelection& aSelection, 
       
    84     const TDesC8& aParameter, 
       
    85     TRequestStatus& aObserverRequestStatus )
       
    86     {
       
    87     CMmsSendMessageOperation* self = new( ELeave ) CMmsSendMessageOperation(
       
    88         aMsvSession, aObserverRequestStatus );
       
    89     
       
    90     CleanupStack::PushL( self );
       
    91     self->ConstructL( aSelection, aParameter );
       
    92     CleanupStack::Pop( self );
       
    93 
       
    94     return self;
       
    95     }
       
    96 
       
    97     
       
    98 // Destructor
       
    99 CMmsSendMessageOperation::~CMmsSendMessageOperation()
       
   100     {
       
   101     
       
   102     }
       
   103 
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // CMmsSendMessageOperation::TranslateProgress
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 const TDesC8& CMmsSendMessageOperation::TranslateProgress(const TDesC8& /* aProgress */)
       
   110     {
       
   111     // so far MMS server mtm does not provide any progress information
       
   112 /*
       
   113     TMsvLocalOperationProgress& progress = (TMsvLocalOperationProgress&) aProgress;
       
   114 */    
       
   115     
       
   116     // When progress is not supported, only zeroes are returned.
       
   117     iProgress().iProgressMax = 0;
       
   118     iProgress().iProgress = 0;
       
   119 
       
   120     // get error
       
   121     iProgress().iError = KErrNone;
       
   122 
       
   123     return iProgress;
       
   124     }
       
   125 
       
   126 
       
   127 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   128 
       
   129 //  End of File