usbengines/usbotgwatcher/inc/cusbotgwatcher.h
changeset 1 705ec7b86991
parent 0 1e05558e2206
child 5 7068aba64af5
--- a/usbengines/usbotgwatcher/inc/cusbotgwatcher.h	Thu Dec 17 09:14:30 2009 +0200
+++ b/usbengines/usbotgwatcher/inc/cusbotgwatcher.h	Thu Jan 07 13:25:34 2010 +0200
@@ -51,6 +51,23 @@
 class CUsbNotifManager;
 
 /**
+ * Observers for usb otg watcher state nachine
+ * Observers gets feedback by implementing this interface
+ */
+class MUsbOtgWatcherStateObserver
+    {
+
+public:
+
+    /**
+     * Observer must implement this interface
+     * which is called back when state changes
+     * @param aState new state id
+     */
+    virtual void OtgWatcherStateChangedL(TUsbStateIds aState) = 0;
+    };
+
+/**
  *  UsbWatcher main class
  *  Implements states machines and owns them
  *
@@ -339,6 +356,18 @@
      * @param aWhatKindOf problem Id to be handled
      */
     void HandleHostProblemL(TInt aWhatKindOf);
+    
+    /**
+     * Add observer to USb Otg state machine
+     * @param aObserver Observer
+     */
+    void SubscribeL(MUsbOtgWatcherStateObserver* aObserver);
+
+    /**
+     * Remove observer from UsbOtg state observer
+     * @param aObserver Observer
+     */
+    void UnsubscribeL(MUsbOtgWatcherStateObserver* aObserver);
 
     /**
      * Used for test purposes
@@ -462,6 +491,12 @@
      * Own.  
      */
     CUsbServiceControl* iUsbServiceControl;
+    
+    /**
+     * The observer reports state changes to its own observers
+     * Not Own
+     */
+    RPointerArray<MUsbOtgWatcherStateObserver> iOtgStateObservers;
     };
 
 #endif //  C_USBOTGWATCHER_H