usbengines/usbwatcher/inc/cusbwatchersession.h
changeset 35 9d8b04ca6939
parent 0 1e05558e2206
child 71 173beb545395
equal deleted inserted replaced
34:7858bc6ead78 35:9d8b04ca6939
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Session class for USB Watcher
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CUSBWATCHERSESSION_H
       
    20 #define CUSBWATCHERSESSION_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include "musbwatchernotify.h"
       
    25 //
       
    26 // Forward declarations
       
    27 //
       
    28 class CUsbWatcherServer;
       
    29 class CUsbWatcher;
       
    30 
       
    31 NONSHARABLE_CLASS( CUsbWatcherSession ) : public CSession2,
       
    32     public MUsbWatcherNotify
       
    33     {
       
    34 public:
       
    35     static CUsbWatcherSession* NewL(CUsbWatcherServer* aServer);
       
    36     virtual ~CUsbWatcherSession();
       
    37 
       
    38     // CSession
       
    39     virtual void ServiceL(const RMessage2& aMessage);
       
    40         
       
    41     virtual void Notify(TInt iPersonalityId, TInt aStatus); 
       
    42 
       
    43     /**
       
    44      * Check if ask on connection mode query is suppressed in this session.
       
    45      * From MUsbWatcherNotify
       
    46      */
       
    47     virtual TBool IsAskOnConnectionSuppressed();
       
    48     
       
    49 protected:
       
    50     CUsbWatcherSession(CUsbWatcherServer* aServer);
       
    51     void ConstructL();
       
    52 
       
    53     void DispatchMessageL(const RMessage2& aMessage);
       
    54 
       
    55 private:
       
    56 
       
    57     TInt SetPersonality(const RMessage2& aMessage, TBool& aComplete);
       
    58     TInt CancelSetPersonality(const RMessage2& aMessage, 
       
    59             TBool& aComplete);
       
    60     TInt SetPreviousPersonality(const RMessage2& aMessage,
       
    61             TBool& aComplete);
       
    62     TInt SetPreviousPersonalitySync(const RMessage2& aMessage, 
       
    63             TBool& aComplete);    
       
    64     TInt CancelSetPreviousPersonality(const RMessage2& aMessage, 
       
    65             TBool& aComplete);
       
    66     TInt SetPreviousPersonalityOnDisconnect(const RMessage2& aMessage, 
       
    67             TBool& aComplete);
       
    68 
       
    69     /**
       
    70      * Prevent showing ask on connection mode query in this session.
       
    71      * This affects to the next cable connections. The currently shown
       
    72      * mode query is not closed.
       
    73      * aSuppress ETrue prevents showing the mode query.
       
    74      */
       
    75     void SetAskOnConnectionSuppression(TBool aSuppress);
       
    76 
       
    77     CUsbWatcherServer* iUsbWatcherServer;
       
    78     RMessage2 iSetPersonalityMessage;
       
    79     RMessage2 iCancelSetPersonalityMessage;
       
    80     RMessage2 iSetPreviousPersonalityMessage;
       
    81     RMessage2 iCancelSetPreviousPersonalityMessage;
       
    82     TBool iSetPersonalityOutstanding;
       
    83     TBool iCancelSetPersonalityOutstanding;
       
    84 
       
    85     TBool iSetPreviousPersonalityOutstanding;
       
    86     TBool iCancelSetPreviousPersonalityOutstanding;
       
    87     TBool iSuppressAskOnConnection; // Prevent ask on connection mode query 
       
    88     };
       
    89 
       
    90 #endif
       
    91 
       
    92 // End of file