spelling_engine.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2012 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. #ifndef COMPONENTS_SPELLCHECK_RENDERER_SPELLING_ENGINE_H_
  5. #define COMPONENTS_SPELLCHECK_RENDERER_SPELLING_ENGINE_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/files/file.h"
  9. namespace service_manager {
  10. class LocalInterfaceProvider;
  11. }
  12. // Creates the platform's "native" spelling engine.
  13. class SpellingEngine* CreateNativeSpellingEngine(
  14. service_manager::LocalInterfaceProvider* embedder_provider);
  15. // Interface to different spelling engines.
  16. class SpellingEngine {
  17. public:
  18. virtual ~SpellingEngine() {}
  19. // Initialize spelling engine with browser-side info. Must be called before
  20. // any other functions are called.
  21. virtual void Init(base::File bdict_file) = 0;
  22. virtual bool InitializeIfNeeded() = 0;
  23. virtual bool IsEnabled() = 0;
  24. virtual bool CheckSpelling(const std::u16string& word_to_check, int tag) = 0;
  25. virtual void FillSuggestionList(
  26. const std::u16string& wrong_word,
  27. std::vector<std::u16string>* optional_suggestions) = 0;
  28. };
  29. #endif // COMPONENTS_SPELLCHECK_RENDERER_SPELLING_ENGINE_H_