windowing/windowserver/inc/Graphics/displaymapping.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @prototype
       
    20 */
       
    21 
       
    22 #ifndef DISPMAP_CLIENT_H_
       
    23 #define DISPMAP_CLIENT_H_
       
    24 #include <w32std.h>
       
    25 
       
    26 /** Defines the coordinate space UID values for use with
       
    27 	MDisplayMappingBase::MapCoordinates().
       
    28 */
       
    29 enum TCoordinateSpace
       
    30 		{
       
    31 	/**
       
    32 		Application coordinate space, possibly offset but not scaled
       
    33 		relative to full-screen space.
       
    34 	 */
       
    35 	EApplicationSpace = 0x1028656F,
       
    36 	/**
       
    37 		User interface coordinate space, possibly scaled but not offset
       
    38 		relative to composition space.
       
    39 	*/
       
    40 	EFullScreenSpace = 0x10286570,
       
    41 	/**
       
    42 		Composition coordinate space, used by composition back-end in
       
    43 		compositing the display contents.
       
    44 	*/
       
    45 	ECompositionSpace = 0x10286571,
       
    46 	/**
       
    47 		Coordinate space for the DSA buffer. May be offset but not scaled
       
    48 		relative to both application and full-screen spaces. Identical to
       
    49 		full-screen space if the DSA buffer is used for UI rendering.
       
    50 	*/
       
    51 	EDirectScreenAccessSpace = 0x1028656E
       
    52 	};
       
    53 
       
    54 /** Provides facilities to map coordinates between various coordinate
       
    55 	spaces.
       
    56 
       
    57 */
       
    58 class MDisplayMappingBase
       
    59 	{
       
    60 public:
       
    61 	enum	
       
    62 		{
       
    63 		KUidDisplayMappingBase =  0x1028656D, 	  
       
    64 		ETypeId=	 KUidDisplayMappingBase 
       
    65 		};
       
    66 public:
       
    67 	/** Maps the source rectangle from a source coordinate space to a
       
    68 		target coordinate space. Since there may be scaling involved, the
       
    69 		target rectangle may be larger or smaller than the source one, or
       
    70 		even become empty.
       
    71 
       
    72 		Two rectangles that abut each other before mapping, when mapped
       
    73 		using the same source and target space UIDs, shall also abut each
       
    74 		other after mapping.
       
    75 
       
    76 		@param aSourceSpace source space
       
    77 		@param aSource source rectangle
       
    78 		@param aTargetSpace target space
       
    79 		@param aTarget target rectangle to be filled in
       
    80 		@return KErrNone if successful or KErrNotSupported if invalid TCoordinateSpace
       
    81 	*/
       
    82 	virtual TInt MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, TCoordinateSpace aTargetSpace, TRect& aTarget) const =0;
       
    83 	};
       
    84 
       
    85 /** Provides the Window Server client coordinate space mapping
       
    86 	functions.
       
    87 
       
    88 */
       
    89 class MDisplayMapping : public MDisplayMappingBase
       
    90 	{
       
    91 public:
       
    92 	enum	
       
    93 		{
       
    94 		KUidDisplayMapping =  0x1028656B, 	  
       
    95 		ETypeId=	 KUidDisplayMapping 
       
    96 		};
       
    97 public:
       
    98 	/** Retrieves the largest window extent that is visible at the current
       
    99 		display resolution. This may be larger than the size reported by
       
   100 		SizeInPixels(), and have a negative top-left position, for example.
       
   101 
       
   102 		@see MDisplayControl
       
   103 		@see CWsScreenDevice::SizeInPixels
       
   104 
       
   105 	 	@param aExtent extent to be filled in
       
   106 	*/
       
   107 	virtual void GetMaximumWindowExtent(TRect& aExtent) const =0;
       
   108 	/** Returns the maximum useful size for a surface to be shown on the
       
   109 		display at the current resolution, in both pixels and twips.
       
   110 
       
   111 		This may be larger than both the screen device SizeInPixels() and
       
   112 		the size of the maximum window extent, if the user interface is
       
   113 		being scaled by the display. In general, the value will be the
       
   114 		native display resolution.
       
   115 
       
   116 		@see MDisplayControl
       
   117 		@see CWsScreenDevice::SizeInPixels
       
   118 		
       
   119 		@param aPixels pixels to be filled in
       
   120 		@param aTwips twips to be filled in
       
   121 	*/
       
   122 	virtual void GetMaximumSurfaceSize(TSize& aPixels, TSize& aTwips) const =0;
       
   123 	/** Retrieves the extent of a window relative to the top-left corner of
       
   124 		the display.
       
   125 
       
   126 		This will differ from the window's AbsPosition() if the current
       
   127 		screen size mode is offset from the corner of the display, or if
       
   128 		the user interface is being scaled on the display.
       
   129 
       
   130 		@param aWindow window in question
       
   131 		@param aExtent extent to be filled in
       
   132 	*/
       
   133 	virtual void GetDisplayExtentOfWindow(const RWindowBase& aWindow, TRect& aExtent) const =0;
       
   134 	};
       
   135 
       
   136 
       
   137 
       
   138 #endif 	/*DISPMAP_CLIENT_H_*/