platform_spellcheck.h 1017 B

123456789101112131415161718192021222324252627282930313233343536
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. #include "spellcheck/spellcheck_types.h"
  9. #include "spellcheck/spellcheck_utils.h"
  10. namespace Platform::Spellchecker {
  11. constexpr auto kMaxSuggestions = 5;
  12. [[nodiscard]] bool IsSystemSpellchecker();
  13. [[nodiscard]] bool CheckSpelling(const QString &wordToCheck);
  14. [[nodiscard]] bool IsWordInDictionary(const QString &wordToCheck);
  15. void Init();
  16. std::vector<QString> ActiveLanguages();
  17. void FillSuggestionList(
  18. const QString &wrongWord,
  19. std::vector<QString> *optionalSuggestions);
  20. void AddWord(const QString &word);
  21. void RemoveWord(const QString &word);
  22. void IgnoreWord(const QString &word);
  23. void CheckSpellingText(
  24. const QString &text,
  25. MisspelledWords *misspelledWords);
  26. void UpdateLanguages(std::vector<int> languages);
  27. } // namespace Platform::Spellchecker