michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_audio_channel_agent_h__ michael@0: #define mozilla_dom_audio_channel_agent_h__ michael@0: michael@0: #include "nsIAudioChannelAgent.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsWeakPtr.h" michael@0: michael@0: #define NS_AUDIOCHANNELAGENT_CONTRACTID "@mozilla.org/audiochannelagent;1" michael@0: // f27688e2-3dd7-11e2-904e-10bf48d64bd4 michael@0: #define NS_AUDIOCHANNELAGENT_CID {0xf27688e2, 0x3dd7, 0x11e2, \ michael@0: {0x90, 0x4e, 0x10, 0xbf, 0x48, 0xd6, 0x4b, 0xd4}} michael@0: michael@0: class nsIDOMWindow; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: /* Header file */ michael@0: class AudioChannelAgent : public nsIAudioChannelAgent michael@0: { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_NSIAUDIOCHANNELAGENT michael@0: michael@0: NS_DECL_CYCLE_COLLECTION_CLASS(AudioChannelAgent) michael@0: michael@0: AudioChannelAgent(); michael@0: virtual void NotifyAudioChannelStateChanged(); michael@0: michael@0: void WindowVolumeChanged(); michael@0: michael@0: nsIDOMWindow* Window() const michael@0: { michael@0: return mWindow; michael@0: } michael@0: michael@0: private: michael@0: virtual ~AudioChannelAgent(); michael@0: michael@0: // Returns mCallback if that's non-null, or otherwise tries to get an michael@0: // nsIAudioChannelAgentCallback out of mWeakCallback. michael@0: already_AddRefed GetCallback(); michael@0: michael@0: nsresult InitInternal(nsIDOMWindow* aWindow, int32_t aAudioAgentType, michael@0: nsIAudioChannelAgentCallback* aCallback, michael@0: bool aUseWeakRef, bool aWithVideo=false); michael@0: michael@0: nsCOMPtr mWindow; michael@0: nsCOMPtr mCallback; michael@0: nsWeakPtr mWeakCallback; michael@0: int32_t mAudioChannelType; michael@0: bool mIsRegToService; michael@0: bool mVisible; michael@0: bool mWithVideo; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: #endif michael@0: