Line data Source code
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 0 : ~StyleInfo() { }
21 :
22 : void Display(nsAString& aValue);
23 : void TextAlign(nsAString& aValue);
24 : void TextIndent(nsAString& aValue);
25 0 : void MarginLeft(nsAString& aValue) { Margin(eSideLeft, aValue); }
26 0 : void MarginRight(nsAString& aValue) { Margin(eSideRight, aValue); }
27 0 : void MarginTop(nsAString& aValue) { Margin(eSideTop, aValue); }
28 0 : void MarginBottom(nsAString& aValue) { Margin(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() = delete;
36 : StyleInfo(const StyleInfo&) = delete;
37 : StyleInfo& operator = (const StyleInfo&) = delete;
38 :
39 : void Margin(Side aSide, nsAString& aValue);
40 :
41 : dom::Element* mElement;
42 : RefPtr<nsStyleContext> mStyleContext;
43 : };
44 :
45 : } // namespace a11y
46 : } // namespace mozilla
47 :
48 : #endif
|