mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediasource.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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 #ifndef CMCEMEDIASOURCE_H
       
    20 #define CMCEMEDIASOURCE_H
       
    21 
       
    22 // INCLUDES 		
       
    23 #include <e32base.h> 	
       
    24 
       
    25 // DATA TYPES
       
    26 typedef TUint TMceSourceType;
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RReadStream;
       
    30 class RWriteStream;
       
    31 class CMceComMediaSource;
       
    32 class TMceSourceFactory;
       
    33 class CMceMediaStream;
       
    34 class TMceEvent;
       
    35 class TMceMediaId;
       
    36 class CMceManager;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 * Base class for the MCE media sources.
       
    42 *
       
    43 * Media sources represent the origin of data.
       
    44 * CMceMediaSource puts it data through CMceMediaStream into
       
    45 * CMceMediaSink.
       
    46 *
       
    47 * CMceMediaSource has a type that defines how it can connected to other
       
    48 * sinks and streams.
       
    49 *
       
    50 * Enable and Disable operations to sinks are considered to be local,
       
    51 * so they are not signalled to remote terminal.
       
    52 * 
       
    53 *  @lib mceclient.lib
       
    54 */
       
    55 class CMceMediaSource: public CBase
       
    56 	{
       
    57 	public: // Destructor
       
    58 
       
    59 		IMPORT_C ~CMceMediaSource();
       
    60 
       
    61 	public: // Functions
       
    62 
       
    63 	    /**
       
    64 	    * Returns the type of the source.
       
    65 	    * @return The type of the source.
       
    66 	    */
       
    67 		IMPORT_C TMceSourceType Type() const;
       
    68 
       
    69 	    /**
       
    70 	    * Enables streaming explicitly.
       
    71 	    */
       
    72 		virtual void EnableL() = 0; 
       
    73 
       
    74 	    /**
       
    75 	    * Disables streaming explicitly.
       
    76 	    */
       
    77 		virtual void DisableL() = 0;
       
    78 
       
    79 	    /**
       
    80 	    * Returns the state of the source.
       
    81 	    * @return ETrue if enabled, EFalse if disabled.
       
    82 	    */
       
    83 		IMPORT_C TBool IsEnabled() const;
       
    84 		
       
    85 
       
    86 	    
       
    87 	public: //internal
       
    88 	
       
    89 	    /**
       
    90 	    * Initializes 
       
    91 	    * @param aParent the parent
       
    92 	    */
       
    93 	    virtual void InitializeL( CMceMediaStream& aParent );
       
    94 
       
    95         /**
       
    96 	    * Initializes 
       
    97 	    * @param aManager the manager. Ownership is NOT transferred
       
    98 	    */
       
    99 	    virtual void InitializeL( CMceManager* aManager );    
       
   100 	   	    
       
   101 	    /**
       
   102 	    * Sets and gets reference count describing to how many
       
   103 	    * streams source is associated
       
   104 	    * @return reference count reference
       
   105 	    */
       
   106 	    TInt& ReferenceCount();
       
   107 
       
   108 	    	    
       
   109 	protected:
       
   110 
       
   111 	    /**
       
   112 	     * C++ default constructor.
       
   113 	     */
       
   114 		CMceMediaSource();
       
   115 		
       
   116 	    /**
       
   117 	    * Enables streaming explicitly.
       
   118 	    */
       
   119 		void DoEnableL();
       
   120 
       
   121 	    /**
       
   122 	    * Disables streaming explicitly.
       
   123 	    */
       
   124 		void DoDisableL();
       
   125 		
       
   126 
       
   127 	protected: // NOT owned data
       
   128 		
       
   129 	    /**
       
   130 	     * stream
       
   131 	     */
       
   132 		RPointerArray<CMceMediaStream> iStreams;
       
   133 	    
       
   134 	
       
   135 	public: // stub data
       
   136 	
       
   137 	    TBool iIsEnabled;
       
   138 	
       
   139 	    TMceSourceType iType;
       
   140 
       
   141         TInt iReferenceCount;
       
   142 
       
   143 		};
       
   144 
       
   145 
       
   146 #endif