|
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/. */ |
|
6 |
|
7 #ifndef _mozilla_a11y_style_h_ |
|
8 #define _mozilla_a11y_style_h_ |
|
9 |
|
10 #include "mozilla/gfx/Types.h" |
|
11 #include "nsStyleContext.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace a11y { |
|
15 |
|
16 class StyleInfo |
|
17 { |
|
18 public: |
|
19 StyleInfo(dom::Element* aElement, nsIPresShell* aPresShell); |
|
20 ~StyleInfo() { } |
|
21 |
|
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); } |
|
29 |
|
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); |
|
33 |
|
34 private: |
|
35 StyleInfo() MOZ_DELETE; |
|
36 StyleInfo(const StyleInfo&) MOZ_DELETE; |
|
37 StyleInfo& operator = (const StyleInfo&) MOZ_DELETE; |
|
38 |
|
39 void Margin(css::Side aSide, nsAString& aValue); |
|
40 |
|
41 dom::Element* mElement; |
|
42 nsRefPtr<nsStyleContext> mStyleContext; |
|
43 }; |
|
44 |
|
45 } // namespace a11y |
|
46 } // namespace mozilla |
|
47 |
|
48 #endif |