appfw/apparchitecture/tef/TSidChecker/TestSidChecker.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-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 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    21 #include "apsidcheckermap.h"
       
    22 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
       
    23 #include <e32property.h>
       
    24 
       
    25 const TUid  KApFileTestAppType              = {0x10281FDB};
       
    26 const TUid  KApFileTestBadApp               = {0x10281FDC};
       
    27 const TUid  KApFileTestGoodApp              = {0x10281FDD};
       
    28 const TUid  KApFileTestAppTypeSidChecker    = {0x10281FDE};
       
    29 const TUid  KApFileTestAppTypeSidCheckerDll = {0x10281FDF};
       
    30 const TUid  KApFileTestPubSubCategory       = {0x101F289C}; // apparc test server sid
       
    31 const TUid  KApFileTestCallBackApp          = {0x10281FE0};
       
    32 const TUid	KApFileTestForcedRegistration	= {0x102825B5};
       
    33 const TUid	KApTriggerRescan				= {0x102825B6};
       
    34 // randomly picked, to try to avoid anything else in the apparctestserver using pub/sub
       
    35 const TUint KApFileTestPubSubCallBackKey    =  0x0000d3f9;
       
    36 const TUid KApFileTestAppWithMultipleRegistrationFiles    = {0xA000D107};
       
    37 
       
    38 class CApFileTestPropertyMonitor;
       
    39 class CApFileTestOneShotTimer;
       
    40 
       
    41 NONSHARABLE_CLASS(CTestSidChecker) : public CAppSidChecker
       
    42 /** Test Sid checker.
       
    43 
       
    44 This is an implementation of CAppSidChecker for checking native application Sids
       
    45 
       
    46 This instance of the CAppSidChecker is used to verify that a native application
       
    47 installed and can be launched.
       
    48 
       
    49 @internalComponent */
       
    50 	{
       
    51 public:
       
    52 	enum TPropertyValue
       
    53 		{
       
    54 		EPropertyDefault,
       
    55 		EPluginLoad,
       
    56 		ETriggerScan,
       
    57 		EScanOccurred,
       
    58 		ETimedOut,
       
    59 		EOtherError,
       
    60 		ECheckedOnce,
       
    61 		ECheckedTwice,
       
    62 		ECheckedThrice
       
    63 		};
       
    64 	static CTestSidChecker* NewL();
       
    65 	~CTestSidChecker();
       
    66 
       
    67 public:
       
    68 	virtual TBool AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive);
       
    69 	virtual void SetRescanCallBackL(const TCallBack &aCallback);
       
    70 
       
    71 private:
       
    72 	CTestSidChecker();
       
    73 	void CallBackAppChecked();
       
    74 	void AppWithMultipleRegistrationFilesChecked();
       
    75 	static TInt PropertyEventCallBack(TAny* aSelf);
       
    76 	TInt PropertyEvent();
       
    77 	static TInt TimerEventCallBack(TAny* aSelf);
       
    78 	TInt TimerEvent();
       
    79 	void Error(TRefByValue<const TDesC> aFmt, TInt aValue);
       
    80 
       
    81 private:
       
    82 	enum TState
       
    83 		{
       
    84 		ENotStarted,
       
    85 		EMonitorStarted,
       
    86 		EScanStarted,
       
    87 		EAppChecked,
       
    88 		ECallBackTestError
       
    89 		};
       
    90 	TCallBack iRescanCallBack;
       
    91 	CApFileTestPropertyMonitor* iMonitor;
       
    92 	CApFileTestOneShotTimer* iTimer;
       
    93 	TState iState;
       
    94 	TBool iRescanTriggered;
       
    95 	};
       
    96 
       
    97 #endif
       
    98