uiacceltk/hitchcock/ServerCore/Inc/alfwindowmanager.h
changeset 0 15bf7259bb7c
child 10 88b23e2e82e1
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008 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:   Manages window and plugin life cycles 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __ALFWINDOWMANAGER_H__
       
    20 #define __ALFWINDOWMANAGER_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <alfwindowstructs.h>
       
    24 
       
    25 class CAlfHierarchyModel;
       
    26 class CAlfWindow;
       
    27 class CAlfWindowFxPlugin;
       
    28 class CAlfWindowBuffer;
       
    29 class CAlfStreamerBridge;
       
    30 class TAlfBridgerData;
       
    31 class TAlfWindowAttributes;
       
    32 class TAlfWindowCommandBufferAttributes;
       
    33 
       
    34 /**
       
    35  *  CAlfWindowManager
       
    36  *
       
    37  *  @lib alfappservercore.dll
       
    38  *  @since S60 5.0
       
    39  */
       
    40 NONSHARABLE_CLASS(CAlfWindowManager): public CBase
       
    41     {
       
    42 public:
       
    43     
       
    44     static CAlfWindowManager* NewL(CAlfHierarchyModel* aAlfHierarchy);
       
    45     
       
    46     virtual ~CAlfWindowManager();
       
    47     
       
    48     // Utils
       
    49     /**
       
    50      * CreateNewWindowL
       
    51      *
       
    52      * @since S60 5.0
       
    53      * @param aIndex
       
    54      * @param aSizeInPixels
       
    55      * @return New window
       
    56      */
       
    57     IMPORT_C CAlfWindow* CreateNewWindowL(TUint aIndex, const TSize& aSizeInPixels);
       
    58     
       
    59     /**
       
    60      * DestroyWindow
       
    61      *
       
    62      * @since S60 5.0
       
    63      * @param aWindow
       
    64      */
       
    65     IMPORT_C void DestroyWindow(CAlfWindow& aWindow);
       
    66     
       
    67     /**
       
    68      * EnableNewWindowNotificationsL
       
    69      *
       
    70      * @since S60 5.0
       
    71      * @param aPlugin
       
    72      * @param aEnable   New notification state
       
    73      */
       
    74     IMPORT_C void EnableNewWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
       
    75                                                 TBool aEnable = ETrue);
       
    76 
       
    77     /**
       
    78      * EnableDestroyWindowNotificationsL
       
    79      *
       
    80      * @since S60 5.0
       
    81      * @param aPlugin
       
    82      * @param aEnable   New notification state for window destruction.
       
    83      */
       
    84                                                 
       
    85 	IMPORT_C void EnableDestroyWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
       
    86                                                 TBool aEnable = ETrue);                                                
       
    87     /**
       
    88      * ReserveL
       
    89      *
       
    90      * Reserves exclusive right to use the window. 
       
    91      * Leaves with value KErrNotFound, if window is not found. 
       
    92      * Leaves with value KErrInUse, If window is already reserved.
       
    93      *  
       
    94      * @since S60 5.0
       
    95      * @param aId
       
    96      * @param aReserveBuffer reserve data buffer for effects
       
    97      * @return the reserved window
       
    98      */
       
    99     IMPORT_C CAlfWindow* ReserveL( const TWindowIdentifier& aId, TBool aReserveBuffer = ETrue );
       
   100 
       
   101     /**
       
   102      * Release
       
   103      *
       
   104      * Releases window
       
   105      * 
       
   106      * @since S60 5.0
       
   107      * @param aWindow
       
   108      * @param aReserveBuffer release the data buffer reserved for effects
       
   109      */
       
   110     IMPORT_C void Release( CAlfWindow& aWindow, TBool aReserveBuffer = ETrue );
       
   111     
       
   112     /**
       
   113      * aWindow
       
   114      *
       
   115      * @since S60 5.0
       
   116 
       
   117      * @return screen id
       
   118      */
       
   119     IMPORT_C TInt ScreenId() const;
       
   120 
       
   121 	#ifdef RND_FXPLUGIN_FIX
       
   122     
       
   123     /**
       
   124      * aWindow
       
   125      *
       
   126      * @since S60 5.0
       
   127 
       
   128      * @return screen id
       
   129      */
       
   130     IMPORT_C void GetWinIdListL(RArray<TWindowIdentifier>& aWinIdList);
       
   131     
       
   132 	#endif
       
   133 
       
   134     /**
       
   135      * Find all windows whose Window Server Group Id matches the one given as input
       
   136      * 
       
   137      * @param aWsGroupId Window server group id
       
   138      * @param aWinIdList list of window info structures whose group id matches the group given
       
   139      * 
       
   140      */
       
   141     IMPORT_C void GetWinIdListL( TInt aWsGroupId, RArray<TWindowIdentifier>& aWinIdList );
       
   142     
       
   143     /**
       
   144      * Find all windows whose Window Server Group Id matches the one given as input
       
   145      * The purpose is to be able to convert from window server identifiers to alf indentifiers
       
   146      * 
       
   147      * @param aWsGroupId Window server group id
       
   148      * @param aClientWindowHandle handle of a single window
       
   149      * @param aWinInfoList list of window info structures whose group id matches the group given
       
   150      *        if aClientWindowHandle != KErrNotFound, it must also match
       
   151      * 
       
   152      */
       
   153     IMPORT_C void GetWinInfoListL( TInt aWsGroupId, TInt aClientWindowHandle, RArray<TAlfWServInfo>& aWinInfoList );
       
   154     
       
   155     // Internal Utils
       
   156     
       
   157     /**
       
   158      * MoveWindow
       
   159      *
       
   160      * @since S60 5.0
       
   161      * @param aWindow
       
   162      * @param aIndex    New index for the window. The topmost is having index 0. 
       
   163      */
       
   164     void MoveWindow(CAlfWindow& aWindow, TInt aIndex);
       
   165 
       
   166     /**
       
   167      * SetWindowVisibility
       
   168      *
       
   169      * @since S60 5.0
       
   170      * @param aWindow
       
   171      * @param aVisible  New visibility state
       
   172      */
       
   173     void SetWindowVisibility(CAlfWindow& aWindow, TBool aVisible);
       
   174 
       
   175     /**
       
   176      * ContentReady
       
   177      *
       
   178      * Call to ContentReady will trigger update for all textures.
       
   179      * 
       
   180      * @since S60 5.0
       
   181      * @param aWindow   
       
   182      * @param aOutBuffer
       
   183      */
       
   184     void ContentReady(CAlfWindow& aWindow, CAlfWindowBuffer* aOutBuffer);
       
   185 
       
   186     /**
       
   187      * LoadPluginL
       
   188      *
       
   189      * @since S60 5.0
       
   190      * @param aPluginUid    Id for the plugin to be created
       
   191      */
       
   192     void LoadPluginL(const TUid& aPluginUid);
       
   193 
       
   194     /**
       
   195      * DestroyPlugin
       
   196      *
       
   197      * @since S60 5.0
       
   198      * @param aPluginUid    Id for the plugin to be destroyed
       
   199      */
       
   200     void DestroyPlugin(const TUid& aPluginUid);
       
   201 
       
   202     /**
       
   203      * PrepareNewFrame
       
   204      *
       
   205      * @since S60 5.0
       
   206      * @param aEstimatedInterval
       
   207      */
       
   208     void PrepareNewFrame(TUint aEstimatedInterval);
       
   209 
       
   210     /**
       
   211      * HandlePluginMsgL
       
   212      *
       
   213      * @since S60 5.0
       
   214      * @param aMessage  Message for message
       
   215      */
       
   216     void HandlePluginMsgL(const RMessage2& aMessage);
       
   217 
       
   218     /**
       
   219      * CancelPluginMsg
       
   220      *
       
   221      * @since S60 5.0
       
   222      * @param aPluginUid    Id of the plugin
       
   223      * @param aMessageId    Id for the message to be canceled
       
   224      * @return ?description
       
   225      */
       
   226     void CancelPluginMsg(const TUid& aPluginUid, TInt aMessageId);
       
   227 
       
   228     /**
       
   229      * CreateNewWindowL
       
   230      *
       
   231      * @since S60 5.0
       
   232      * @param aIndex    Order of window. Index 0 means the topmost.
       
   233      * @param aInfo     Window info 
       
   234      * @return ?description
       
   235      */
       
   236     CAlfWindow* CreateNewWindowL(TUint aIndex, const TAlfWServInfo& aInfo);
       
   237 
       
   238     /**
       
   239      * PostIt
       
   240      *
       
   241      * Posts command for asyncronous processing
       
   242      * 
       
   243      * @since S60 5.0
       
   244      * @param aData Command data
       
   245      * @return KErrNone, if data was succesfully posted. Otherwise an error code.
       
   246      */
       
   247     IMPORT_C TInt PostIt(const TAlfBridgerData& aData);
       
   248     
       
   249     IMPORT_C CAlfStreamerBridge* Bridge();
       
   250     
       
   251 private: // utils
       
   252 
       
   253     CAlfWindowManager();
       
   254     
       
   255     void ConstructL(CAlfHierarchyModel* aAlfHierarchy);
       
   256     
       
   257     /**
       
   258      * FindPlugin
       
   259      *
       
   260      * @since S60 5.0
       
   261      * @param ?arg1 ?description
       
   262      * @return Pointer to requested plugin. 0 if the requested plugin was not found.
       
   263      */
       
   264     CAlfWindowFxPlugin* FindPlugin(const TUid& aPluginUid);
       
   265 
       
   266     void BindWindowToHitchL(CAlfWindow* aWindow, CAlfWindowManager* aMgr);
       
   267 
       
   268     TAlfWindowAttributes* CreateWindowAttributes(TInt& aIndex);
       
   269 
       
   270     TAlfWindowCommandBufferAttributes* CreateWindowCommandBufferAttributes(TInt& aIndex);
       
   271     
       
   272 private: // data
       
   273         
       
   274         class TAlfWindowMgrData;
       
   275         
       
   276         TAlfWindowMgrData* iData;
       
   277     };
       
   278 
       
   279 
       
   280 #endif