xref: /aoo41x/main/sc/source/ui/inc/spellparam.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef SC_SPELLPARAM_HXX
28 #define SC_SPELLPARAM_HXX
29 
30 #include <vcl/font.hxx>
31 
32 // ============================================================================
33 
34 /** Specifiers for sheet conversion (functions iterating over the sheet and modifying cells). */
35 enum ScConversionType
36 {
37     SC_CONVERSION_SPELLCHECK,       /// Spell checker.
38     SC_CONVERSION_HANGULHANJA,      /// Hangul-Hanja converter.
39     SC_CONVERSION_CHINESE_TRANSL    /// Chinese simplified/traditional converter.
40 };
41 
42 // ---------------------------------------------------------------------------
43 
44 /** Parameters for conversion. */
45 class ScConversionParam
46 {
47 public:
48     /** Constructs an empty parameter struct with the passed conversion type. */
49     explicit            ScConversionParam( ScConversionType eConvType );
50 
51     /** Constructs parameter struct for text conversion without changing the language. */
52     explicit            ScConversionParam(
53                             ScConversionType eConvType,
54                             LanguageType eLang,
55                             sal_Int32 nOptions,
56                             bool bIsInteractive );
57 
58     /** Constructs parameter struct for text conversion with language change. */
59     explicit            ScConversionParam(
60                             ScConversionType eConvType,
61                             LanguageType eSourceLang,
62                             LanguageType eTargetLang,
63                             const Font& rTargetFont,
64                             sal_Int32 nOptions,
65                             bool bIsInteractive );
66 
67     inline ScConversionType GetType() const     { return meConvType; }
68     inline LanguageType GetSourceLang() const   { return meSourceLang; }
69     inline LanguageType GetTargetLang() const   { return meTargetLang; }
70     inline const Font*  GetTargetFont() const   { return mbUseTargetFont ? &maTargetFont : 0; }
71     inline sal_Int32    GetOptions() const      { return mnOptions; }
72     inline bool         IsInteractive() const   { return mbIsInteractive; }
73 
74 private:
75     ScConversionType    meConvType;         /// Type of the conversion.
76     LanguageType        meSourceLang;       /// Source language for conversion.
77     LanguageType        meTargetLang;       /// Target language for conversion.
78     Font                maTargetFont;       /// Target font to be used if language has to be changed.
79     sal_Int32           mnOptions;          /// Conversion options.
80     bool                mbUseTargetFont;    /// True = Use maTargetFont to change font during conversion.
81     bool                mbIsInteractive;    /// True = Text conversion has (specific) dialog that may be raised.
82 };
83 
84 // ============================================================================
85 
86 #endif
87 
88