phoneclientserver/phoneserver/Src/CommandHandler/CPhSrvComHandRequest.cpp
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2003-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:  Command Handler Request.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "CPhSrvComHandRequest.h"
       
    22 #include "PhSrvUtils.h"
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CPhSrvComHandRequest::CPhSrvComHandRequest
       
    32 // 
       
    33 // Constructor.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CPhSrvComHandRequest::CPhSrvComHandRequest( 
       
    37     const RMessage2& aMessage, 
       
    38     const TPhCltComHandCommandParameters& aParams, 
       
    39     TInt aSubSessionHandle )
       
    40 :   iPendingRequestPointer( aMessage ), 
       
    41     iComHandParams( aParams ), 
       
    42     iSubSessionHandle( aSubSessionHandle )
       
    43     {
       
    44     }
       
    45 
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CPhSrvComHandRequest::CPhSrvComHandRequest
       
    49 // 
       
    50 // Constructor.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 CPhSrvComHandRequest::CPhSrvComHandRequest()
       
    54     {
       
    55     }
       
    56 
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CPhSrvComHandRequest::NewLC
       
    60 // 
       
    61 // Static Symbian OS two-phase constructor. Return an instance
       
    62 // and leave it on the cleanup stack.
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 CPhSrvComHandRequest* CPhSrvComHandRequest::NewLC( 
       
    66     const RMessage2& aMessage, 
       
    67     const TPhCltComHandCommandParameters& aParams, 
       
    68     TInt aSubSessionHandle )
       
    69     {
       
    70     CPhSrvComHandRequest* self = new( ELeave ) CPhSrvComHandRequest( 
       
    71         aMessage, 
       
    72         aParams, 
       
    73         aSubSessionHandle );
       
    74     CleanupStack::PushL( self );
       
    75     return self;
       
    76     }
       
    77 
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CPhSrvComHandRequest::NewL
       
    81 // 
       
    82 // Static Symbian OS two-phase constructor.
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 CPhSrvComHandRequest* CPhSrvComHandRequest::NewL()
       
    86     {
       
    87     CPhSrvComHandRequest* self = new( ELeave ) CPhSrvComHandRequest();
       
    88     return self;
       
    89     }
       
    90 
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CPhSrvComHandRequest::InformOfComHandRequestAttemptResult
       
    94 // 
       
    95 // Complete a client request which will indicate the result
       
    96 // of attempting to perform a request.
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CPhSrvComHandRequest::InformOfComHandRequestAttemptResult( 
       
   100     TPhCltPhoneResults aResultOfAttemptingRequest )
       
   101     {
       
   102     // Complete the client's pending request, indicating 
       
   103     // the result of the command handler request attempt.
       
   104     iPendingRequestPointer.Complete( aResultOfAttemptingRequest );
       
   105     }
       
   106 
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CPhSrvComHandRequest::Cancel
       
   110 // 
       
   111 // Complete the client's request with KErrCancel.
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 void CPhSrvComHandRequest::Cancel()
       
   115     {
       
   116     iPendingRequestPointer.Complete( KErrCancel );
       
   117     }
       
   118 
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // CPhSrvComHandRequest::SubSessionHandle
       
   122 // 
       
   123 // Return the handle of the subsession that initiated the
       
   124 // original command handler request.
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 TInt CPhSrvComHandRequest::SubSessionHandle() const
       
   128     {
       
   129     return iSubSessionHandle;
       
   130     }
       
   131 
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CPhSrvComHandRequest::ComHandParameters
       
   135 // 
       
   136 // Returns the command handler parameters.
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 const TPhCltComHandCommandParameters& 
       
   140     CPhSrvComHandRequest::ComHandParameters() const
       
   141     {
       
   142     return iComHandParams;
       
   143     }
       
   144 
       
   145 
       
   146 // -----------------------------------------------------------------------------
       
   147 // CPhSrvComHandRequest::UpdateEmergencyRequest
       
   148 // 
       
   149 // Set new parameters to emergency request object.
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 void CPhSrvComHandRequest::UpdateEmergencyRequest( 
       
   153     const RMessage2& aMessage, 
       
   154     const TPhCltComHandCommandParameters& aParams, 
       
   155     TInt aSubSessionHandle )
       
   156     {
       
   157     iPendingRequestPointer = aMessage;
       
   158     iComHandParams = aParams;
       
   159     iSubSessionHandle = aSubSessionHandle;
       
   160     }
       
   161 
       
   162 
       
   163 // -----------------------------------------------------------------------------
       
   164 // CPhSrvComHandRequest::ClearEmergencyRequest
       
   165 // 
       
   166 // Empties Emergency request data.
       
   167 // -----------------------------------------------------------------------------
       
   168 //
       
   169 void CPhSrvComHandRequest::ClearEmergencyRequest()
       
   170     {
       
   171     iSubSessionHandle = 0;
       
   172     }
       
   173 
       
   174 
       
   175 // End of File