uifw/AknGlobalUI/AknCapServer/inc/AknCapServerEntry.h
changeset 0 2f259fa3e83a
child 15 08e69e956a8c
child 26 62ef28f7b435
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2005-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __AKNCAPSERVERENTRY__
       
    19 #define __AKNCAPSERVERENTRY__
       
    20 
       
    21 #include <AknNotiferAppServerApplication.h> // link against AknNotifierWrapper.lib
       
    22 #include <AknNotifierAppServer.h>
       
    23 #include <AknSgcc.h>
       
    24 #include <AknNotifierControllerPlugin.h>
       
    25 #include <akneiksrvc.h>
       
    26 #include <akndialogcontroller.h>
       
    27 #include <e32property.h>
       
    28 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    29 #include <centralrepository.h>
       
    30 #include <PtiDefs.h>
       
    31 #endif
       
    32 
       
    33 #include "AknEikSgcs.h"
       
    34 #include "AknNotiferAppServerApplicationInterface.h"
       
    35 #include "AknCapServerDefs.h"
       
    36 #include "aknblankwin.h"
       
    37 #include "AknFastswapWindowControl.h"
       
    38 #include "aknphonekeyforwarder.h"
       
    39   
       
    40 const TInt KAknInternalFSWClose(0);
       
    41 
       
    42 class CPtiEngine;
       
    43 class CAknCapServer;
       
    44 
       
    45 struct SSuppressInfo
       
    46     {
       
    47     SSuppressInfo(TInt aUid):iUid(aUid),iReferenceCount(0){}
       
    48     TInt iUid;
       
    49     TInt iReferenceCount;       
       
    50     };
       
    51 
       
    52 class CAknServKeyFilter;
       
    53 class CAknFastSwapWindowControl;
       
    54 class CAknMMCPasswordRequester;
       
    55 class CWindowChangeMonitor;
       
    56 class MAknMessageReaderLongPressDetector;
       
    57 class CAknCapAppServerAlternateFs;
       
    58 
       
    59 //----------------------------------
       
    60 // PubSub key listener.
       
    61 //----------------------------------
       
    62 NONSHARABLE_CLASS(CPropertySubscriber) : public CActive
       
    63     {
       
    64 public:
       
    65     CPropertySubscriber(TCallBack aCallBack, RProperty& aProperty);
       
    66     virtual ~CPropertySubscriber();
       
    67 
       
    68 public: // New functions
       
    69     void Subscribe();
       
    70     void StopSubscribe();
       
    71 
       
    72 private: // from CActive
       
    73     void RunL();
       
    74     void DoCancel();
       
    75 
       
    76 private:
       
    77     TCallBack   iCallBack;
       
    78     RProperty&  iProperty;
       
    79     };
       
    80 
       
    81 //----------------------------------
       
    82 // Application
       
    83 //----------------------------------
       
    84 class CAknCapServerApplication : public CAknNotifierAppServerApplication
       
    85     {
       
    86 public:
       
    87     CAknCapServerApplication();
       
    88     void NewAppServerL(CApaAppServer*& aAppServer);
       
    89     CApaDocument* CreateDocumentL();
       
    90     TUid AppDllUid() const 
       
    91         {
       
    92         return KAknCapServerUid;    
       
    93         }
       
    94     TFileName ResourceFileName() const
       
    95         {
       
    96         return KNullDesC();            
       
    97         }
       
    98     CAknCapServer* CapServer() const
       
    99         {
       
   100         return iCapServer;
       
   101         }
       
   102 private:
       
   103     CAknCapServer* iCapServer;
       
   104     };
       
   105 
       
   106 //----------------------------------
       
   107 // Document
       
   108 //----------------------------------
       
   109 class CAknCapAppServerDocument : public CAknDocument
       
   110     {
       
   111 public:
       
   112     CAknCapAppServerDocument(CEikApplication& aApp):CAknDocument(aApp), iApp(&aApp){};
       
   113 private: // from CAknDocument
       
   114     CEikAppUi* CreateAppUiL();
       
   115     CEikApplication* iApp;
       
   116     };
       
   117 
       
   118 //----------------------------------
       
   119 // AppUi
       
   120 //----------------------------------
       
   121 class CAknCapAppServerAppUi : 
       
   122     public CAknNotifierAppServerAppUi, 
       
   123     public MAknCapServerInterface,
       
   124     MAknAliasKeyCodeResolver, 
       
   125     MAknPhoneKeyForwarder
       
   126     {
       
   127 public:
       
   128     CAknCapAppServerAppUi( CAknCapServer* aCapServer );
       
   129     ~CAknCapAppServerAppUi();
       
   130     
       
   131 public: //from CAknNotifierAppServerAppUi
       
   132     void ConstructL();
       
   133     TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   134     
       
   135 public: // from CCoeAppUi
       
   136     void HandleResourceChangeL(TInt aType);
       
   137     
       
   138 private: // from CCoeAppUi
       
   139     void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
       
   140 
       
   141 public: // new methods  
       
   142 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   143     TBool IsCharacterCategoryNumber(TUint aChar) const;
       
   144 #endif
       
   145     void SuppressAppSwitchingL(TInt aAddCount, TInt aClientId);
       
   146     void KillAppL(const RMessage2& aMessage);
       
   147     void DoTaskListCommandL(const RMessage2& aMessage);
       
   148     void HideApplicationFromFswL(TInt aUid, TBool aHide);    
       
   149     TBool HiddenFromFSW( TInt aUid );
       
   150     TInt EnableTaskList(TBool aEnable);
       
   151     TBool HandleShortAppsKeyPressL(); // return true if event used
       
   152     TBool HandleLongAppsKeyPressL(); // "
       
   153     TBool IsAppsKeySuppressed();
       
   154     
       
   155     CAknMMCPasswordRequester* MMCUnlock()
       
   156         {
       
   157         return iMMCUnlock;
       
   158         } 
       
   159     
       
   160     CEikSgcServer* SgcServer()
       
   161         {
       
   162         return iSgcs; 
       
   163         }
       
   164         
       
   165     void SetStatusPaneFlags(TInt aFlags);   
       
   166     void SetStatusPaneLayoutL(TInt aLayoutResId);
       
   167     virtual void BlankScreenL(TBool aBlank, TBool aToForeground = EFalse);
       
   168     void SwapLayoutSwitchBlankScreenL();
       
   169     void SetCurrentAppStatuspaneResourceIdL(TInt aResourceId);
       
   170     TInt CurrentAppStatuspaneResourceIdL();
       
   171     virtual TBool IsDisplayingForegroundBlankScreen() const;
       
   172     void RotateScreenL();
       
   173     TInt UpdateTaskListL( TBool aTaskListRefreshNeeded );
       
   174     void SetFgSpDataSubscriberIdL(TInt aId);
       
   175     
       
   176     void CloseFSW();
       
   177     // set/get whether idle is active
       
   178     virtual void SetIdleActive( TBool bActive );
       
   179     virtual TBool IsIdelActive( );
       
   180     
       
   181     void SetIsShortTimeGlobalNoteDisplaying(TBool aShortTimeGlobalNoteDisplaying)
       
   182         {
       
   183         iShortTimeGlobalNoteDisplaying = aShortTimeGlobalNoteDisplaying;
       
   184         }
       
   185     
       
   186     TBool IsShortTimeGlobalNoteDisplaying()
       
   187         {
       
   188         return iShortTimeGlobalNoteDisplaying;
       
   189         }
       
   190     
       
   191 private:
       
   192     void PublishHiddenList();
       
   193     void PublishInstalledLanguagesL();
       
   194     static TInt GlobalNotesAllowedCallBack(TAny* aPtr);
       
   195     static TInt TelephonyIdleUidCallBack(TAny* aPtr);
       
   196     void HandlePropertyChange(const TInt aProperty);
       
   197     void ProcessInitFlipStatus();
       
   198     void InitiateOFNStatus();
       
   199     void LoadAlternateFsPlugin();
       
   200     void ShowOrDismissAlternateFs();
       
   201 
       
   202 public: 
       
   203     /**
       
   204      * From MAknAliasKeyCodeResolver.
       
   205      * Resolves keyboard layout dependent keycode for the given event.
       
   206      *
       
   207      * @since Series 60 3.1
       
   208      * @param aCode Reference to variable to contain new keycode. 
       
   209      * @param aKeyEvent Reference to original, complete, event.
       
   210      * @param aType Indicating original event type.
       
   211      * @return KErrNone on success, otherwise system wide error codes.
       
   212      */
       
   213     TInt GetAliasKeyCode(TUint& aCode, const TKeyEvent& aKeyEvent,TEventCode aType);        
       
   214     
       
   215 private:
       
   216     RArray<SSuppressInfo> iAppsKeyArray;
       
   217     CArrayFixFlat<TInt>* iHiddenList; 
       
   218     CAknServKeyFilter* iKeyCaptureControl;
       
   219     TBool iTaskListEnabled;
       
   220     CAknFastSwapWindowControl* iFSControl;
       
   221     TInt iResourceFileOffset; // for eiksrvui.rsc
       
   222     CAknMMCPasswordRequester* iMMCUnlock;
       
   223     CEikSgcServer* iSgcs;
       
   224     TInt iBlankWinRefCount;
       
   225     CAknServBlankWin* iBlankWin;
       
   226     RWindowGroup iBackdropWindowGroup;
       
   227     CEikServStatusPane* iStatusPane;
       
   228     TBool iForegroundBlankScreen;
       
   229     CAknCapServer* iCapServer;
       
   230     
       
   231     TBool iShortTimeGlobalNoteDisplaying;
       
   232     CAknCapAppServerAlternateFs* iAlternateFS;
       
   233 
       
   234 public: // startup scheduling  
       
   235     CIdle* iIdler;
       
   236     TBool iHasRunOnce;
       
   237     CPtiEngine* iPtiEngine;
       
   238     TBool iQwertyStatus;
       
   239 
       
   240 public:
       
   241     MAknKeyLockObserver* iGlobalNotesController;
       
   242     RAknEikAppUiSession iEikSrv;
       
   243 
       
   244 public:
       
   245     MAknMessageReaderLongPressDetector* iMessageReaderLongPressDetector;
       
   246     
       
   247 public: // phone key event forwarding 
       
   248     MAknPhoneKeyForwarder* AsKeyForwarder()
       
   249         {
       
   250         return this;
       
   251         }
       
   252    
       
   253     void ForwardKeyToPhoneAppL(const TKeyEvent& aKeyEvent);    
       
   254     void PhoneKeyUpReceived();
       
   255                
       
   256     TKeyEvent iPhoneKey;
       
   257     TInt iScanCodeCaptureHandle;
       
   258     TBool iUpReceived;
       
   259 
       
   260     /** Id of the client thread for global note cancelling. */
       
   261     TThreadId iClientId;
       
   262 
       
   263 private:
       
   264     RProperty iGlobalNotesAllowedProperty;
       
   265     CPropertySubscriber* iGlobalNotesAllowedSubscriber;
       
   266     
       
   267     RProperty iTelephonyIdleUidProperty;
       
   268     CPropertySubscriber* iTelephonyIdleUidSubscriber;
       
   269     TBool iIdleActive;
       
   270     };
       
   271 
       
   272 #endif // __AKNCAPSERVERENTRY__
       
   273 
       
   274 // End of file