localisation/apparchitecture/inc/ApaServerApp.h
branchSymbian3
changeset 57 b8d18c84f71c
parent 6 c108117318cb
--- a/localisation/apparchitecture/inc/ApaServerApp.h	Wed Jul 28 16:03:37 2010 +0100
+++ b/localisation/apparchitecture/inc/ApaServerApp.h	Tue Aug 03 10:20:34 2010 +0100
@@ -1,7 +1,7 @@
 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
+// under the terms of "Eclipse Public License v1.0"
 // which accompanies this distribution, and is available
 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 //
@@ -11,21 +11,15 @@
 // Contributors:
 //
 // Description:
+// apaserverapp.h
 //
 
-#ifndef APASERVERAPP_H
-#define APASERVERAPP_H
+#ifndef APASERVERAPP_H__
+#define APASERVERAPP_H__
 
-#include <e32base.h>
+#include <e32base.h>	// class RSessionBase
 
 
-//
-// Server application client support
-//
-
-
-
-class RApaAppServiceBase : public RSessionBase
 /** Server app connection and lifetime monitoring functionality.
 
 This is the base class for all server application service client
@@ -40,9 +34,9 @@
 @publishedPartner
 @released
 @see REikAppServiceBase */
+class RApaAppServiceBase : public RSessionBase
 	{
 public:
-
 	/** Constants defining the base IPC command ids usable by the system GUI and services. */
 	enum TApaAppServiceBaseCmdConstants
 		{
@@ -51,7 +45,6 @@
 		/** Service specific command IDs must start from this base. */
 		KServiceCmdBase = 0x200
 		};
-
 public:
 	IMPORT_C void ConnectExistingAppL(const RApaAppServiceBase& aClient);
 	IMPORT_C void ConnectExistingAppL(const RApaAppServiceBase& aClient, const TSecurityPolicy& aSecurityPolicy);
@@ -64,10 +57,8 @@
 	IMPORT_C void CancelNotifyServerExit() const;
 	
 	IMPORT_C TPtrC ServerName() const;
-
 protected:
 	IMPORT_C RApaAppServiceBase();
-
 private:
 	IMPORT_C virtual void RApaAppServiceBase_Reserved1();
 	IMPORT_C virtual void RApaAppServiceBase_Reserved2();
@@ -77,14 +68,11 @@
 	the UID for the service that they implement.
 	@return The UID of the service implemented by the derived class.*/
 	virtual TUid ServiceUid() const = 0;
-
 private:
 	void ConnectL();
 	void ConnectL(const TSecurityPolicy& aSecurityPolicy);
-
 private:
 	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
-	
 private:
 	HBufC* iServerName;		// owned
 	TInt iApaReserved1;
@@ -92,13 +80,13 @@
 	};
 
 
-class MApaServerAppExitObserver
 /** Interface for a class that wants to receive exit notification from
 a server application.
 
 @publishedPartner
 @released
 @see CApaServerAppExitMonitor*/
+class MApaServerAppExitObserver
 	{
 public:
 	/** Receives server exit notification.
@@ -118,7 +106,6 @@
 	};
 
 
-class CApaServerAppExitMonitor : public CActive
 /** Helper class that monitors the lifetime of a server app
 through a connected RApaAppServiceBase and reports server app exits
 to a MApaServerAppExitObserver derived class.
@@ -127,20 +114,18 @@
 @released
 @see RApaAppServiceBase
 @see MApaServerAppExitObserver */
+NONSHARABLE_CLASS(CApaServerAppExitMonitor) : public CActive
 	{
 public:
 	IMPORT_C static CApaServerAppExitMonitor* NewL(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
 	IMPORT_C static CApaServerAppExitMonitor* NewLC(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
 	IMPORT_C ~CApaServerAppExitMonitor();
-
 private:
 	CApaServerAppExitMonitor(RApaAppServiceBase& aClient, MApaServerAppExitObserver& aObserver, TInt aPriority);
-
 private:	// from CActive
 	void RunL();
 	void DoCancel();
 	TInt RunError(TInt aError);
-
 private:
 	RApaAppServiceBase& iClient;
 	MApaServerAppExitObserver& iObserver;
@@ -150,7 +135,7 @@
 //
 // Server application server support
 //
-
+#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
 /** Panic codes that the server application framework can generate.
 @internalComponent */
 enum TApaAppServerPanic
@@ -162,9 +147,8 @@
 	/** The client has tried to connect an already connected session. */
 	EApaAppServerPanicClientAlreadyConnected
 	};
-
+#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
 
-class CApaAppServiceBase : public CSession2
 /** Base class for all service implementations.
 Provides the basic IPC and security framework that server applications
 can use to receive messages from their clients.
@@ -179,39 +163,35 @@
 @released
 @see CApaAppServer
 @see CPolicyServer */
+class CApaAppServiceBase : public CSession2
 	{
 public:
 	IMPORT_C CApaAppServiceBase();
 	IMPORT_C ~CApaAppServiceBase();
 
 	IMPORT_C virtual CPolicyServer::TCustomResult SecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
-
 public: // internal
 	void SendAppServerExitNotification(TInt aExitReason);
-
 protected: // from CSession2
 	IMPORT_C void CreateL();
 	IMPORT_C void ServiceL(const RMessage2& aMessage);
 	IMPORT_C void ServiceError(const RMessage2& aMessage,TInt aError);
 	IMPORT_C virtual TInt CountResources();
 	IMPORT_C virtual void Disconnect(const RMessage2& aMessage);
-
 private: // Server exit notification handlers
 	void NotifyServerExit(const RMessage2& aMessage);
 	void CancelNotifyServerExit(const RMessage2& aMessage) const;
-
 private:
 	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
 	IMPORT_C virtual void CApaAppServiceBase_Reserved1();
 	IMPORT_C virtual void CApaAppServiceBase_Reserved2();
-	
 private:
 	RMessagePtr2 iNotifyExitMsg;
 	TInt iExitReason;
 	TInt iApaReserved2;
 	};
 
-class CApaAppServer : public CPolicyServer
+
 /** Base class for all server application's servers.
 Server applications must derive from this class to implement their
 servers. These must be instantiated in an override of
@@ -223,40 +203,33 @@
 @released
 @see CEikAppServer
 @see CPolicyServer */
+class CApaAppServer : public CPolicyServer
 	{
 public:
 	IMPORT_C ~CApaAppServer();
 	IMPORT_C virtual void ConstructL(const TDesC& aFixedServerName);
-	
 	IMPORT_C void NotifyServerExit(TInt aReason);
-	
 	IMPORT_C virtual CApaAppServiceBase* CreateServiceL(TUid aServiceType) const;
 	IMPORT_C virtual TCustomResult CreateServiceSecurityCheckL(TUid aServiceType, const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
-
 protected:
 	IMPORT_C CApaAppServer();
-	
-	// From CPolicyServer
+protected:	// from CPolicyServer
 	IMPORT_C TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
-	// From CServer2
+protected:	// from CServer2
 	IMPORT_C virtual void DoConnect(const RMessage2& aMessage);
-	
-private:
+private: // from CServer2
 	IMPORT_C CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
-	
 private:
 	TUid ConnectMessageServiceUid(const RMessage2& aMsg) const;
-	
 private:
 	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
 	// Extensions
 	IMPORT_C virtual void CApaAppServer_Reserved1();
 	IMPORT_C virtual void CApaAppServer_Reserved2();
-	
 private:
 	TInt iApaReserved1;
 	TInt iApaReserved2;
 	};
 
 
-#endif
+#endif	// APASERVERAPP_H__