locationrequestmgmt/networkrequesthandler/inc/lbsnrhserver.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     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 /**
       
    17  @file
       
    18  @internalComponent
       
    19  @released
       
    20 */
       
    21 #ifndef __LBSNRHSERVER_H__
       
    22 #define __LBSNRHSERVER_H__
       
    23 
       
    24 #include <e32property.h>
       
    25 #include "tserverstartparams.h"
       
    26 #include "csecureasbase.h"
       
    27 #include "csecureserverbase.h"
       
    28 #include "csecuresessionbase.h"
       
    29 #include "csecuresessionsubsessionbase.h"
       
    30 #include "csubsessionbase.h"
       
    31 #include "messageutils.h"
       
    32 #include "lbsnetworkrequesthandler.h"
       
    33 #include "privacyhandler.h"
       
    34 #include "lbsprivacycontrollerdata.h"
       
    35 #include "x3phandler.h"
       
    36 #include "LbsLogger.h"
       
    37 
       
    38 
       
    39 class CNrhServerImpl : public CBase, public MCreateServerImpl
       
    40 	{
       
    41 public:
       
    42 	virtual void CreateServerLC(TServerStartParams& aParams);	
       
    43 	};
       
    44 	
       
    45 class MNrhServerObserver
       
    46 	{
       
    47 public:
       
    48 	virtual void SetX3pServerObserver(MX3pHandlerNotifier* aX3pObserver) = 0;
       
    49 	virtual void SetPrivacyServerObserver(MPrivacyHandlerObserver* aX3pObserver) = 0;
       
    50 	};
       
    51 	
       
    52 class CNrhServer : public CSecureServerBase, 
       
    53 				   public MNrhServerObserver,
       
    54 				   public MLbsProcessCloseDown
       
    55 	{
       
    56 public:
       
    57 	static RLbsLogger iLogger;
       
    58 	
       
    59 public:
       
    60 	CNrhServer(TInt aPriority, const CPolicyServer::TPolicy& aSecurityPolicy);
       
    61 	~CNrhServer();
       
    62 	void ConstructL(const TDesC& aServerName);
       
    63 	CSession2* DoNewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
       
    64 	TVersion GetServerVersion() const;
       
    65 	TCustomResult CustomSecurityCheckL(const RMessage2 &aMsg, 
       
    66 									   TInt& aAction, 
       
    67 									   TSecurityInfo& aMissing);
       
    68 	
       
    69 	MX3pHandlerNotifier* X3pObserver() const;
       
    70 	MPrivacyHandlerObserver* PrivacyObserver() const;
       
    71 	CLbsAdmin* Admin() const;
       
    72 	RLbsNetworkRegistrationStatus& NetworkRegistrationStatus();
       
    73 
       
    74 public: // From MNrhServerObserver
       
    75 	void SetX3pServerObserver(MX3pHandlerNotifier* aX3pObserver);
       
    76 	void SetPrivacyServerObserver(MPrivacyHandlerObserver* aPrivacyObserver);	
       
    77 
       
    78 public: // From MLbsProcessCloseDown
       
    79     void OnProcessCloseDown();
       
    80     
       
    81 protected:
       
    82 	// property
       
    83 	TVersion iVersion;
       
    84 private:
       
    85 	CLbsNetworkRequestHandler*	iNetworkRequestHandler;
       
    86 	CLbsCloseDownRequestDetector*	iCloseDownRequestDetector;
       
    87 	MX3pHandlerNotifier*		iX3pObserver;
       
    88 	MPrivacyHandlerObserver*	iPrivacyObserver;
       
    89 	
       
    90 	};
       
    91 	
       
    92 // this is a session WITH subsession support	
       
    93 class CNrhServerSession : public CSecureSessionSubSessionBase
       
    94 	{
       
    95 public:
       
    96 	~CNrhServerSession();
       
    97 	void CreateL();
       
    98 	void ServiceMessageL(const RMessage2& aMessage);
       
    99 	void ServiceMessageError(const RMessage2& aMessage, const TInt aError);
       
   100 	
       
   101 private:
       
   102 	RLbsSystemController iSystemController;
       
   103 	};
       
   104 
       
   105 #endif //__LBSNRHSERVER_H__