tsrc/musmanagerstub/src/musmanagerstub.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "musmanagerstub.h"
       
    20 #include <musmanagercommon.h>
       
    21 
       
    22 #include <e32std.h>
       
    23 
       
    24 static TInt StartError = KErrNone;
       
    25 static TInt Availability = KErrNone;
       
    26 static MultimediaSharing::TMusUseCase useCase = MultimediaSharing::EMusContinue;
       
    27 
       
    28 EXPORT_C void CMusManager::SetStartError( TInt aError )
       
    29     {
       
    30     StartError = aError;
       
    31     }
       
    32 
       
    33 EXPORT_C void CMusManager::SetAvailability( TInt aAvailability )
       
    34     {
       
    35     Availability = aAvailability;    
       
    36     }
       
    37 
       
    38 EXPORT_C void CMusManager::SetUseCase( MultimediaSharing::TMusUseCase aUseCase )
       
    39     {
       
    40     useCase = aUseCase;
       
    41     }
       
    42     
       
    43 EXPORT_C MultimediaSharing::TMusUseCase CMusManager::UseCase()
       
    44     {
       
    45     return useCase;
       
    46     }
       
    47     
       
    48 // -----------------------------------------------------------------------------
       
    49 // ?description_if_needed
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CMusManager::CMusManager()
       
    53     :iStartError(KErrNone),
       
    54     iExamineLeaveCode(KErrNone),
       
    55     iAvailability( ( MultimediaSharing::TMusAvailabilityStatus ) KErrGeneral)
       
    56     {
       
    57     
       
    58     
       
    59     
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // ?description_if_needed
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void CMusManager::ConstructL()
       
    67     {
       
    68     }
       
    69 
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // ?description_if_needed
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 EXPORT_C CMusManager* CMusManager::NewL()
       
    76     {
       
    77     CMusManager* self = CMusManager::NewLC();
       
    78     CleanupStack::Pop( self );
       
    79     return self;
       
    80     }
       
    81 
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // ?description_if_needed
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 EXPORT_C CMusManager* CMusManager::NewLC()
       
    88     {
       
    89     CMusManager* self = new( ELeave ) CMusManager;
       
    90     CleanupStack::PushL( self );
       
    91     self->ConstructL();
       
    92     return self;
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // ?description_if_needed
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 CMusManager::~CMusManager()
       
   101     {
       
   102     }
       
   103 
       
   104 EXPORT_C void CMusManager::ExamineAvailabilityL()
       
   105     {
       
   106     if( iExamineLeaveCode != KErrNone )
       
   107         {
       
   108         User::Leave( iExamineLeaveCode );
       
   109         }
       
   110     }
       
   111 
       
   112 EXPORT_C MultimediaSharing::TMusAvailabilityStatus CMusManager::AvailabilityL()
       
   113     {
       
   114     return ( MultimediaSharing::TMusAvailabilityStatus ) Availability;
       
   115     }
       
   116 
       
   117 EXPORT_C void CMusManager::HandleSipRequestL( TRequestType aChannelId )
       
   118     {
       
   119     iHandleSipRequestLCalledWithParam = aChannelId;
       
   120     }
       
   121 
       
   122 EXPORT_C void CMusManager::StartApplicationL( MultimediaSharing::TMusUseCase aUseCase )
       
   123     {
       
   124     if( StartError != KErrNone )
       
   125         {
       
   126         User::Leave( StartError );
       
   127         }
       
   128     
       
   129     useCase = aUseCase;
       
   130     }
       
   131 
       
   132 EXPORT_C void CMusManager::StopApplicationL()
       
   133     {
       
   134     }
       
   135 
       
   136 EXPORT_C void CMusManager::MonitorAvailabilityL( 
       
   137                     TRequestStatus& aRequestStatus,
       
   138                     MultimediaSharing::TMusAvailabilityStatus& /*aAvailabilityStatus*/ )
       
   139     {
       
   140     iStatus = &aRequestStatus;
       
   141     }
       
   142 
       
   143 EXPORT_C void CMusManager::CancelMonitoring()
       
   144 	{
       
   145 	RThread thread;
       
   146 	
       
   147 	thread.RequestComplete( iStatus, KErrNone );
       
   148 	
       
   149 	thread.Close();
       
   150 	}
       
   151 
       
   152 
       
   153 EXPORT_C void CMusManager::HandleCommandL( MultimediaSharing::TCommandType /*aCommandType*/ )
       
   154     {
       
   155     
       
   156     }
       
   157  
       
   158