michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set expandtab shiftwidth=2 tabstop=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_a11y_style_h_ michael@0: #define _mozilla_a11y_style_h_ michael@0: michael@0: #include "mozilla/gfx/Types.h" michael@0: #include "nsStyleContext.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: class StyleInfo michael@0: { michael@0: public: michael@0: StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell); michael@0: ~StyleInfo() { } michael@0: michael@0: void Display(nsAString& aValue); michael@0: void TextAlign(nsAString& aValue); michael@0: void TextIndent(nsAString& aValue); michael@0: void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); } michael@0: void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); } michael@0: void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); } michael@0: void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); } michael@0: michael@0: static void FormatColor(const nscolor& aValue, nsString& aFormattedValue); michael@0: static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue); michael@0: static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue); michael@0: michael@0: private: michael@0: StyleInfo() MOZ_DELETE; michael@0: StyleInfo(const StyleInfo&) MOZ_DELETE; michael@0: StyleInfo& operator = (const StyleInfo&) MOZ_DELETE; michael@0: michael@0: void Margin(css::Side aSide, nsAString& aValue); michael@0: michael@0: dom::Element* mElement; michael@0: nsRefPtr mStyleContext; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif