]> git.saurik.com Git - iphone-api.git/blob - WebCore/DocumentMarker.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / DocumentMarker.h
1 /*
2 * This file is part of the DOM implementation for WebCore.
3 *
4 * Copyright (C) 2006 Apple Computer, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #ifndef DocumentMarker_h
24 #define DocumentMarker_h
25
26 #include "PlatformString.h"
27
28 namespace WebCore {
29 class String;
30
31 // A range of a node within a document that is "marked", such as the range of a misspelled word.
32 // It optionally includes a description that could be displayed in the user interface.
33 struct DocumentMarker {
34
35 enum MarkerType {
36 AllMarkers = -1,
37 Spelling,
38 Grammar,
39 TextMatch
40 };
41
42 MarkerType type;
43 unsigned startOffset;
44 unsigned endOffset;
45 String description;
46
47 bool operator==(const DocumentMarker& o) const
48 {
49 return type == o.type && startOffset == o.startOffset && endOffset == o.endOffset;
50 }
51
52 bool operator!=(const DocumentMarker& o) const
53 {
54 return !(*this == o);
55 }
56 };
57
58 } // namespace WebCore
59
60 #endif // DocumentMarker_h