dom/events/SpeechRecognitionError.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/events/SpeechRecognitionError.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef SpeechRecognitionError_h__
    1.10 +#define SpeechRecognitionError_h__
    1.11 +
    1.12 +#include "mozilla/dom/Event.h"
    1.13 +#include "mozilla/dom/SpeechRecognitionErrorBinding.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +namespace dom {
    1.17 +
    1.18 +class SpeechRecognitionError : public Event
    1.19 +{
    1.20 +public:
    1.21 +  SpeechRecognitionError(mozilla::dom::EventTarget* aOwner,
    1.22 +                         nsPresContext* aPresContext,
    1.23 +                         WidgetEvent* aEvent);
    1.24 +  virtual ~SpeechRecognitionError();
    1.25 +
    1.26 +  static already_AddRefed<SpeechRecognitionError>
    1.27 +  Constructor(const GlobalObject& aGlobal,
    1.28 +              const nsAString& aType,
    1.29 +              const SpeechRecognitionErrorInit& aParam,
    1.30 +              ErrorResult& aRv);
    1.31 +
    1.32 +  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
    1.33 +  {
    1.34 +    return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this);
    1.35 +  }
    1.36 +
    1.37 +  void
    1.38 +  GetMessage(nsAString& aString)
    1.39 +  {
    1.40 +    aString = mMessage;
    1.41 +  }
    1.42 +
    1.43 +  SpeechRecognitionErrorCode
    1.44 +  Error()
    1.45 +  {
    1.46 +    return mError;
    1.47 +  }
    1.48 +
    1.49 +  void
    1.50 +  InitSpeechRecognitionError(const nsAString& aType,
    1.51 +                             bool aCanBubble,
    1.52 +                             bool aCancelable,
    1.53 +                             SpeechRecognitionErrorCode aError,
    1.54 +                             const nsAString& aMessage,
    1.55 +                             ErrorResult& aRv);
    1.56 +
    1.57 +protected:
    1.58 +  SpeechRecognitionErrorCode mError;
    1.59 +  nsString mMessage;
    1.60 +};
    1.61 +
    1.62 +}
    1.63 +}
    1.64 +
    1.65 +#endif // SpeechRecognitionError_h__

mercurial