accessible/src/base/StyleInfo.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.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set expandtab shiftwidth=2 tabstop=2: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef _mozilla_a11y_style_h_
     8 #define _mozilla_a11y_style_h_
    10 #include "mozilla/gfx/Types.h"
    11 #include "nsStyleContext.h"
    13 namespace mozilla {
    14 namespace a11y {
    16 class StyleInfo
    17 {
    18 public:
    19   StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell);
    20   ~StyleInfo() { }
    22   void Display(nsAString& aValue);
    23   void TextAlign(nsAString& aValue);
    24   void TextIndent(nsAString& aValue);
    25   void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); }
    26   void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); }
    27   void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
    28   void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
    30   static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
    31   static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
    32   static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
    34 private:
    35   StyleInfo() MOZ_DELETE;
    36   StyleInfo(const StyleInfo&) MOZ_DELETE;
    37   StyleInfo& operator = (const StyleInfo&) MOZ_DELETE;
    39   void Margin(css::Side aSide, nsAString& aValue);
    41   dom::Element* mElement;
    42   nsRefPtr<nsStyleContext> mStyleContext;
    43 };
    45 } // namespace a11y
    46 } // namespace mozilla
    48 #endif

mercurial