upnpsharing/upnpsecurity/inc/server/upnpsecuritymanagersession.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies  this distribution, and is available 
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  defines CUpnpSecurityManagerSession
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef C_CUPNPSECURITYMANAGERSESSION_H
       
    19 #define C_CUPNPSECURITYMANAGERSESSION_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include "upnpauthorizationnote.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CUpnpSecurityManagerEngine;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31  * An instance of class CUpnpSecurityManagerSession is created for each client
       
    32  */
       
    33 class CUpnpSecurityManagerSession : public CSession2,
       
    34     public MUpnpAuthorizationNoteObserver
       
    35     {
       
    36 
       
    37 public:
       
    38     /**
       
    39      * Create a CUpnpSecurityManagerSession object using two phase construction,
       
    40      * and return a pointer to the created object.
       
    41      * @param aEngine the message handler engine
       
    42      * @result pointer to new session
       
    43      */
       
    44     static CUpnpSecurityManagerSession* NewL( CUpnpSecurityManagerEngine& aEngine );
       
    45 
       
    46     /**
       
    47      * Create a CUpnpSecurityManagerSession object using two phase construction,
       
    48      * and return a pointer to the created object
       
    49      * (leaving a pointer to the object on the cleanup stack).
       
    50      * @param anEngine the message handler engine
       
    51      * @result pointer to new session
       
    52      */
       
    53     static CUpnpSecurityManagerSession* NewLC( CUpnpSecurityManagerEngine& aEngine );
       
    54 
       
    55     /**
       
    56      * Destroy the object and release all memory objects.
       
    57      */
       
    58     virtual ~CUpnpSecurityManagerSession();
       
    59 
       
    60 public:
       
    61     // From CSession
       
    62 
       
    63     /**
       
    64      * Called after a service request from client; from class CSession.
       
    65      * @param aMessage message from client (containing requested operation and any data)
       
    66      */
       
    67     void ServiceL( const RMessage2& aMessage );
       
    68 
       
    69 private:
       
    70     /**
       
    71      * Perform the first phase of two phase construction.
       
    72      * @param aServer the message handler server
       
    73      * @param aEngine the message handler engine
       
    74      */
       
    75     CUpnpSecurityManagerSession( CUpnpSecurityManagerEngine& aEngine );
       
    76 
       
    77     /**
       
    78      * Causes the client thread to panic.
       
    79      * @param panic code
       
    80      */
       
    81     void PanicClient( const RMessage2& aMessage, TInt aPanic ) const;
       
    82 
       
    83     /**
       
    84      * Second phase constructor
       
    85      */
       
    86     void ConstructL();
       
    87     
       
    88 public:
       
    89     // MUpnpAuthorizationNoteObserver methods
       
    90 
       
    91     /**
       
    92      * NoteResponseL
       
    93      * A callback function.
       
    94      * @param aAuthorized The result of authorization.
       
    95      */
       
    96     virtual void NoteResponseL( TBool aAuthorized );    
       
    97     
       
    98 private:
       
    99     /**
       
   100      * 
       
   101      */
       
   102     void EventAddFileL( const RMessage2& aMessage );
       
   103 
       
   104     /**
       
   105      * 
       
   106      */
       
   107     void EventRemoveFileL( const RMessage2& aMessage );
       
   108 
       
   109     /**
       
   110      * 
       
   111      */
       
   112     void EventAddAddressL( const RMessage2& aMessage );
       
   113 
       
   114     /**
       
   115      * 
       
   116      */
       
   117     void EventRemoveAddressL( const RMessage2& aMessage );
       
   118 
       
   119     /**
       
   120      * 
       
   121      */
       
   122     void EventResetFileListL( const RMessage2& aMessage );
       
   123 
       
   124     /**
       
   125      * 
       
   126      */
       
   127     void EventResetAddressListL( const RMessage2& aMessage );
       
   128 
       
   129     /**
       
   130      * 
       
   131      */
       
   132     void EventCheckAuthorizationL( const RMessage2& aMessage );
       
   133 
       
   134     /**
       
   135      * 
       
   136      */
       
   137     void EventQueryAuthorisationL( const RMessage2& aMessage );
       
   138 
       
   139     /**
       
   140      * 
       
   141      */
       
   142     void EventDebugSimulateNextUserAnswerL( const RMessage2& aMessage );
       
   143 
       
   144 private:
       
   145 
       
   146     /* @var iEngine Reference to the engine */
       
   147     CUpnpSecurityManagerEngine& iEngine;
       
   148     
       
   149     //accept/disallow connection window
       
   150     CUpnpAuthorizationNote* iAuthorizationNote;
       
   151     
       
   152     RMessage2 iQueryAuthMessage;
       
   153     };
       
   154 
       
   155 #endif // C_CUPNPSECURITYMANAHERSESSION_H
       
   156 // End of File