1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_
10 #include "base/basictypes.h"
11 #include "base/callback_forward.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/values.h"
14 #include "chrome/common/extensions/api/braille_display_private.h"
16 namespace extensions
{
18 namespace braille_display_private
{
19 class BrailleObserver
;
21 // Singleton class that controls the braille display.
22 class BrailleController
{
24 static BrailleController
* GetInstance();
26 virtual scoped_ptr
<DisplayState
> GetDisplayState() = 0;
27 virtual void WriteDots(const std::vector
<char>& cells
) = 0;
28 virtual void AddObserver(BrailleObserver
* observer
) = 0;
29 virtual void RemoveObserver(BrailleObserver
* observer
) = 0;
33 virtual ~BrailleController();
36 DISALLOW_COPY_AND_ASSIGN(BrailleController
);
39 // Observer for events from the BrailleController
40 class BrailleObserver
{
42 virtual void OnBrailleDisplayStateChanged(
43 const DisplayState
& display_state
) {}
44 virtual void OnBrailleKeyEvent(const KeyEvent
& event
) {}
47 } // namespace braille_display_private
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_