/src/libreoffice/sc/source/ui/inc/spellparam.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | #pragma once |
20 | | |
21 | | #include <vcl/font.hxx> |
22 | | |
23 | | /** Specifiers for sheet conversion (functions iterating over the sheet and modifying cells). */ |
24 | | enum ScConversionType |
25 | | { |
26 | | SC_CONVERSION_SPELLCHECK, /// Spell checker. |
27 | | SC_CONVERSION_HANGULHANJA, /// Hangul-Hanja converter. |
28 | | SC_CONVERSION_CHINESE_TRANSL /// Chinese simplified/traditional converter. |
29 | | }; |
30 | | |
31 | | /** Parameters for conversion. */ |
32 | | class ScConversionParam |
33 | | { |
34 | | public: |
35 | | /** Constructs an empty parameter struct with the passed conversion type. */ |
36 | | explicit ScConversionParam( ScConversionType eConvType ); |
37 | | |
38 | | /** Constructs parameter struct for text conversion without changing the language. */ |
39 | | explicit ScConversionParam( |
40 | | ScConversionType eConvType, |
41 | | LanguageType eLang, |
42 | | sal_Int32 nOptions, |
43 | | bool bIsInteractive ); |
44 | | |
45 | | /** Constructs parameter struct for text conversion with language change. */ |
46 | | explicit ScConversionParam( |
47 | | ScConversionType eConvType, |
48 | | LanguageType eSourceLang, |
49 | | LanguageType eTargetLang, |
50 | | vcl::Font aTargetFont, |
51 | | sal_Int32 nOptions, |
52 | | bool bIsInteractive ); |
53 | | |
54 | 0 | ScConversionType GetType() const { return meConvType; } |
55 | 0 | LanguageType GetSourceLang() const { return meSourceLang; } |
56 | 0 | LanguageType GetTargetLang() const { return meTargetLang; } |
57 | 0 | const vcl::Font* GetTargetFont() const { return mbUseTargetFont ? &maTargetFont : nullptr; } |
58 | 0 | sal_Int32 GetOptions() const { return mnOptions; } |
59 | 0 | bool IsInteractive() const { return mbIsInteractive; } |
60 | | |
61 | | private: |
62 | | ScConversionType meConvType; /// Type of the conversion. |
63 | | LanguageType meSourceLang; /// Source language for conversion. |
64 | | LanguageType meTargetLang; /// Target language for conversion. |
65 | | vcl::Font maTargetFont; /// Target font to be used if language has to be changed. |
66 | | sal_Int32 mnOptions; /// Conversion options. |
67 | | bool mbUseTargetFont; /// True = Use maTargetFont to change font during conversion. |
68 | | bool mbIsInteractive; /// True = Text conversion has (specific) dialog that may be raised. |
69 | | }; |
70 | | |
71 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |