]> git.saurik.com Git - iphone-api.git/blob - WebCore/SelectionRect.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / SelectionRect.h
1 /*
2 * SelectionRect.h
3 * WebCore
4 *
5 * Copyright (C) 2009, Apple Inc. All rights reserved.
6 *
7 */
8
9 #ifndef SelectionRect_h
10 #define SelectionRect_h
11
12 #include "IntRect.h"
13 #include "TextDirection.h"
14
15 namespace WebCore {
16
17 class SelectionRect {
18 public:
19 SelectionRect();
20 explicit SelectionRect(const IntRect &);
21 SelectionRect(const IntRect &, TextDirection, int, int, int, bool, bool, bool, bool, bool);
22 ~SelectionRect() { }
23
24 IntRect rect() const { return m_rect; }
25 TextDirection direction() const { return m_direction; }
26 int minX() const { return m_minX; }
27 int maxX() const { return m_maxX; }
28 int lineNumber() const { return m_lineNumber; }
29 bool isLineBreak() const { return m_isLineBreak; }
30 bool isFirstOnLine() const { return m_isFirstOnLine; }
31 bool isLastOnLine() const { return m_isLastOnLine; }
32 bool containsStart() const { return m_containsStart; }
33 bool containsEnd() const { return m_containsEnd; }
34
35 void setRect(const IntRect &r) { m_rect = r; }
36 void setDirection(TextDirection d) { m_direction = d; }
37 void setMinX(int x) { m_minX = x; }
38 void setMaxX(int x) { m_maxX = x; }
39 void setLineNumber(int n) { m_lineNumber = n; }
40 void setIsLineBreak(bool b) { m_isLineBreak = b; }
41 void setIsFirstOnLine(bool b) { m_isFirstOnLine = b; }
42 void setIsLastOnLine(bool b) { m_isLastOnLine = b; }
43 void setContainsStart(bool b) { m_containsStart = b; }
44 void setContainsEnd(bool b) { m_containsEnd = b; }
45
46 private:
47 IntRect m_rect;
48 TextDirection m_direction;
49 int m_minX;
50 int m_maxX;
51 int m_lineNumber;
52 bool m_isLineBreak;
53 bool m_isFirstOnLine;
54 bool m_isLastOnLine;
55 bool m_containsStart;
56 bool m_containsEnd;
57 };
58
59 }
60
61 #endif
62