|         |      1 // Copyright (c) 2005-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 /** | 
|         |     17  @file | 
|         |     18  @test | 
|         |     19  @internalComponent - Internal Symbian test code  | 
|         |     20 */ | 
|         |     21  | 
|         |     22  | 
|         |     23 #ifndef __GRAPHICSTESTUTILSSERVER_H__ | 
|         |     24 #define __GRAPHICSTESTUTILSSERVER_H__ | 
|         |     25  | 
|         |     26 #include <e32base.h> | 
|         |     27 #include <f32file.h> | 
|         |     28  | 
|         |     29 enum TTestPanic | 
|         |     30 	{ | 
|         |     31 	ETestPanicBadDescriptor, | 
|         |     32 	ETestPanicIllegalFunction, | 
|         |     33 	ETestPanicAlreadyReceiving, | 
|         |     34 	ETestPanicAlreadyActive | 
|         |     35 	}; | 
|         |     36  | 
|         |     37 void PanicClient(RMessage2& aMessage,TTestPanic TMyPanic); | 
|         |     38  | 
|         |     39 class CShutdown : public CTimer | 
|         |     40 	{ | 
|         |     41 	enum {KMyShutdownDelay=0x200000};	// approx 2s | 
|         |     42 public: | 
|         |     43 	inline CShutdown(); | 
|         |     44 	inline void ConstructL(); | 
|         |     45 	inline void Start(); | 
|         |     46 private: | 
|         |     47 	void RunL(); | 
|         |     48 	}; | 
|         |     49  | 
|         |     50  | 
|         |     51 class CSmlTestUtilsServer : public CServer2 | 
|         |     52 	{ | 
|         |     53 public: | 
|         |     54 	static CServer2* NewLC(); | 
|         |     55 	void AddSession(); | 
|         |     56 	void DropSession(); | 
|         |     57 private: | 
|         |     58 	CSmlTestUtilsServer(); | 
|         |     59 	void ConstructL(); | 
|         |     60 	CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; | 
|         |     61 private: | 
|         |     62 	TInt iSessionCount; | 
|         |     63 	CShutdown iShutdown; | 
|         |     64 	}; | 
|         |     65  | 
|         |     66  | 
|         |     67 class CSmlTestUtilsSession : public CSession2 | 
|         |     68 	{ | 
|         |     69 public: | 
|         |     70 	CSmlTestUtilsSession(); | 
|         |     71 	void CreateL(); | 
|         |     72 private: | 
|         |     73 	~CSmlTestUtilsSession(); | 
|         |     74 	inline CSmlTestUtilsServer& Server(); | 
|         |     75 	void ServiceL(const RMessage2& aMessage); | 
|         |     76 	void ServiceError(const RMessage2& aMessage,TInt aError); | 
|         |     77 	inline TBool ReceivePending() const; | 
|         |     78 private: | 
|         |     79 	TInt DoCreateDirectoryL(const RMessage2& aMessage); | 
|         |     80 	TInt DoRenameDirectoryL(const RMessage2& aMessage); | 
|         |     81 	TInt DoDeleteDirectoryL(const RMessage2& aMessage); | 
|         |     82 	TInt DoCreateFileL(const RMessage2& aMessage); | 
|         |     83 	TInt DoDeleteFileL(const RMessage2& aMessage); | 
|         |     84 	TInt DoDeleteFileUsingWildcardL(const RMessage2& aMessage); | 
|         |     85 	TInt DoCopyFileL(const RMessage2& aMessage); | 
|         |     86 	TInt DoReplaceFileL(const RMessage2& aMessage); | 
|         |     87 	TInt DoIsFilePresentL(const RMessage2& aMessage); | 
|         |     88 	TInt DoSetReadOnlyL(const RMessage2& aMessage); | 
|         |     89 	TInt DoGetAttL( const RMessage2& aMessage ); | 
|         |     90 	TInt DoSetAttL( const RMessage2& aMessage );	 | 
|         |     91 	TInt DoCopyDirectoryL(const RMessage2& aMessage); | 
|         |     92 	TInt DoChangeFilePermissionL(const RMessage2& aMessage); | 
|         |     93  | 
|         |     94 private: | 
|         |     95 	RFs 				iFs; | 
|         |     96 	CFileMan* 			iFileMan;  | 
|         |     97 	}; | 
|         |     98  | 
|         |     99 #endif //__GRAPHICSTESTUTILSSERVER_H__ |