localisation/apparchitecture/tef/TSidChecker/TestSidChecker.h
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __TESTSIDCHECKER_H__
       
    17 #define __TESTSIDCHECKER_H__
       
    18 
       
    19 #include <ApSidChecker.h>
       
    20 #include <e32property.h>
       
    21 
       
    22 const TUid  KApFileTestAppType              = {0x10281FDB};
       
    23 const TUid  KApFileTestBadApp               = {0x10281FDC};
       
    24 const TUid  KApFileTestGoodApp              = {0x10281FDD};
       
    25 const TUid  KApFileTestAppTypeSidChecker    = {0x10281FDE};
       
    26 const TUid  KApFileTestAppTypeSidCheckerDll = {0x10281FDF};
       
    27 const TUid  KApFileTestPubSubCategory       = {0x101F289C}; // apparc test server sid
       
    28 const TUid  KApFileTestCallBackApp          = {0x10281FE0};
       
    29 const TUid	KApFileTestForcedRegistration	= {0x102825B5};
       
    30 const TUid	KApTriggerRescan				= {0x102825B6};
       
    31 // randomly picked, to try to avoid anything else in the apparctestserver using pub/sub
       
    32 const TUint KApFileTestPubSubCallBackKey    =  0x0000d3f9;
       
    33 const TUid KApFileTestAppWithMultipleRegistrationFiles    = {0xA000D107};
       
    34 
       
    35 class CApFileTestPropertyMonitor;
       
    36 class CApFileTestOneShotTimer;
       
    37 
       
    38 NONSHARABLE_CLASS(CTestSidChecker) : public CAppSidChecker
       
    39 /** Test Sid checker.
       
    40 
       
    41 This is an implementation of CAppSidChecker for checking native application Sids
       
    42 
       
    43 This instance of the CAppSidChecker is used to verify that a native application
       
    44 installed and can be launched.
       
    45 
       
    46 @internalComponent */
       
    47 	{
       
    48 public:
       
    49 	enum TPropertyValue
       
    50 		{
       
    51 		EPropertyDefault,
       
    52 		EPluginLoad,
       
    53 		ETriggerScan,
       
    54 		EScanOccurred,
       
    55 		ETimedOut,
       
    56 		EOtherError,
       
    57 		ECheckedOnce,
       
    58 		ECheckedTwice,
       
    59 		ECheckedThrice
       
    60 		};
       
    61 	static CTestSidChecker* NewL();
       
    62 	~CTestSidChecker();
       
    63 
       
    64 public:
       
    65 	virtual TBool AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive);
       
    66 	virtual void SetRescanCallBackL(const TCallBack &aCallback);
       
    67 
       
    68 private:
       
    69 	CTestSidChecker();
       
    70 	void CallBackAppChecked();
       
    71 	void AppWithMultipleRegistrationFilesChecked();
       
    72 	static TInt PropertyEventCallBack(TAny* aSelf);
       
    73 	TInt PropertyEvent();
       
    74 	static TInt TimerEventCallBack(TAny* aSelf);
       
    75 	TInt TimerEvent();
       
    76 	void Error(TRefByValue<const TDesC> aFmt, TInt aValue);
       
    77 
       
    78 private:
       
    79 	enum TState
       
    80 		{
       
    81 		ENotStarted,
       
    82 		EMonitorStarted,
       
    83 		EScanStarted,
       
    84 		EAppChecked,
       
    85 		ECallBackTestError
       
    86 		};
       
    87 	TCallBack iRescanCallBack;
       
    88 	CApFileTestPropertyMonitor* iMonitor;
       
    89 	CApFileTestOneShotTimer* iTimer;
       
    90 	TState iState;
       
    91 	TBool iRescanTriggered;
       
    92 	};
       
    93 
       
    94 #endif