/src/mozilla-central/dom/grid/GridLine.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
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 | | #include "GridLine.h" |
8 | | |
9 | | #include "GridLines.h" |
10 | | #include "mozilla/dom/GridBinding.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridLine, mParent) |
16 | | NS_IMPL_CYCLE_COLLECTING_ADDREF(GridLine) |
17 | | NS_IMPL_CYCLE_COLLECTING_RELEASE(GridLine) |
18 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridLine) |
19 | 0 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
20 | 0 | NS_INTERFACE_MAP_ENTRY(nsISupports) |
21 | 0 | NS_INTERFACE_MAP_END |
22 | | |
23 | | GridLine::GridLine(GridLines *aParent) |
24 | | : mParent(aParent) |
25 | | , mStart(0.0) |
26 | | , mBreadth(0.0) |
27 | | , mType(GridDeclaration::Implicit) |
28 | | , mNumber(0) |
29 | | , mNegativeNumber(0) |
30 | 0 | { |
31 | 0 | MOZ_ASSERT(aParent, "Should never be instantiated with a null GridLines"); |
32 | 0 | } |
33 | | |
34 | | GridLine::~GridLine() |
35 | 0 | { |
36 | 0 | } |
37 | | |
38 | | void |
39 | | GridLine::GetNames(nsTArray<nsString>& aNames) const |
40 | 0 | { |
41 | 0 | aNames = mNames; |
42 | 0 | } |
43 | | |
44 | | JSObject* |
45 | | GridLine::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
46 | 0 | { |
47 | 0 | return GridLine_Binding::Wrap(aCx, this, aGivenProto); |
48 | 0 | } |
49 | | |
50 | | double |
51 | | GridLine::Start() const |
52 | 0 | { |
53 | 0 | return mStart; |
54 | 0 | } |
55 | | |
56 | | double |
57 | | GridLine::Breadth() const |
58 | 0 | { |
59 | 0 | return mBreadth; |
60 | 0 | } |
61 | | |
62 | | GridDeclaration |
63 | | GridLine::Type() const |
64 | 0 | { |
65 | 0 | return mType; |
66 | 0 | } |
67 | | |
68 | | uint32_t |
69 | | GridLine::Number() const |
70 | 0 | { |
71 | 0 | return mNumber; |
72 | 0 | } |
73 | | |
74 | | int32_t |
75 | | GridLine::NegativeNumber() const |
76 | 0 | { |
77 | 0 | return mNegativeNumber; |
78 | 0 | } |
79 | | |
80 | | void |
81 | | GridLine::SetLineValues(const nsTArray<nsString>& aNames, |
82 | | double aStart, |
83 | | double aBreadth, |
84 | | uint32_t aNumber, |
85 | | int32_t aNegativeNumber, |
86 | | GridDeclaration aType) |
87 | 0 | { |
88 | 0 | mNames = aNames; |
89 | 0 | mStart = aStart; |
90 | 0 | mBreadth = aBreadth; |
91 | 0 | mNumber = aNumber; |
92 | 0 | mNegativeNumber = aNegativeNumber; |
93 | 0 | mType = aType; |
94 | 0 | } |
95 | | |
96 | | } // namespace dom |
97 | | } // namespace mozilla |