uiaccelerator_plat/alf_extension_api/inc/alf/alfvisualhandlers.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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:   definitions of alf built-in visual support
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __ALFVISUALHANDLERS__
       
    21 #define __ALFVISUALHANDLERS__
       
    22 
       
    23 #include <alf/alfextensionfactory.h>
       
    24 #include <uiacceltk/HuiControl.h>
       
    25 #include <uiacceltk/HuiVisual.h>
       
    26 #include <uiacceltk/HuiLayout.h>
       
    27 #include <uiacceltk/HuiMesh.h>
       
    28 
       
    29 /**
       
    30  * Handler for the visual base class.
       
    31  */
       
    32 class CAlfVisualHandler: public CBase, public MAlfExtension
       
    33     {
       
    34 public: // new methods
       
    35 
       
    36     /**
       
    37      * Constructor.
       
    38      * @param aResolver The resolver for this visual handler.
       
    39      * @param aOwner The owner control of this visual.
       
    40      * @param aParentLayout The parent layout of this visual.
       
    41      */
       
    42     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
    43     
       
    44     /**
       
    45      * Constructor.
       
    46      * @param aResolver The resolver for this visual handler. 
       
    47      */
       
    48     IMPORT_C CAlfVisualHandler(MAlfInterfaceProvider& aResolver);
       
    49     
       
    50     /**
       
    51      * Second phase constructor.
       
    52      * @param aOwner The owner control of this visual.
       
    53      * @param aParentLayout The parent layout of this visual.
       
    54      */    
       
    55     IMPORT_C virtual void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
    56 
       
    57 protected: // from CBase
       
    58     IMPORT_C ~CAlfVisualHandler();
       
    59 
       
    60 public: // From MAlfExtension
       
    61     /**
       
    62      * Release this visual handler.
       
    63      */
       
    64     IMPORT_C void Release();
       
    65     
       
    66     /**
       
    67      * Gets the hui visual handled by this class.
       
    68      * @param aInterface Return parameter containing the visual.
       
    69      */
       
    70     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
    71     
       
    72     /**
       
    73      * Handle a command for this visual that has come from the client.
       
    74      * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
       
    75      * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
       
    76      * @param aResponse The return value for this command. Will be cast to correct type at the client side.
       
    77      * @see TAlfredServerIPC
       
    78      */
       
    79     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
       
    80     
       
    81     // @internal
       
    82     void HuiVisualAboutToTerminate();
       
    83 
       
    84 protected: // new methods
       
    85     IMPORT_C virtual void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
    86 
       
    87 protected: // data
       
    88     CHuiVisual* iVisual; // not owned
       
    89     MAlfInterfaceProvider& iResolver; // not owned
       
    90 
       
    91 private:
       
    92     
       
    93     struct TPrivateData;
       
    94     TPrivateData* iPrivateData;    
       
    95     };
       
    96 
       
    97 /**
       
    98  * Handler for TextVisual.
       
    99  */
       
   100 class CAlfTextVisualHandler: public CAlfVisualHandler
       
   101     {
       
   102 public: // new methods
       
   103     /**
       
   104      * Constructor.
       
   105      * @param aResolver The resolver for this visual handler.
       
   106      * @param aOwner The owner control of this visual.
       
   107      * @param aParentLayout The parent layout of this visual.
       
   108      */
       
   109     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
   110     
       
   111     /**
       
   112      * Constructor.
       
   113      * @param aResolver The resolver for this visual handler. 
       
   114      */    
       
   115     IMPORT_C CAlfTextVisualHandler(MAlfInterfaceProvider& aResolver);
       
   116 
       
   117 public: // from CAlfVisualHandler
       
   118     /**
       
   119      * Second phase constructor.
       
   120      * @param aOwner The owner control of this visual.
       
   121      * @param aParentLayout The parent layout of this visual.
       
   122      */
       
   123     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
   124 
       
   125 protected: // from CBase
       
   126     IMPORT_C ~CAlfTextVisualHandler();
       
   127 
       
   128 public: // From MAlfExtension
       
   129     /**
       
   130      * Release this visual handler.
       
   131      */
       
   132     IMPORT_C void Release();
       
   133     
       
   134     /**
       
   135      * Gets the hui visual handled by this class.
       
   136      * @param aInterface Return parameter containing the visual.
       
   137      */    
       
   138     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   139 
       
   140     /**
       
   141      * Handle a command for this visual that has come from the client.
       
   142      * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
       
   143      * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
       
   144      * @param aResponse The return value for this command. Will be cast to correct type at the client side.
       
   145      * @see TAlfredServerIPC
       
   146      */    
       
   147     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);    
       
   148 
       
   149 protected: // From CAlfVisualHandler
       
   150     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   151 
       
   152 private:
       
   153     TAny* iSpare;
       
   154     };
       
   155 
       
   156 //----------------------------
       
   157 // LCTTextVisual
       
   158 //----------------------------
       
   159 
       
   160 class CHuiTextVisual;
       
   161 class TAknTextLineLayout;
       
   162 
       
   163 class CAlfLCTTextVisualHandler: public CAlfTextVisualHandler
       
   164     {
       
   165 public: // new methods
       
   166     /**
       
   167      * Constructor.
       
   168      * @param aResolver The resolver for this visual handler.
       
   169      * @param aOwner The owner control of this visual.
       
   170      * @param aParentLayout The parent layout of this visual.
       
   171      */
       
   172     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
   173     
       
   174     /**
       
   175      * Constructor.
       
   176      * @param aResolver The resolver for this visual handler. 
       
   177      */        
       
   178     IMPORT_C CAlfLCTTextVisualHandler(MAlfInterfaceProvider& aResolver);
       
   179 
       
   180 public: // from CAlfVisualHandler
       
   181     /**
       
   182      * Second phase constructor.
       
   183      * @param aOwner The owner control of this visual.
       
   184      * @param aParentLayout The parent layout of this visual.
       
   185      */
       
   186     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
   187 
       
   188 protected: // from CBase
       
   189     IMPORT_C ~CAlfLCTTextVisualHandler();
       
   190 
       
   191 public: // From MAlfExtension
       
   192     /**
       
   193      * Release this visual handler.
       
   194      */
       
   195     IMPORT_C void Release();
       
   196     
       
   197     /**
       
   198      * Gets the hui visual handled by this class.
       
   199      * @param aInterface Return parameter containing the visual.
       
   200      */    
       
   201     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   202 
       
   203     /**
       
   204      * Handle a command for this visual that has come from the client.
       
   205      * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
       
   206      * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
       
   207      * @param aResponse The return value for this command. Will be cast to correct type at the client side.
       
   208      * @see TAlfredServerIPC
       
   209      */    
       
   210     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
       
   211 
       
   212 protected: // From CAlfVisualHandler
       
   213     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   214 
       
   215 private:
       
   216     void SetTextPaneL(CHuiTextVisual* aTextVisual, const TAknTextLineLayout& aLine);
       
   217 
       
   218 private:
       
   219     class TLCTTextVisualPrivateData;
       
   220     TLCTTextVisualPrivateData* iLCTTextVisualPrivateData;
       
   221     };
       
   222 
       
   223 //----------------------------
       
   224 // ImageVisual
       
   225 //----------------------------
       
   226 class CAlfImageVisualHandler: public CAlfVisualHandler
       
   227     {
       
   228 public: // new methods
       
   229 
       
   230     /**
       
   231      * Constructor.
       
   232      * @param aResolver The resolver for this visual handler.
       
   233      * @param aOwner The owner control of this visual.
       
   234      * @param aParentLayout The parent layout of this visual.
       
   235      */
       
   236     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
   237 
       
   238     /**
       
   239      * Constructor.
       
   240      * @param aResolver The resolver for this visual handler. 
       
   241      */            
       
   242     IMPORT_C CAlfImageVisualHandler(MAlfInterfaceProvider& aResolver);
       
   243 
       
   244 public: // from CAlfVisualHandler
       
   245     /**
       
   246      * Second phase constructor.
       
   247      * @param aOwner The owner control of this visual.
       
   248      * @param aParentLayout The parent layout of this visual.
       
   249      */
       
   250     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
   251 
       
   252 protected: // from CBase
       
   253     IMPORT_C ~CAlfImageVisualHandler();
       
   254 
       
   255 public: // From MAlfExtension
       
   256     /**
       
   257      * Release this visual handler.
       
   258      */
       
   259     IMPORT_C void Release();
       
   260     
       
   261     /**
       
   262      * Gets the hui visual handled by this class.
       
   263      * @param aInterface Return parameter containing the visual.
       
   264      */    
       
   265     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   266     
       
   267     /**
       
   268      * Handle a command for this visual that has come from the client.
       
   269      * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
       
   270      * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
       
   271      * @param aResponse The return value for this command. Will be cast to correct type at the client side.
       
   272      * @see TAlfredServerIPC
       
   273      */        
       
   274     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);     
       
   275 
       
   276 protected: // From CAlfVisualHandler
       
   277     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   278 
       
   279 private:
       
   280     TAny* iSpare;
       
   281     };
       
   282     
       
   283 //----------------------------
       
   284 // Line Visual
       
   285 //----------------------------
       
   286 class CAlfLineVisualHandler: public CAlfVisualHandler
       
   287     {
       
   288 public: // new methods
       
   289 
       
   290     /**
       
   291      * Constructor.
       
   292      * @see CAlfVisualHandler::NewL()
       
   293      */
       
   294     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
   295 
       
   296     /**
       
   297      * Constructor.
       
   298      * @see CAlfVisualHandler::CAlfVisualHandler()
       
   299      */    
       
   300     IMPORT_C CAlfLineVisualHandler(MAlfInterfaceProvider& aResolver);
       
   301 
       
   302 public: // from CAlfVisualHandler
       
   303     /**
       
   304      * Constructor.
       
   305      * @see CAlfVisualHandler::ConstructL()
       
   306      */    
       
   307     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
   308 
       
   309 protected: // from CBase
       
   310     IMPORT_C ~CAlfLineVisualHandler();
       
   311 
       
   312 public: // From MAlfExtension
       
   313     IMPORT_C void Release();
       
   314     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   315     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
       
   316 
       
   317 protected: // From CAlfVisualHandler
       
   318     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   319 
       
   320 private:
       
   321     class TLineVisualHandlerPrivateData;
       
   322     TLineVisualHandlerPrivateData* iLineVisualPrivateData;    
       
   323     };
       
   324     
       
   325 //----------------------------
       
   326 // Mesh Visual
       
   327 //----------------------------
       
   328 class CAlfMeshVisualHandler: public CAlfVisualHandler
       
   329     {
       
   330 public: // new methods
       
   331 
       
   332     /**
       
   333      * Constructor.
       
   334      * @see CAlfVisualHandler::NewL()
       
   335      */
       
   336     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, THuiMeshType aMeshType, CHuiLayout* aParentLayout);
       
   337     
       
   338     /**
       
   339      * Constructor.
       
   340      * @see CAlfVisualHandler::CAlfVisualHandler()
       
   341      */        
       
   342     IMPORT_C CAlfMeshVisualHandler(MAlfInterfaceProvider& aResolver);
       
   343 
       
   344 public: // from CAlfVisualHandler
       
   345     /**
       
   346      * Constructor.
       
   347      * @see CAlfVisualHandler::ConstructL()
       
   348      */    
       
   349     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, THuiMeshType aMeshType, CHuiLayout* aParentLayout);
       
   350 
       
   351 protected: // from CBase
       
   352     IMPORT_C ~CAlfMeshVisualHandler();
       
   353 
       
   354 public: // From MAlfExtension
       
   355     IMPORT_C void Release();
       
   356     
       
   357     /**
       
   358      * Get interface.
       
   359      * @see CAlfVisualHandler::GetInterface()
       
   360      */        
       
   361     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   362     
       
   363     /**
       
   364      * Handle command from client.
       
   365      * @see CAlfVisualHandler::HandleCmdL()
       
   366      */       
       
   367     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
       
   368 
       
   369 protected: // From CAlfVisualHandler
       
   370     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   371 
       
   372 private:
       
   373     class TMeshVisualHandlerPrivateData;
       
   374     TMeshVisualHandlerPrivateData* iMeshVisualPrivateData;    
       
   375     };
       
   376 
       
   377 //----------------------------
       
   378 // Canvas Visual
       
   379 //----------------------------
       
   380 class CAlfCanvasVisualHandler: public CAlfVisualHandler
       
   381     {
       
   382 public: // new methods
       
   383 
       
   384     /**
       
   385      * Constructor.
       
   386      * @see CAlfVisualHandler::NewL()
       
   387      */
       
   388     IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
       
   389 
       
   390     /**
       
   391      * Constructor.
       
   392      * @see CAlfVisualHandler::CAlfVisualHandler()
       
   393      */    
       
   394     IMPORT_C CAlfCanvasVisualHandler(MAlfInterfaceProvider& aResolver);
       
   395 
       
   396 public: // from CAlfVisualHandler
       
   397     /**
       
   398      * Constructor.
       
   399      * @see CAlfVisualHandler::ConstructL()
       
   400      */    
       
   401     IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
       
   402 
       
   403 protected: // from CBase
       
   404     IMPORT_C ~CAlfCanvasVisualHandler();
       
   405 
       
   406 public: // From MAlfExtension
       
   407     IMPORT_C void Release();
       
   408     IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
       
   409     IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
       
   410 
       
   411 protected: // From CAlfVisualHandler
       
   412     IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   413 
       
   414 private:
       
   415     class TCanvasVisualHandlerPrivateData;
       
   416     TCanvasVisualHandlerPrivateData* iLineVisualPrivateData;    
       
   417     };
       
   418 
       
   419 #endif
       
   420