blob: a405e01ac2e9dd97f308a4dbf28809c8c01da8d8 (
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
|
// Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_
#define CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_
#include <vector>
#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/common/extensions/api/braille_display_private.h"
namespace extensions {
namespace api {
namespace braille_display_private {
class BrailleObserver;
// Singleton class that controls the braille display.
class BrailleController {
public:
static BrailleController* GetInstance();
virtual scoped_ptr<DisplayState> GetDisplayState() = 0;
virtual void WriteDots(const std::vector<char>& cells) = 0;
virtual void AddObserver(BrailleObserver* observer) = 0;
virtual void RemoveObserver(BrailleObserver* observer) = 0;
protected:
BrailleController();
virtual ~BrailleController();
private:
DISALLOW_COPY_AND_ASSIGN(BrailleController);
};
// Observer for events from the BrailleController
class BrailleObserver {
public:
virtual void OnBrailleDisplayStateChanged(
const DisplayState& display_state) {}
virtual void OnBrailleKeyEvent(const KeyEvent& event) {}
};
} // namespace braille_display_private
} // namespace api
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_BRAILLE_DISPLAY_PRIVATE_BRAILLE_CONTROLLER_H_
|