idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp
branchRCL_3
changeset 34 5456b4e8b3a8
child 35 3321d3e205b6
equal deleted inserted replaced
33:5f0182e07bfb 34:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  UI Engine class
       
    15 *
       
    16 */
       
    17 
       
    18 // User includes
       
    19 #include "xnuiengine.h"
       
    20 #include "xnuienginepluginif.h"
       
    21 #include "xnuiengineappif.h"
       
    22 #include "xnuiengineimpl.h"
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CXnUiEngine::CXnUiEngine
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CXnUiEngine::CXnUiEngine()
       
    33     {
       
    34     }
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CXnUiEngine::ConstructL
       
    38 // Symbian 2nd phase constructor can leave
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 void CXnUiEngine::ConstructL( CXnAppUiAdapter& aAdapter )
       
    42     {
       
    43     iUiEngineImpl = CXnUiEngineImpl::NewL( *this, aAdapter );
       
    44 
       
    45     iUiEngineImpl->ConstructL();
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CXnUiEngine::NewL
       
    50 // Two-phased constructor
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 CXnUiEngine* CXnUiEngine::NewL( CXnAppUiAdapter& aAdapter )
       
    54     {
       
    55     CXnUiEngine* self = new ( ELeave ) CXnUiEngine;
       
    56 
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL( aAdapter );
       
    59     CleanupStack::Pop();
       
    60 
       
    61     return self;
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CXnUiEngine::~CXnUiEngine
       
    66 // Destructor
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 CXnUiEngine::~CXnUiEngine()
       
    70     {
       
    71     delete iUiEngineImpl;
       
    72     delete iPluginIf;
       
    73     delete iAppIf;
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CXnUiEngine::AppUiAdapter
       
    78 // Forwards the call to the ui engine implementation
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 CXnAppUiAdapter& CXnUiEngine::AppUiAdapter() const
       
    82     {
       
    83     return iUiEngineImpl->AppUiAdapter();
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CXnUiEngine::RootNode
       
    88 // Forwards the call to the ui engine implementation
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CXnNode* CXnUiEngine::RootNode()
       
    92     {
       
    93     return iUiEngineImpl->RootNode();
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CXnUiEngine::FindNodeByIdL
       
    98 // Forwards the call to the ui engine implementation
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CXnNode* CXnUiEngine::FindNodeByIdL(
       
   102         const TDesC& aAreaId, const TDesC& aNamespace )
       
   103     {
       
   104     return iUiEngineImpl->FindNodeByIdL( aAreaId, aNamespace );
       
   105     }
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // CXnUiEngine::FindNodeByIdL
       
   109 // Forwards the call to the ui engine implementation
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 CXnNode* CXnUiEngine::FindNodeByIdL(
       
   113         const TDesC8& aAreaId, const TDesC8& aNamespace )
       
   114     {
       
   115     return iUiEngineImpl->FindNodeByIdL( aAreaId, aNamespace );
       
   116     }
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CXnUiEngine::FindNodeByClassL
       
   120 // Forwards the call to the ui engine implementation
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 CXnPointerArray* CXnUiEngine::FindNodeByClassL( const TDesC& aClassId,
       
   124     const TDesC& aNamespace )
       
   125     {
       
   126     return iUiEngineImpl->FindNodeByClassL( aClassId, aNamespace );
       
   127     }
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CXnUiEngine::FindNodeByClassL
       
   131 // Forwards the call to the ui engine implementation
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 CXnPointerArray* CXnUiEngine::FindNodeByClassL( const TDesC8& aClassId,
       
   135     const TDesC8& aNamespace )
       
   136     {
       
   137     return iUiEngineImpl->FindNodeByClassL( aClassId, aNamespace );
       
   138     }
       
   139 
       
   140 // -----------------------------------------------------------------------------
       
   141 // CXnUiEngine::FindContentSourceNodesL
       
   142 // Forwards the call to the ui engine implementation
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 CXnPointerArray* CXnUiEngine::FindContentSourceNodesL(
       
   146     const TDesC8& aNamespace )
       
   147     {
       
   148     return iUiEngineImpl->FindContentSourceNodesL( aNamespace );
       
   149     }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CXnUiEngine::RenderUIL
       
   153 // Forwards the call to the ui engine implementation
       
   154 // -----------------------------------------------------------------------------
       
   155 //
       
   156 void CXnUiEngine::RenderUIL( CXnNode* aNode )
       
   157     {
       
   158     iUiEngineImpl->LayoutUIL( aNode );
       
   159     iUiEngineImpl->RenderUIL( aNode );
       
   160     }
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CXnUiEngine::LayoutUIL
       
   164 // Forwards the call to the ui engine implementation
       
   165 // -----------------------------------------------------------------------------
       
   166 //
       
   167 void CXnUiEngine::LayoutUIL( CXnNode* aNode )
       
   168     {
       
   169     iUiEngineImpl->LayoutUIL( aNode );
       
   170     }
       
   171 
       
   172 // -----------------------------------------------------------------------------
       
   173 // CXnUiEngine::Resources
       
   174 // Forwards the call to the ui engine implementation
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 CArrayPtrSeg< CXnResource >& CXnUiEngine::Resources()
       
   178     {
       
   179     return iUiEngineImpl->Resources();
       
   180     }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CXnUiEngine::SetFocusedNodeL
       
   184 // Forwards the call to the ui engine implementation
       
   185 // -----------------------------------------------------------------------------
       
   186 //
       
   187 void CXnUiEngine::SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource )
       
   188     {
       
   189     iUiEngineImpl->SetFocusedNodeL( aFocusedNode, aSource );
       
   190     }
       
   191 
       
   192 // -----------------------------------------------------------------------------
       
   193 // CXnUiEngine::FocusedNode
       
   194 // Forwards the call to the ui engine implementation
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 CXnNode* CXnUiEngine::FocusedNode()
       
   198     {
       
   199     return iUiEngineImpl->FocusedNode();
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CXnUiEngine::IsEditMode
       
   204 // Returns ETrue if the current mode is edit, otherwise EFalse.
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 TBool CXnUiEngine::IsEditMode()
       
   208     {
       
   209     return iUiEngineImpl->IsEditMode();
       
   210     }
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // CXnUiEngine::ODT
       
   214 // Forwards the call to the ui engine implementation
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 CXnODT* CXnUiEngine::ODT()
       
   218     {
       
   219     return iUiEngineImpl->ODT();
       
   220     }
       
   221 
       
   222 // -----------------------------------------------------------------------------
       
   223 // CXnUiEngine::VerticalPixelValueL
       
   224 // Forwards the call to the ui engine implementation
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 TInt CXnUiEngine::VerticalPixelValueL(
       
   228         CXnProperty* aValue, TInt aReferenceValue )
       
   229     {
       
   230     return iUiEngineImpl->VerticalPixelValueL( aValue, aReferenceValue );
       
   231     }
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // CXnUiEngine::HorizontalPixelValueL
       
   235 // Forwards the call to the ui engine implementation
       
   236 // -----------------------------------------------------------------------------
       
   237 //
       
   238 TInt CXnUiEngine::HorizontalPixelValueL(
       
   239         CXnProperty* aValue, TInt aReferenceValue )
       
   240     {
       
   241     return iUiEngineImpl->HorizontalPixelValueL( aValue, aReferenceValue );
       
   242     }
       
   243 
       
   244 // -----------------------------------------------------------------------------
       
   245 // CXnUiEngine::VerticalTwipValueL
       
   246 // Forwards the call to the ui engine implementation
       
   247 // -----------------------------------------------------------------------------
       
   248 //
       
   249 TInt CXnUiEngine::VerticalTwipValueL(
       
   250         CXnProperty* aValue, TInt aReferenceValue )
       
   251     {
       
   252     return iUiEngineImpl->VerticalTwipValueL( aValue, aReferenceValue );
       
   253     }
       
   254 
       
   255 // -----------------------------------------------------------------------------
       
   256 // CXnUiEngine::HorizontalTwipValueL
       
   257 // Forwards the call to the ui engine implementation
       
   258 // -----------------------------------------------------------------------------
       
   259 //
       
   260 TInt CXnUiEngine::HorizontalTwipValueL(
       
   261         CXnProperty* aValue, TInt aReferenceValue )
       
   262     {
       
   263     return iUiEngineImpl->HorizontalTwipValueL( aValue, aReferenceValue );
       
   264     }
       
   265 
       
   266 // -----------------------------------------------------------------------------
       
   267 // CXnUiEngine::ViewManager
       
   268 // -----------------------------------------------------------------------------
       
   269 //
       
   270 CXnViewManager* CXnUiEngine::ViewManager()
       
   271     {
       
   272     return iUiEngineImpl->ViewManager();
       
   273     }
       
   274 
       
   275 // -----------------------------------------------------------------------------
       
   276 // CXnUiEngine::ActiveView
       
   277 // Returns the active view
       
   278 // -----------------------------------------------------------------------------
       
   279 //
       
   280 CXnNode* CXnUiEngine::ActiveView()
       
   281     {
       
   282     return iUiEngineImpl->ActiveView();
       
   283     }
       
   284 
       
   285 // -----------------------------------------------------------------------------
       
   286 // CXnUiEngine::RefreshMenuL
       
   287 // Refresh current menu
       
   288 // -----------------------------------------------------------------------------
       
   289 //
       
   290 void CXnUiEngine::RefreshMenuL()
       
   291     {
       
   292     iUiEngineImpl->RefreshMenuL();
       
   293     }
       
   294 
       
   295 // -----------------------------------------------------------------------------
       
   296 // CXnUiEngine::AddDirtyNodeL
       
   297 // Add a dirty node
       
   298 // -----------------------------------------------------------------------------
       
   299 //
       
   300 void CXnUiEngine::AddDirtyNodeL( CXnNode* aNode, TInt aLevel )
       
   301     {
       
   302     iUiEngineImpl->AddDirtyNodeL( aNode, aLevel );
       
   303     }
       
   304 
       
   305 // -----------------------------------------------------------------------------
       
   306 // CXnUiEngine::PluginIfL
       
   307 // Get plugin interface
       
   308 // -----------------------------------------------------------------------------
       
   309 //
       
   310 TXnUiEnginePluginIf& CXnUiEngine::PluginIfL()
       
   311     {
       
   312     if ( iPluginIf )
       
   313         {
       
   314         return *iPluginIf;
       
   315         }
       
   316     else
       
   317         {
       
   318         iPluginIf = new ( ELeave ) TXnUiEnginePluginIf( *this );
       
   319         return *iPluginIf;
       
   320         }
       
   321     }
       
   322 
       
   323 // -----------------------------------------------------------------------------
       
   324 // CXnUiEngine::AppIfL
       
   325 // Get application interface
       
   326 // -----------------------------------------------------------------------------
       
   327 //
       
   328 TXnUiEngineAppIf& CXnUiEngine::AppIfL()
       
   329     {
       
   330     if ( iAppIf )
       
   331         {
       
   332         return *iAppIf;
       
   333         }
       
   334     else
       
   335         {
       
   336         iAppIf = new ( ELeave ) TXnUiEngineAppIf( *this );
       
   337         return *iAppIf;
       
   338         }
       
   339     }
       
   340 
       
   341 // -----------------------------------------------------------------------------
       
   342 // CXnUiEngine::ScreenDeviceSize
       
   343 // Get the size of the current screen device
       
   344 // -----------------------------------------------------------------------------
       
   345 //
       
   346 TSize CXnUiEngine::ScreenDeviceSize() const
       
   347     {
       
   348     return iUiEngineImpl->ScreenDeviceSize();        
       
   349     }
       
   350 
       
   351 // -----------------------------------------------------------------------------
       
   352 // CXnUiEngine::IsDialogDisplaying
       
   353 // Checks whether the dialog is displaying or not
       
   354 // -----------------------------------------------------------------------------
       
   355 //
       
   356 TBool CXnUiEngine::IsDialogDisplaying()
       
   357     {
       
   358     return iUiEngineImpl->IsDialogDisplaying();
       
   359     }
       
   360 
       
   361 // -----------------------------------------------------------------------------
       
   362 // CXnUiEngine::IsMenuDisplaying
       
   363 // Checks whether the menu is displaying or not
       
   364 // -----------------------------------------------------------------------------
       
   365 //
       
   366 TBool CXnUiEngine::IsMenuDisplaying()
       
   367     {
       
   368     return iUiEngineImpl->IsMenuDisplaying();
       
   369     }
       
   370 
       
   371 // -----------------------------------------------------------------------------
       
   372 // CXnUiEngine::MenuBarNode
       
   373 // Returns menubar node
       
   374 // -----------------------------------------------------------------------------
       
   375 //
       
   376 CXnNode* CXnUiEngine::MenuBarNode() const
       
   377     {
       
   378     return iUiEngineImpl->MenuBarNode();
       
   379     }
       
   380 
       
   381 // -----------------------------------------------------------------------------
       
   382 // CXnUiEngine::StylusPopupNode
       
   383 // Returns stylus popup node
       
   384 // -----------------------------------------------------------------------------
       
   385 //
       
   386 CXnNode* CXnUiEngine::StylusPopupNode() const
       
   387     {
       
   388     return iUiEngineImpl->StylusPopupNode();
       
   389     }
       
   390 
       
   391 // -----------------------------------------------------------------------------
       
   392 // CXnUiEngine::AddPassiveFocusedNode
       
   393 // -----------------------------------------------------------------------------
       
   394 //
       
   395 void CXnUiEngine::AddPassiveFocusedNodeL( CXnNode* aNode )
       
   396     {
       
   397     iUiEngineImpl->AddPassiveFocusedNodeL( aNode );
       
   398     }
       
   399 
       
   400 // -----------------------------------------------------------------------------
       
   401 // CXnUiEngine::RemovePassiveFocusedNode
       
   402 // -----------------------------------------------------------------------------
       
   403 //
       
   404 void CXnUiEngine::RemovePassiveFocusedNodeL( CXnNode* aNode )
       
   405     {
       
   406     iUiEngineImpl->RemovePassiveFocusedNodeL( aNode );
       
   407     }
       
   408 
       
   409 // -----------------------------------------------------------------------------
       
   410 // CXnUiEngine::AddPassiveFocusedNode
       
   411 // -----------------------------------------------------------------------------
       
   412 //
       
   413 void CXnUiEngine::ClearPassiveFocusedNodesL()
       
   414     {
       
   415     iUiEngineImpl->ClearPassiveFocusedNodesL();
       
   416     }
       
   417 
       
   418 // -----------------------------------------------------------------------------
       
   419 // CXnUiEngine::SetClientRectL
       
   420 // -----------------------------------------------------------------------------
       
   421 //
       
   422 void CXnUiEngine::SetClientRectL( TRect aRect, TBool aDrawNow )
       
   423     {
       
   424     return iUiEngineImpl->SetClientRectL( aRect, aDrawNow );
       
   425     }
       
   426 
       
   427 // -----------------------------------------------------------------------------
       
   428 // CXnUiEngine::ClientRect
       
   429 // -----------------------------------------------------------------------------
       
   430 //
       
   431 TRect CXnUiEngine::ClientRect() const
       
   432     {
       
   433     return iUiEngineImpl->ClientRect();
       
   434     } 
       
   435 
       
   436 // -----------------------------------------------------------------------------
       
   437 // CXnUiEngine::SetNodeDroppedL
       
   438 // -----------------------------------------------------------------------------
       
   439 //
       
   440 void CXnUiEngine::SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const
       
   441     {
       
   442     iUiEngineImpl->SetNodeDroppedL( aNode, aDropped );
       
   443     }
       
   444 
       
   445 // -----------------------------------------------------------------------------
       
   446 // CXnUiEngine::CheckAdaptiveContentL
       
   447 // -----------------------------------------------------------------------------
       
   448 //
       
   449 void CXnUiEngine::CheckAdaptiveContentL(
       
   450     CXnNode& aNode, TSize aAvailableSize ) const
       
   451     {
       
   452     iUiEngineImpl->CheckAdaptiveContentL( aNode, aAvailableSize );
       
   453     }
       
   454 
       
   455 // -----------------------------------------------------------------------------
       
   456 // CXnUiEngine::AddFocusCandidateL
       
   457 // -----------------------------------------------------------------------------
       
   458 //
       
   459 void CXnUiEngine::AddFocusCandidateL( CXnNode* aNode )
       
   460     {
       
   461     iUiEngineImpl->AddFocusCandidateL( aNode );
       
   462     }
       
   463 
       
   464 // -----------------------------------------------------------------------------
       
   465 // CXnUiEngine::Editor
       
   466 // -----------------------------------------------------------------------------
       
   467 //
       
   468 CXnEditor* CXnUiEngine::Editor() const
       
   469     {
       
   470     return iUiEngineImpl->Editor();
       
   471     }
       
   472 
       
   473 // -----------------------------------------------------------------------------
       
   474 // CXnUiEngine::EditMode
       
   475 // -----------------------------------------------------------------------------
       
   476 //
       
   477 CXnEditMode* CXnUiEngine::EditMode()
       
   478     {
       
   479     return iUiEngineImpl->EditMode();
       
   480     }
       
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 // CXnUiEngine::Plugins
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 RPointerArray< CXnNode >* CXnUiEngine::Plugins()
       
   487     {
       
   488     return iUiEngineImpl->Plugins();
       
   489     }
       
   490 
       
   491 // -----------------------------------------------------------------------------
       
   492 // CXnUiEngine::GetThemeResource
       
   493 // -----------------------------------------------------------------------------
       
   494 //
       
   495 TInt CXnUiEngine::GetThemeResource( const TDesC& aPath, RFile& aFile )
       
   496     {
       
   497     return iUiEngineImpl->GetThemeResource( aPath, aFile );
       
   498     }
       
   499 
       
   500 // -----------------------------------------------------------------------------
       
   501 // CXnUiEngine::AnalyseAddedWidgetL
       
   502 // -----------------------------------------------------------------------------
       
   503 //
       
   504 TBool CXnUiEngine::AnalyseAddedWidgetL( CXnNode& aNode )
       
   505     {
       
   506     return iUiEngineImpl->AnalyseAddedWidgetL( aNode );
       
   507     }
       
   508 
       
   509 // -----------------------------------------------------------------------------
       
   510 // -----------------------------------------------------------------------------
       
   511 //               
       
   512 void CXnUiEngine::DisableRenderUiLC()
       
   513     {
       
   514     iUiEngineImpl->DisableRenderUiLC();
       
   515     }
       
   516 
       
   517 // -----------------------------------------------------------------------------
       
   518 // -----------------------------------------------------------------------------
       
   519 //               
       
   520 void CXnUiEngine::SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher )
       
   521     {
       
   522     iUiEngineImpl->SetEventDispatcher( aDispatcher );
       
   523     }
       
   524 
       
   525 // -----------------------------------------------------------------------------
       
   526 // CXnUiEngine::EnablePartialTouchInput()
       
   527 // -----------------------------------------------------------------------------
       
   528 //               
       
   529 void CXnUiEngine::EnablePartialTouchInput( CXnNode& aNode, TBool aEnable )
       
   530     {
       
   531     iUiEngineImpl->EnablePartialTouchInput(aNode, aEnable);
       
   532     }
       
   533 
       
   534 // -----------------------------------------------------------------------------
       
   535 // CXnUiEngine::isPartialInputActive()
       
   536 // -----------------------------------------------------------------------------
       
   537 //               
       
   538 TBool CXnUiEngine::IsPartialInputActive()
       
   539     {
       
   540     return iUiEngineImpl->IsPartialInputActive();
       
   541     }
       
   542 
       
   543 // -----------------------------------------------------------------------------
       
   544 // CXnUiEngine::IsTextEditorActive()
       
   545 // -----------------------------------------------------------------------------
       
   546 //               
       
   547 TBool CXnUiEngine::IsTextEditorActive()
       
   548     {
       
   549     return iUiEngineImpl->IsTextEditorActive();
       
   550     }
       
   551 
       
   552 #ifndef EKA2
       
   553 GLDEF_C TInt  E32Dll( TDllReason )
       
   554     {
       
   555     return KErrNone;
       
   556     }
       
   557 #endif