dom/audiochannel/AudioChannelAgent.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
michael@0 2 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_dom_audio_channel_agent_h__
michael@0 8 #define mozilla_dom_audio_channel_agent_h__
michael@0 9
michael@0 10 #include "nsIAudioChannelAgent.h"
michael@0 11 #include "nsCycleCollectionParticipant.h"
michael@0 12 #include "nsCOMPtr.h"
michael@0 13 #include "nsWeakPtr.h"
michael@0 14
michael@0 15 #define NS_AUDIOCHANNELAGENT_CONTRACTID "@mozilla.org/audiochannelagent;1"
michael@0 16 // f27688e2-3dd7-11e2-904e-10bf48d64bd4
michael@0 17 #define NS_AUDIOCHANNELAGENT_CID {0xf27688e2, 0x3dd7, 0x11e2, \
michael@0 18 {0x90, 0x4e, 0x10, 0xbf, 0x48, 0xd6, 0x4b, 0xd4}}
michael@0 19
michael@0 20 class nsIDOMWindow;
michael@0 21
michael@0 22 namespace mozilla {
michael@0 23 namespace dom {
michael@0 24
michael@0 25 /* Header file */
michael@0 26 class AudioChannelAgent : public nsIAudioChannelAgent
michael@0 27 {
michael@0 28 public:
michael@0 29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
michael@0 30 NS_DECL_NSIAUDIOCHANNELAGENT
michael@0 31
michael@0 32 NS_DECL_CYCLE_COLLECTION_CLASS(AudioChannelAgent)
michael@0 33
michael@0 34 AudioChannelAgent();
michael@0 35 virtual void NotifyAudioChannelStateChanged();
michael@0 36
michael@0 37 void WindowVolumeChanged();
michael@0 38
michael@0 39 nsIDOMWindow* Window() const
michael@0 40 {
michael@0 41 return mWindow;
michael@0 42 }
michael@0 43
michael@0 44 private:
michael@0 45 virtual ~AudioChannelAgent();
michael@0 46
michael@0 47 // Returns mCallback if that's non-null, or otherwise tries to get an
michael@0 48 // nsIAudioChannelAgentCallback out of mWeakCallback.
michael@0 49 already_AddRefed<nsIAudioChannelAgentCallback> GetCallback();
michael@0 50
michael@0 51 nsresult InitInternal(nsIDOMWindow* aWindow, int32_t aAudioAgentType,
michael@0 52 nsIAudioChannelAgentCallback* aCallback,
michael@0 53 bool aUseWeakRef, bool aWithVideo=false);
michael@0 54
michael@0 55 nsCOMPtr<nsIDOMWindow> mWindow;
michael@0 56 nsCOMPtr<nsIAudioChannelAgentCallback> mCallback;
michael@0 57 nsWeakPtr mWeakCallback;
michael@0 58 int32_t mAudioChannelType;
michael@0 59 bool mIsRegToService;
michael@0 60 bool mVisible;
michael@0 61 bool mWithVideo;
michael@0 62 };
michael@0 63
michael@0 64 } // namespace dom
michael@0 65 } // namespace mozilla
michael@0 66 #endif
michael@0 67

mercurial