summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webaccessibilitymanager.h
blob: 2debcb7abc391bebe179d2b8f0056b0b63e246c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_
#define WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_

#include "webkit/glue/webaccessibility.h"

namespace WebKit {
class WebAccessibilityObject;
class WebView;
}

////////////////////////////////////////////////////////////////////////////////
//
// WebAccessibilityManager
//
// Responds to incoming accessibility requests from the browser side. Retrieves
// the requested information from the active AccessibilityObject, through the
// GlueAccessibilityObject.
////////////////////////////////////////////////////////////////////////////////
namespace webkit_glue {

class WebAccessibilityManager {
 public:
  WebAccessibilityManager() {}
  virtual ~WebAccessibilityManager() {}

  // Creates a new instance of WebAccessibilityManager.
  static WebAccessibilityManager* Create();

  // Retrieves the accessibility information as requested in in_params, by
  // calling into WebKit's AccessibilityObject. Maintains a hashmap of the
  // currently active (browser side ref-count non-zero) instances. Returns true
  // if successful, false otherwise.
  virtual bool GetAccObjInfo(WebKit::WebView* view,
      const WebAccessibility::InParams& in_params,
      WebAccessibility::OutParams* out_params) = 0;

  // Erases the entry identified by the [acc_obj_id] from the hash maps. If
  // [clear_all] is true, all entries are erased. Returns true if successful,
  // false otherwise.
  virtual bool ClearAccObjMap(int acc_obj_id, bool clear_all) = 0;

  // Retrieves the id of the input AccessibilityObject, due to a focus event.
  // Returns an id greater than or equal to 0 if successful, -1 otherwise.
  virtual int FocusAccObj(const WebKit::WebAccessibilityObject& object) = 0;

 private:
  // Retrieves the RenderObject associated with this WebView, and uses it to
  // initialize the root of the GlueAccessibilityObject tree with the
  // associated accessibility information. Returns true if successful, false
  // otherwise.
  virtual bool InitAccObjRoot(WebKit::WebView* view) = 0;

  DISALLOW_COPY_AND_ASSIGN(WebAccessibilityManager);
};

}  // namespace webkit_glue

#endif  // WEBKIT_GLUE_WEBACCESSIBILITYMANAGER_H_