tsrc/mceclientstub/inc/mcedisplaysink.h
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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCEDISPLAYSINK_H
       
    20 #define MCEDISPLAYSINK_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "mcemediasink.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CMceManager;
       
    27 class RWindow;
       
    28 class CWindowGc;
       
    29 
       
    30 // DATA TYPES
       
    31 const TMceSinkType KMceDisplaySink = 3;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * Class representing display in MCE.
       
    38 *
       
    39 * CMceDisplaySink can be used to show video on screen or as a viewfinder
       
    40 * of the camera.
       
    41 *
       
    42 * Enable and Disable operations to it are considered to be local, 
       
    43 * so they are not signalled to remote terminal.
       
    44 * 
       
    45 * @lib mceclient.lib
       
    46 */
       
    47 class CMceDisplaySink : public CMceMediaSink
       
    48 	{
       
    49 	
       
    50 	public:
       
    51     
       
    52         enum TRotation
       
    53             {
       
    54             ENone, 
       
    55             EClockwise90Degree, 
       
    56             EClockwise180Degree,
       
    57             EClockwise270Degree
       
    58             };
       
    59             
       
    60 	public: // Constructors and destructor
       
    61 
       
    62 	    /**
       
    63 	    * Two-phased constructor.
       
    64 	    * @param aManager reference to the manager
       
    65 	    */
       
    66 		IMPORT_C static CMceDisplaySink* NewL( CMceManager& aManager );
       
    67 
       
    68 	    /**
       
    69 	    * Two-phased constructor.
       
    70 	    * @param aManager reference to the manager
       
    71 	    */
       
    72 		IMPORT_C static CMceDisplaySink* NewLC( CMceManager& aManager );
       
    73 
       
    74 	    /**
       
    75 	    * Destructor.
       
    76 	    */
       
    77 		IMPORT_C ~CMceDisplaySink();
       
    78 
       
    79 
       
    80 	public: // From CMceMediaSink
       
    81 
       
    82 	    /**
       
    83 	    * Enables the sink explicitly.
       
    84 	    */
       
    85 		IMPORT_C void EnableL(); 
       
    86 
       
    87 	    /**
       
    88 	    * Disables the sink explicitly.
       
    89 	    */
       
    90 		IMPORT_C void DisableL(); 
       
    91 
       
    92 
       
    93     public: // New functions
       
    94     	
       
    95     	/**
       
    96 	    * Gets the number of available displays on the device.
       
    97 	    * @return number of available displays 
       
    98 	    */
       
    99 	    IMPORT_C TInt DisplaysAvailable() const;
       
   100 	    
       
   101 	    /**
       
   102 	    * Sets index of physical display to be used.
       
   103 	    * @param aDisplayIndex, index of the display to be used; number of 
       
   104 	    *        available displays can be retrieved by calling 
       
   105 	    *        CMceDisplaySink::DisplaysAvailable
       
   106 	    * @leave KErrNotSupported if requested display cannot be used
       
   107 	    */
       
   108 	    IMPORT_C void SetDisplayIndexL( TInt aDisplayIndex ); 
       
   109 	    	
       
   110 		/**
       
   111 		* Sets display resources.
       
   112 		* @param aWindow handle to the display window of the user
       
   113 		* @param aGc graphics context of the user
       
   114 		*/
       
   115 		IMPORT_C void SetDisplay( RWindow& aWindow, CWindowGc& aGc );
       
   116 		
       
   117         /**
       
   118         * Sets display rectangle. Display data is drawn to the given area.
       
   119         * @param aRect display area
       
   120         */
       
   121 		IMPORT_C void SetDisplayRectL( const TRect& aRect );
       
   122 		
       
   123         /**
       
   124         * Gets current display rectagle. 
       
   125         * @return current display rectangle 
       
   126         */
       
   127 		IMPORT_C const TRect DisplayRectL();
       
   128 		
       
   129 		/*
       
   130 		* Sets display sink priority. Priority value 0 is the highest priority. 
       
   131 		* Display sink with higher priority draws over less priority display
       
   132 		* if display rectangles overlap.
       
   133 		* @param aPriority priority value
       
   134 		*/
       
   135 		IMPORT_C void SetPriorityL( TUint aPriority );
       
   136 		
       
   137 		/*
       
   138 		* Display sink's current priority.
       
   139 		* @return priority value
       
   140 		*/
       
   141 		IMPORT_C TUint PriorityL();
       
   142 
       
   143         /*
       
   144 		* Sets display sink rotation. 
       
   145 		* @param aRotation rotation value
       
   146 		*/
       
   147 		IMPORT_C void SetRotationL( TRotation aRotation );
       
   148 		
       
   149 		/*
       
   150 		* Display sink's current rotation.
       
   151 		* @return rotation value
       
   152 		*/
       
   153 		IMPORT_C TRotation RotationL();
       
   154 
       
   155 		
       
   156 	public: // internal
       
   157 	
       
   158 	    /**
       
   159 	    * Initializes 
       
   160 	    * @param aManager the manager. Ownership is NOT transferred
       
   161 	    */
       
   162 	    void InitializeL( CMceManager* aManager );
       
   163 
       
   164 	    	    
       
   165 	private:
       
   166 
       
   167 	    /**
       
   168 	     * C++ constructor.
       
   169 	     */
       
   170 		CMceDisplaySink();
       
   171 
       
   172 	    /**
       
   173 	    * second-phase constructor
       
   174 	    */
       
   175 		void ConstructL( CMceManager* aManager );
       
   176 
       
   177     private: // Reserved for future use
       
   178     
       
   179         TAny* iReserved;         	
       
   180 
       
   181     public: // stub data
       
   182     
       
   183         TInt iDisplayIndex;
       
   184         
       
   185         TRect iDisplayRect;
       
   186         
       
   187         TUint iDisplayPriority;
       
   188         
       
   189         TRotation iRotation;
       
   190 
       
   191 	};
       
   192 
       
   193 #endif