usbengines/usbotgwatcher/inc/cusbnotifmanager.h
branchRCL_3
changeset 20 a15c582fbf97
parent 1 705ec7b86991
child 21 ff9df6630274
equal deleted inserted replaced
13:7068aba64af5 20:a15c582fbf97
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     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:  Manages notifiers
       
    15  *
     8  *
    16 */
     9  * Initial Contributors:
    17 
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Manages notifiers
       
    15  *
       
    16  */
    18 
    17 
    19 #ifndef C_USBNOTIFMANAGER_H
    18 #ifndef C_USBNOTIFMANAGER_H
    20 #define C_USBNOTIFMANAGER_H
    19 #define C_USBNOTIFMANAGER_H
    21 
    20 
    22 #include <e32base.h>
    21 #include <e32base.h>
    56      * 2-phase construction
    55      * 2-phase construction
    57      * @param aWaitNotifier owner
    56      * @param aWaitNotifier owner
    58      * aObserver will receive notification when completed 
    57      * aObserver will receive notification when completed 
    59      */
    58      */
    60     static CWaitNotifierInfo* NewL(CUsbNotifier* aWaitNotifier,
    59     static CWaitNotifierInfo* NewL(CUsbNotifier* aWaitNotifier,
    61             MWaitNotifierObserver* aObserver);
    60             MWaitNotifierObserver& aObserver);
    62 
    61 
    63     /**
    62     /**
    64      * Destructor
    63      * Destructor
    65      */
    64      */
    66     virtual ~CWaitNotifierInfo();
    65     virtual ~CWaitNotifierInfo();
    81      * Default constructor
    80      * Default constructor
    82      * @param aWaitNotifier Notifier
    81      * @param aWaitNotifier Notifier
    83      * @param aObserver Observer
    82      * @param aObserver Observer
    84      */
    83      */
    85     CWaitNotifierInfo(CUsbNotifier* aWaitNotifier,
    84     CWaitNotifierInfo(CUsbNotifier* aWaitNotifier,
    86             MWaitNotifierObserver* aObserver);
    85             MWaitNotifierObserver& aObserver);
    87 
    86 
    88     /**
    87     /**
    89      * 2nd phase construction
    88      * 2nd phase construction
    90      */
    89      */
    91     void ConstructL();
    90     void ConstructL();
   100 
    99 
   101     /**
   100     /**
   102      * observer
   101      * observer
   103      * not owns
   102      * not owns
   104      */
   103      */
   105     MWaitNotifierObserver* iObserver;
   104     MWaitNotifierObserver& iObserver;
   106     };
   105     };
   107 
   106 
   108 /**
   107 /**
   109  *  Function of the class is own and share RNotifier, own list of CWaitNotifier(s),
   108  *  Function of the class is own and share RNotifier, own list of CWaitNotifier(s),
   110  *	show notifiers, which are synchronous, and cancel it with a delay 
   109  *	show notifiers, which are synchronous, and cancel it with a delay 
   117 
   116 
   118     /**
   117     /**
   119      * 2phase construction
   118      * 2phase construction
   120      * @param aOtgWatcher OtgWatcher is a parent class
   119      * @param aOtgWatcher OtgWatcher is a parent class
   121      */
   120      */
   122     static CUsbNotifManager* NewL(CUsbOtgWatcher* aOtgWatcher);
   121     static CUsbNotifManager* NewL(CUsbOtgWatcher& aOtgWatcher);
   123 
   122 
   124     /**
   123     /**
   125      * Destructor
   124      * Destructor
   126      */
   125      */
   127     virtual ~CUsbNotifManager();
   126     virtual ~CUsbNotifManager();
   131      * @param aCat Category
   130      * @param aCat Category
   132      * @param aNotifId notifier id
   131      * @param aNotifId notifier id
   133      * @param aObserver will receive notifications
   132      * @param aObserver will receive notifications
   134      */
   133      */
   135     void ShowNotifierL(TUid aCat, TUint aNotifId,
   134     void ShowNotifierL(TUid aCat, TUint aNotifId,
   136             MWaitNotifierObserver* aObserver = NULL);
   135             MWaitNotifierObserver* aObserver);
   137 
   136 
   138     /**
   137     /**
   139      * Closes and deletes all the notifiers
   138      * Closes and deletes all the notifiers
   140      */
   139      */
   141     void CloseAllNotifiers();
   140     void CloseAllNotifiers();
   142     
   141 
   143     /** 
   142     /** 
   144      * Calls back Notifier show is over
   143      * Calls back Notifier show is over
   145      * @param aWaitNotifier wait notifier
   144      * @param aWaitNotifier wait notifier
   146      * @param aResult result (was any errors or not)
   145      * @param aResult result (was any errors or not)
   147      * @param aFeedback user press (cancel or any other) 
   146      * @param aFeedback user press (cancel or any other) 
   148      */
   147      */
   149     void NotifierShowCompletedL(CUsbNotifier* aWaitNotifier, TInt aResult,
   148     void NotifierShowCompletedL(CUsbNotifier& aWaitNotifier, TInt aResult,
   150             TInt aFeedback);
   149             TInt aFeedback);
   151 
   150 
   152 private:
   151 private:
   153 
   152 
   154     /**
   153     /**
   158     CUsbNotifManager();
   157     CUsbNotifManager();
   159 
   158 
   160     /**
   159     /**
   161      * Second phase construction
   160      * Second phase construction
   162      */
   161      */
   163     void ConstructL(CUsbOtgWatcher* aOtgWatcher);
   162     void ConstructL(CUsbOtgWatcher& aOtgWatcher);
   164 
   163 
   165 private:
   164 private:
   166     // data
   165     // data
   167 
   166 
   168     /**
   167     /**