multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcesrvendpoint.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMCESRVENDPOINT_H
       
    22 #define CMCESRVENDPOINT_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "mcesrvstream.h"
       
    26 #include "mcesrv.h"
       
    27 
       
    28 
       
    29 class CMceComMediaSource;
       
    30 class CMceMediaManager;
       
    31 class TMceMccComEvent;
       
    32 class CMceSrvStream;
       
    33 class CMceComEndpoint;
       
    34 
       
    35 /**
       
    36  * 
       
    37  *
       
    38  * @lib 
       
    39  */
       
    40 class CMceSrvEndpoint: public CBase
       
    41     {
       
    42 
       
    43 
       
    44 public: // Constructors & Destructor
       
    45 
       
    46     
       
    47     /**
       
    48     * Destructor.
       
    49     */
       
    50      ~CMceSrvEndpoint();
       
    51 
       
    52     
       
    53 public: // Source and sink functions
       
    54 
       
    55 
       
    56     /**
       
    57     * Gets id
       
    58     * @return id
       
    59     */
       
    60     TUint32& Id();
       
    61 
       
    62     /**
       
    63     * Gets the original com endpoint
       
    64     * @return the original com endpoint
       
    65     */
       
    66     CMceComEndpoint& Data() const;
       
    67 
       
    68     /**
       
    69     * Handles event from MCC
       
    70     */
       
    71     void EventReceived( TMceMccComEvent& aEvent );
       
    72 
       
    73 
       
    74     /**
       
    75     * Gets the source type
       
    76     * @return the source type
       
    77     */
       
    78     const TUid Type() const;
       
    79     
       
    80     void SetState( CMceSrvStream::TState aState );
       
    81 
       
    82     CMceSrvStream::TState State() const;
       
    83     
       
    84     /**
       
    85     * Merges with stream from cloned session
       
    86     */
       
    87     void Merge( CMceSrvEndpoint& aMergeWith );
       
    88     
       
    89     TBool EnableL( CMceSrvStream& aStream, 
       
    90                    TBool aSync = KMceSrvStreamNoSync );
       
    91 
       
    92     TBool DisableL( CMceSrvStream& aStream, 
       
    93                     TBool aSync = KMceSrvStreamNoSync,
       
    94                     TBool aForce = KMceSrvStreamNoForce );
       
    95     
       
    96     TBool Reusable( const CMceSrvStream& aStream ) const;
       
    97     
       
    98     TBool StreamStateChangeEventReceived( TMceMccComEvent& aEvent );
       
    99     
       
   100     TBool EndpointMatch( const CMceComEndpoint& aEndpoint, 
       
   101                          TBool aUseProxyMatch );
       
   102 
       
   103 public:
       
   104 
       
   105     /**
       
   106     * Called after prepare is called for this
       
   107     * stream
       
   108     */
       
   109     virtual void MccPrepareCalledL( CMceSrvStream& aStream );
       
   110     
       
   111     /**
       
   112     * Gets correct endpoint from stream.
       
   113     * @param aStream
       
   114     * @return CMceSrvEndpoint
       
   115     */
       
   116     virtual CMceSrvEndpoint& Endpoint( CMceSrvStream& aStream ) = 0;
       
   117     
       
   118     /**
       
   119     * Handle secure key expired event
       
   120     * @param aEvent MCC event
       
   121     * @return void
       
   122     */
       
   123     virtual void HandleSecureEventReceivedL( ) =0;
       
   124     
       
   125 protected:
       
   126 
       
   127     /**
       
   128     * C++ default constructor.
       
   129     */
       
   130     CMceSrvEndpoint( CMceMediaManager& aManager, CMceComEndpoint& aData );
       
   131     
       
   132 protected: // owned data
       
   133     
       
   134     TUint32 iID;
       
   135     CMceSrvStream::TState iState;
       
   136     
       
   137 protected: // NOT owned data
       
   138 
       
   139     CMceMediaManager* iManager;
       
   140     CMceComEndpoint* iData;
       
   141     
       
   142     friend class CMceSrvStream;
       
   143     
       
   144 	//definitions for unit testing
       
   145 	MCEMM_UT_DEFINITIONS
       
   146     
       
   147     
       
   148     };
       
   149 
       
   150 
       
   151 
       
   152 #endif //CMCESRVENDPOINT_H