michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 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_TextMetrics_h michael@0: #define mozilla_dom_TextMetrics_h michael@0: michael@0: #include "mozilla/dom/CanvasRenderingContext2DBinding.h" michael@0: #include "mozilla/dom/NonRefcountedDOMObject.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class TextMetrics MOZ_FINAL : public NonRefcountedDOMObject michael@0: { michael@0: public: michael@0: TextMetrics(float w) : width(w) michael@0: { michael@0: MOZ_COUNT_CTOR(TextMetrics); michael@0: } michael@0: michael@0: ~TextMetrics() michael@0: { michael@0: MOZ_COUNT_DTOR(TextMetrics); michael@0: } michael@0: michael@0: float Width() const michael@0: { michael@0: return width; michael@0: } michael@0: michael@0: JSObject* WrapObject(JSContext* aCx, bool* aTookOwnership) michael@0: { michael@0: return TextMetricsBinding::Wrap(aCx, this, aTookOwnership); michael@0: } michael@0: michael@0: private: michael@0: float width; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_TextMetrics_h