customization/UISettingsSrv/server/Src/UISettingsSrvUi.cpp
changeset 0 3ce708148e4d
child 55 c4687ff85147
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     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: 
       
    15 *        General Settings User Interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 //sf-#include    <bldvariant.hrh>
       
    22 #include    <eikapp.h>
       
    23 #include    <avkon.hrh>
       
    24 #include    <akncontext.h>
       
    25 #include    <aknnavi.h>
       
    26 #include    <aknnavide.h>
       
    27 #include    <akntabgrp.h>
       
    28 #include    <akntitle.h>
       
    29 #include    <aknnotedialog.h>
       
    30 #include    <AknWaitDialog.h>
       
    31 #include    <aknslider.h>
       
    32 #include    <AknQueryDialog.h>
       
    33 #include    <aknsettingpage.h>
       
    34 #include    <aknradiobuttonsettingpage.h>
       
    35 #include    <aknslidersettingpage.h>
       
    36 #include    <akntextsettingpage.h>
       
    37 #include    <AknDateFormatUtils.h>
       
    38 #include    <AknUtils.h>
       
    39 #include    <AknsConstants.h>    //for determining skin change
       
    40 #include    <barsread.h>
       
    41 #include    <hal.h>
       
    42 #include    <featmgr.h>
       
    43 
       
    44 
       
    45     #include    <e32property.h>
       
    46     #include    <PSVariables.h>
       
    47 
       
    48 
       
    49 #include    <aknnotewrappers.h>    // for reboot
       
    50 #include    <PtiEngine.h>
       
    51 
       
    52 #include    <AknFep.rsg>  
       
    53 #include    <avkon.rsg>
       
    54 #include    <e32std.h>             // The USER class
       
    55 #include    <AknFepGlobalEnums.h>  // EPinyin
       
    56 
       
    57 #include	<apgwgnam.h>
       
    58 
       
    59 #include    "UISettingsSrvUi.h"
       
    60 #include    "UISettingsSrvAppView.h"
       
    61 #include    "UISettingsSrvDocument.h"
       
    62 
       
    63 #include    <UISettingsSrv.rsg>
       
    64 #include    "UISettingsSrv.hrh"
       
    65 
       
    66 #include    "UISettingsSrv.h"
       
    67 
       
    68 //CONSTANTS
       
    69 // _LIT( KGSAppUiClassName, "CUISettingsSrvUi" );
       
    70 
       
    71 
       
    72 
       
    73 // ================= MEMBER FUNCTIONS =======================
       
    74 
       
    75 
       
    76 // ----------------------------------------------------
       
    77 // CUISettingsSrvUi::CUISettingsSrvUi()
       
    78 // 
       
    79 // Default constructor.
       
    80 // ----------------------------------------------------
       
    81 CUISettingsSrvUi::CUISettingsSrvUi()
       
    82 //sf-	: 
       
    83     {
       
    84     }
       
    85 
       
    86 // ----------------------------------------------------
       
    87 // CUISettingsSrvUi::ConstructL()
       
    88 // 
       
    89 // Symbian OS two-phased constructor
       
    90 // ----------------------------------------------------
       
    91 void CUISettingsSrvUi::ConstructL()
       
    92     {
       
    93     FeatureManager::InitializeLibL();
       
    94 
       
    95     BaseConstructL( 0 ); //sf- EAknEnableSkin );
       
    96 
       
    97 /*
       
    98 */
       
    99     iAppView = CUISettingsSrvAppView::NewL(ClientRect());
       
   100     AddToStackL(iAppView);
       
   101 /*
       
   102 */
       
   103 
       
   104 	// Hide application from task list
       
   105 	RWsSession& ws = iEikonEnv->WsSession();
       
   106     RWindowGroup& rootWin = iEikonEnv->RootWin();
       
   107     TInt wgId = rootWin.Identifier();
       
   108 
       
   109 	CApaWindowGroupName *windowGroupName =
       
   110 		CApaWindowGroupName::NewL(ws, wgId);
       
   111 
       
   112 	windowGroupName->SetHidden( ETrue );
       
   113 	windowGroupName->SetWindowGroupName( rootWin );
       
   114 
       
   115 	delete windowGroupName;
       
   116     }
       
   117 
       
   118 // ----------------------------------------------------
       
   119 // CUISettingsSrvUi::~CUISettingsSrvUi()
       
   120 // destructor
       
   121 // frees reserved resources
       
   122 // ----------------------------------------------------
       
   123 CUISettingsSrvUi::~CUISettingsSrvUi()
       
   124     {
       
   125 //sf-    delete iDecoratedTabGroup;
       
   126 //sf-    delete iDatimTitleText;
       
   127 //sf-    delete iWaitDialog;
       
   128 
       
   129     FeatureManager::UnInitializeLib();
       
   130 
       
   131     if (iAppView)
       
   132         {
       
   133         iEikonEnv->RemoveFromStack(iAppView);
       
   134         delete iAppView;
       
   135         iAppView = NULL;
       
   136         }
       
   137 
       
   138     //
       
   139 //sf-    delete iShortcutUi;
       
   140 
       
   141     //Embedding - removing created document
       
   142 /*sf--
       
   143     if ( iEmbedded )
       
   144 	    {
       
   145 	    iEikonEnv->Process()->DestroyDocument( iEmbedded );
       
   146 	    iEmbedded = NULL;
       
   147 	    }
       
   148 --fs*/
       
   149     }
       
   150 
       
   151 // ------------------------------------------------------------------------------
       
   152 // CUISettingsSrvUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
       
   153 //  This function is called by the EIKON framework just before it displays
       
   154 //  a menu pane. Its default implementation is empty, and by overriding it,
       
   155 //  the application can set the state of menu items dynamically according
       
   156 //  to the state of application data.
       
   157 // ------------------------------------------------------------------------------
       
   158 //
       
   159 void CUISettingsSrvUi::DynInitMenuPaneL(
       
   160     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
       
   161     {
       
   162     }
       
   163 
       
   164 // ----------------------------------------------------
       
   165 // CUISettingsSrvUi::HandleCommandL(TInt aCommand)
       
   166 // 
       
   167 // Handles commands directed to this class.
       
   168 // ----------------------------------------------------
       
   169 void CUISettingsSrvUi::HandleCommandL(TInt aCommand)
       
   170     {
       
   171     switch (aCommand)
       
   172         {
       
   173         case EEikCmdExit:   //both exit commands should do the same thing
       
   174             iEikonEnv->InfoMsg(_L("ex1"));
       
   175         case EAknCmdExit:
       
   176             iEikonEnv->InfoMsg(_L("exit2"));
       
   177             Exit();
       
   178             break;
       
   179         /*
       
   180         case EUISSCmdTest:
       
   181             iEikonEnv->InfoMsg(_L("...test..."));
       
   182             break;
       
   183         case EUISSCmdTest2:           
       
   184             _LIT(message,"Halloo");
       
   185             CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
       
   186             informationNote->ExecuteLD(message);
       
   187             break;
       
   188         */
       
   189         case EUISSCmdStartSrv:
       
   190         	CUISettingsSrvServer::NewL();
       
   191             break;
       
   192         default:
       
   193             CAknAppUi::HandleCommandL(aCommand);
       
   194 //sf-            CAknViewAppUi::HandleCommandL(aCommand);
       
   195             break;
       
   196         }
       
   197     }
       
   198 
       
   199 
       
   200 
       
   201 // ----------------------------------------------------
       
   202 // CUISettingsSrvUi::HandleKeyEventL()
       
   203 // 
       
   204 // Called when a key is pressed and no other class has catched the event.
       
   205 // Handles only key events that are meant to control the tab group. 
       
   206 // ----------------------------------------------------
       
   207 TKeyResponse CUISettingsSrvUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
       
   208     {
       
   209     return EKeyWasNotConsumed;
       
   210 /*sf--
       
   211     // Check if the event should be handled
       
   212     if (aType != EEventKey ||  iNaviContainer->Top() != iDecoratedTabGroup)
       
   213         {
       
   214         return EKeyWasNotConsumed;
       
   215         }
       
   216     return iTabGroup->OfferKeyEventL( aKeyEvent, aType );
       
   217 --fs*/
       
   218     }
       
   219 
       
   220 
       
   221 
       
   222 //End of File