📄 mguardscsvr.h
字号:
/*
* ============================================================================
* Name : MGuardScSvr.h
* Part of : MGuardScSvr
* Created : 18.08.2007 by xueyw
* Description:
* Exe header file
* Version :
* Copyright:
* ============================================================================
*/
#ifndef __MGUARDSCSVR_H__
#define __MGUARDSCSVR_H__
// Include Files
#include <e32base.h>
#include "MGuardScSvr.pan"
#include "MGuardKeyCapture.h"
class CMGuardScSvr : public CServer
{
public : // Constructors and destructors
/**
* NewL.
* Two-phased constructor.
*/
static CMGuardScSvr* NewL();
/**
* NewLC.
* Two-phased constructor.
*/
static CMGuardScSvr* NewLC();
/**
* Destructor.
*/
virtual ~CMGuardScSvr();
public: // New functions
/**
* ThreadFunction.
* Main function for the server thread.
* @param aStarted A semaphore to be flagged when server
* has been started.
* @return Error code.
*/
static TInt ThreadFunction( TAny* aStarted );
void LockScreenL();
void UnlockScreenL();
/**
* IncrementSessions.
* Increments the count of the active sessions for this server.
*/
void IncrementSessions();
/**
* DecrementSessions.
* Decrements the count of the active sessions for this server.
* If no more sessions are in use the server terminates.
*/
void DecrementSessions();
protected: // Functions from base classes
/**
* From CActive, RunError.
* Processes any errors.
* @param aError The leave code reported.
* @result return KErrNone if leave is handled.
*/
TInt RunError( TInt aError );
private: // Constructors and destructors
/**
* C++ default constructor.
* @param aPriority priority for this thread.
*/
CMGuardScSvr( TInt aPriority );
/**
* ConstructL.
* 2nd phase constructor.
*/
void ConstructL();
private: // New methods
/**
* PanicClient.
* Panics the client.
* @param aMessage The message channel to the client.
* @param aReason The reason code for the panic.
*/
static void PanicClient( const RMessage& aMessage, TMGuardServPanic aReason );
/**
* PanicServer.
* Panics the server.
* @param aPanic The panic code.
*/
static void PanicServer( TMGuardServPanic aPanic );
/**
* ThreadFunctionL.
* Second stage startup for the server thread.
*/
static void ThreadFunctionL();
/**
* SendResultToSessions.
* Informs all the clients.
*/
void SendResultToSessions();
private: // Functions from base classes
/**
* From CServer, NewSessionL.
* @param aVersion The client version.
* @return Pointer to new session.
*/
CSharableSession* NewSessionL( const TVersion& aVersion ) const;
private: // Data
/**
* iSessionCount, the number of session owned by this server.
*/
TInt iSessionCount;
CGuardKeyCapturer* iCapture;
};
// Function Prototypes
GLDEF_C TInt E32Main();
#endif // __MGUARDSCSVR_H__
// End of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -