xref: /trunk/main/sc/source/ui/inc/spellparam.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SC_SPELLPARAM_HXX
24 #define SC_SPELLPARAM_HXX
25 
26 #include <vcl/font.hxx>
27 
28 // ============================================================================
29 
30 /** Specifiers for sheet conversion (functions iterating over the sheet and modifying cells). */
31 enum ScConversionType
32 {
33     SC_CONVERSION_SPELLCHECK,       /// Spell checker.
34     SC_CONVERSION_HANGULHANJA,      /// Hangul-Hanja converter.
35     SC_CONVERSION_CHINESE_TRANSL    /// Chinese simplified/traditional converter.
36 };
37 
38 // ---------------------------------------------------------------------------
39 
40 /** Parameters for conversion. */
41 class ScConversionParam
42 {
43 public:
44     /** Constructs an empty parameter struct with the passed conversion type. */
45     explicit            ScConversionParam( ScConversionType eConvType );
46 
47     /** Constructs parameter struct for text conversion without changing the language. */
48     explicit            ScConversionParam(
49                             ScConversionType eConvType,
50                             LanguageType eLang,
51                             sal_Int32 nOptions,
52                             bool bIsInteractive );
53 
54     /** Constructs parameter struct for text conversion with language change. */
55     explicit            ScConversionParam(
56                             ScConversionType eConvType,
57                             LanguageType eSourceLang,
58                             LanguageType eTargetLang,
59                             const Font& rTargetFont,
60                             sal_Int32 nOptions,
61                             bool bIsInteractive );
62 
GetType() const63     inline ScConversionType GetType() const     { return meConvType; }
GetSourceLang() const64     inline LanguageType GetSourceLang() const   { return meSourceLang; }
GetTargetLang() const65     inline LanguageType GetTargetLang() const   { return meTargetLang; }
GetTargetFont() const66     inline const Font*  GetTargetFont() const   { return mbUseTargetFont ? &maTargetFont : 0; }
GetOptions() const67     inline sal_Int32    GetOptions() const      { return mnOptions; }
IsInteractive() const68     inline bool         IsInteractive() const   { return mbIsInteractive; }
69 
70 private:
71     ScConversionType    meConvType;         /// Type of the conversion.
72     LanguageType        meSourceLang;       /// Source language for conversion.
73     LanguageType        meTargetLang;       /// Target language for conversion.
74     Font                maTargetFont;       /// Target font to be used if language has to be changed.
75     sal_Int32           mnOptions;          /// Conversion options.
76     bool                mbUseTargetFont;    /// True = Use maTargetFont to change font during conversion.
77     bool                mbIsInteractive;    /// True = Text conversion has (specific) dialog that may be raised.
78 };
79 
80 // ============================================================================
81 
82 #endif
83 
84