uifw/AknGlobalUI/AknNfySrv/src/AknNfySrvUi.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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 *
       
    16 */
       
    17 
       
    18 #include <eikstart.h>
       
    19 #include <AknDef.h>
       
    20 #include <barsread.h>
       
    21 #include <bautils.h>
       
    22 #include <e32property.h>
       
    23 #include <UikonInternalPSKeys.h>    // KUikLayoutState
       
    24 #include <eikpriv.rsg>
       
    25 #include <coedef.h>
       
    26 #include <eiksvdef.h>
       
    27 #include <aknconsts.h>
       
    28 #include <AknsConstants.h>
       
    29 #include <apgwgnam.h>
       
    30 #include <akneiksrvs.h>
       
    31 #include <akneiksrvc.h>
       
    32 #include "AknNfySrvUi.h"
       
    33 #include "AknNfySrv.h"
       
    34 #include <AknWsEventObserver.h>
       
    35 
       
    36 
       
    37 class RAknEikSrvExtension: public RAknEikAppUiSession
       
    38     {
       
    39 public:
       
    40     void DoSignal()
       
    41         {
       
    42         SendReceive(EEikAppUiExtension, TIpcArgs(EAknCommonNotifierServerRunning, &KNullDesC8));
       
    43         }
       
    44     };
       
    45 
       
    46 
       
    47 CAknNfySrvApplication::CAknNfySrvApplication()
       
    48     {
       
    49     }
       
    50 
       
    51 void CAknNfySrvApplication::NewAppServerL(CApaAppServer*& aAppServer)
       
    52     {
       
    53     CAknNfySrv* server = new (ELeave) CAknNfySrv();
       
    54     server->SetPriority(EActivePriorityIpcEventsHigh);
       
    55     server->SetImplementationFinderL(server);
       
    56     aAppServer = &*server;
       
    57     }
       
    58     
       
    59 CApaDocument* CAknNfySrvApplication::CreateDocumentL()
       
    60     {
       
    61     return new (ELeave) CAknNfySrvDocument(*this);
       
    62     }
       
    63 
       
    64 CEikAppUi* CAknNfySrvDocument::CreateAppUiL()
       
    65     {
       
    66     return new (ELeave) CAknNfySrvAppUi();
       
    67     }
       
    68 
       
    69 CAknNfySrvAppUi::CAknNfySrvAppUi()
       
    70     {
       
    71     }
       
    72     
       
    73 CAknNfySrvAppUi::~CAknNfySrvAppUi()
       
    74     {
       
    75     }
       
    76 
       
    77 void CAknNfySrvAppUi::ConstructL()
       
    78     {
       
    79     // base call
       
    80     CAknNotifierAppServerAppUi::ConstructL();
       
    81     }
       
    82 
       
    83 TBool  CAknNfySrvAppUi::FrameworkCallsRendezvous() const
       
    84     {
       
    85     RWsSession& wsSession = iEikonEnv->WsSession();
       
    86 
       
    87     // To make sure that wserv does not change our priority even we lose foreground.
       
    88     wsSession.ComputeMode(RWsSession::EPriorityControlDisabled);
       
    89 
       
    90     // Boost our priority similar to eikon server 
       
    91     // as eikon server is synchronously dependent of us.
       
    92     
       
    93     RThread thread; 
       
    94 #if defined(__EPOC32__)
       
    95     thread.SetProcessPriority(EPriorityHigh);
       
    96 #else
       
    97     thread.SetPriority(EPriorityAbsoluteForeground);
       
    98 #endif
       
    99 
       
   100     RAknEikSrvExtension eiksrv;
       
   101     TInt err = eiksrv.Connect();
       
   102     if (err == KErrNone)
       
   103         {
       
   104         eiksrv.DoSignal();
       
   105         eiksrv.Close();     
       
   106         }
       
   107 
       
   108     return ETrue;
       
   109     }
       
   110 
       
   111 // actual entry point   
       
   112 LOCAL_C CApaApplication* NewApplication()
       
   113     {
       
   114     return new CAknNfySrvApplication();
       
   115     }   
       
   116     
       
   117 GLDEF_C TInt E32Main()
       
   118     {
       
   119     return EikStart::RunApplication(NewApplication);
       
   120     }
       
   121 
       
   122 // End of file