voicerecorder/NewServiceSrc/cnewfileserviceserverobserver.cpp
branchRCL_3
changeset 20 072a5fa0c63b
parent 19 2f5c9ee7098c
child 21 c6bafb5162d8
equal deleted inserted replaced
19:2f5c9ee7098c 20:072a5fa0c63b
     1 /*
       
     2 * Copyright (c) 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:  CActive-derived class for synchronizing server commands.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cnewfileserviceserverobserver.h"
       
    21 #include "RNewFileServiceClient.h"
       
    22 
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CNewFileServiceServerObserver::CNewFileServiceServerObserver
       
    28 //
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CNewFileServiceServerObserver::CNewFileServiceServerObserver()
       
    32     : CActive( EPriorityNormal )
       
    33     {
       
    34     CActiveScheduler::Add( this );    
       
    35     }
       
    36 
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 // CNewFileServiceServerObserver::ConstructL
       
    40 //
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 void CNewFileServiceServerObserver::ConstructL()
       
    44     {
       
    45 
       
    46     }
       
    47 
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // CNewFileServiceServerObserver::NewL
       
    51 //
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 CNewFileServiceServerObserver* CNewFileServiceServerObserver::NewL()
       
    55     {
       
    56     CNewFileServiceServerObserver* self = new( ELeave ) CNewFileServiceServerObserver;
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL();    
       
    59     CleanupStack::Pop( self );
       
    60     return self;
       
    61     }
       
    62 
       
    63 
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CNewFileServiceServerObserver::~CNewFileServiceServerObserver
       
    67 //
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 CNewFileServiceServerObserver::~CNewFileServiceServerObserver()
       
    71     {
       
    72     iObserver = NULL;
       
    73 RDebug::Print( _L("VoiceRecorder::delete cnewfileserviceobserver") );	    
       
    74     Cancel();
       
    75     }
       
    76 
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // CNewFileServiceServerObserver::RunL
       
    80 //
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 void CNewFileServiceServerObserver::RunL()
       
    84     {
       
    85     RDebug::Print( _L("VoiceRecorder CNewFileServiceServerObserver::RunL") );
       
    86     if ( iObserver )
       
    87         {
       
    88         iObserver->ServerRequestReady( iStatus.Int() );
       
    89         }
       
    90     }
       
    91 
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CNewFileServiceServerObserver::DoCancel
       
    95 //
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 void CNewFileServiceServerObserver::DoCancel()
       
    99     {
       
   100     RDebug::Print( _L("VoiceRecorder CNewFileServiceServerObserver::DoCancel") );            
       
   101     if ( iObserver )
       
   102         {
       
   103         iObserver->ServerRequestReady( KErrCancel );
       
   104         }
       
   105 
       
   106     }
       
   107 
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CNewFileServiceServerObserver::IssueWait
       
   111 //
       
   112 // ---------------------------------------------------------------------------
       
   113 //
       
   114 TRequestStatus& CNewFileServiceServerObserver::IssueWait( 
       
   115 									MNewFileServiceServerObserver* aObserver )
       
   116     {
       
   117     iObserver = aObserver;
       
   118     
       
   119     SetActive();
       
   120     RDebug::Print( _L("VoiceRecorder CNewFileServiceServerObserver::IssueWait") );    
       
   121     return iStatus;
       
   122     }