summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker/spellcheck_profile_provider.h
blob: f0685d7206a234cbbf52e9c0de1334197db898f0 (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
// Copyright (c) 2011 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_SPELLCHECKER_SPELLCHECK_PROFILE_PROVIDER_H_
#define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_PROFILE_PROVIDER_H_
#pragma once

#include <string>
#include <vector>

// A user profile provider and state notification receiver for the
// SpellCheckHost.
class SpellCheckProfileProvider {
 public:
  typedef std::vector<std::string> CustomWordList;

  // Invoked on the UI thread when SpellCheckHost is initialized.
  virtual void SpellCheckHostInitialized(
      CustomWordList* custom_words) = 0;

  // Returns in-memory cache of custom word list.
  virtual const CustomWordList& GetCustomWords() const = 0;

  // Invoked on the Ui thread when new custom word is registered.
  virtual void CustomWordAddedLocally(const std::string& word) = 0;

  // Loads the custom dictionary associated with this profile
  virtual void LoadCustomDictionary(CustomWordList* custom_words) = 0;

  // Writes a word to the custom dictionary associated with this profile.
  virtual void WriteWordToCustomDictionary(const std::string& word) = 0;

 protected:
  virtual ~SpellCheckProfileProvider() {}
};

#endif  // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_PROFILE_PROVIDER_H_