OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // TextInputController is bound to window.textInputController in Javascript | |
6 // when test_shell is running in layout test mode. Layout tests use it to | |
7 // exercise various corners of text input. | |
8 // | |
9 // Mac equivalent: WebKit/Tools/DumpRenderTree/TextInputController.{h,m} | |
10 | |
11 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | |
12 #define WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | |
13 | |
14 #include "webkit/glue/cpp_bound_class.h" | |
15 | |
16 class TestShell; | |
17 | |
18 namespace WebKit { | |
19 class WebFrame; | |
20 } | |
21 | |
22 class TextInputController : public CppBoundClass { | |
23 public: | |
24 TextInputController(TestShell* shell); | |
25 | |
26 void insertText(const CppArgumentList& args, CppVariant* result); | |
27 void doCommand(const CppArgumentList& args, CppVariant* result); | |
28 void setMarkedText(const CppArgumentList& args, CppVariant* result); | |
29 void unmarkText(const CppArgumentList& args, CppVariant* result); | |
30 void hasMarkedText(const CppArgumentList& args, CppVariant* result); | |
31 void conversationIdentifier(const CppArgumentList& args, CppVariant* result); | |
32 void substringFromRange(const CppArgumentList& args, CppVariant* result); | |
33 void attributedSubstringFromRange(const CppArgumentList& args, CppVariant* res
ult); | |
34 void markedRange(const CppArgumentList& args, CppVariant* result); | |
35 void selectedRange(const CppArgumentList& args, CppVariant* result); | |
36 void firstRectForCharacterRange(const CppArgumentList& args, CppVariant* resul
t); | |
37 void characterIndexForPoint(const CppArgumentList& args, CppVariant* result); | |
38 void validAttributesForMarkedText(const CppArgumentList& args, CppVariant* res
ult); | |
39 void makeAttributedString(const CppArgumentList& args, CppVariant* result); | |
40 | |
41 private: | |
42 // Returns the test shell's main WebFrame. | |
43 static WebKit::WebFrame* GetMainFrame(); | |
44 | |
45 // Non-owning pointer. The LayoutTestController is owned by the host. | |
46 static TestShell* shell_; | |
47 }; | |
48 | |
49 #endif // WEBKIT_TOOLS_TEST_SHELL_TEXT_INPUT_CONTROLLER_H__ | |
OLD | NEW |