2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above
16 * copyright notice, this list of conditions and the following disclaimer
17 * in the documentation and/or other materials provided with the
19 * * Neither the name of Google Inc. nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #ifndef TextRunConstructor_h
37 #define TextRunConstructor_h
39 #include "platform/text/TextDirection.h"
40 #include "platform/text/TextRun.h"
41 #include "wtf/text/Unicode.h"
42 #include "wtf/text/WTFString.h"
54 DefaultTextRunFlags
= 0,
55 RespectDirection
= 1 << 0,
56 RespectDirectionOverride
= 1 << 1
59 typedef unsigned TextRunFlags
;
61 // Direction resolved from string value.
62 TextRun
constructTextRun(const Font
&, const String
&, const ComputedStyle
&, TextRunFlags
= DefaultTextRunFlags
);
63 TextRun
constructTextRun(const Font
&, const LineLayoutText
, unsigned offset
, unsigned length
, const ComputedStyle
&);
65 // Explicit direction.
66 TextRun
constructTextRun(const Font
&, const String
&, const ComputedStyle
&, TextDirection
, TextRunFlags
= DefaultTextRunFlags
);
67 TextRun
constructTextRun(const Font
&, const LayoutText
*, unsigned offset
, unsigned length
, const ComputedStyle
&, TextDirection
);
68 TextRun
constructTextRun(const Font
&, const LChar
*, int length
, const ComputedStyle
&, TextDirection
);
69 TextRun
constructTextRun(const Font
&, const UChar
*, int length
, const ComputedStyle
&, TextDirection
);