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.
5 #ifndef CHROME_COMMON_SPELLCHECK_COMMON_H_
6 #define CHROME_COMMON_SPELLCHECK_COMMON_H_
16 namespace spellcheck_common
{
18 // The number of hours that a session of feedback for spelling service lasts.
19 // After this number of hours passes, all feedback.
20 static const int kSessionHours
= 6;
22 // The number of context words to keep on either side of a misspelling for
23 // spelling service feedback.
24 static const int kContextWordCount
= 2;
26 // The number of seconds between sending feedback to spelling service.
27 static const int kFeedbackIntervalSeconds
= 1800; // 30 minutes
29 // Max number of dictionary suggestions.
30 static const int kMaxSuggestions
= 5;
32 static const int kMaxAutoCorrectWordSize
= 8;
34 // Maximum number of words in the custom spellcheck dictionary that can be
36 static const size_t MAX_SYNCABLE_DICTIONARY_WORDS
= 1300;
38 // Maximum number of bytes in a word that can be added to the custom spellcheck
40 static const size_t MAX_CUSTOM_DICTIONARY_WORD_BYTES
= 99;
42 base::FilePath
GetVersionedFileName(const std::string
& input_language
,
43 const base::FilePath
& dict_dir
);
45 std::string
GetCorrespondingSpellCheckLanguage(const std::string
& language
);
47 // Get SpellChecker supported languages.
48 void SpellCheckLanguages(std::vector
<std::string
>* languages
);
50 // Gets the ISO codes for the language and country of this |locale|. The
51 // |locale| is an ISO locale ID that may not include a country ID, e.g., "fr" or
52 // "de". This method converts the UI locale to a full locale ID and converts the
53 // full locale ID to an ISO language code and an ISO3 country code.
54 void GetISOLanguageCountryCodeFromLocale(const std::string
& locale
,
55 std::string
* language_code
,
56 std::string
* country_code
);
58 } // namespace spellcheck_common
61 #endif // CHROME_COMMON_SPELLCHECK_COMMON_H_