Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * Version: MPL 1.1 / GPLv3+ / LGPLv3+
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Initial Developer of the Original Code is
16 : * Caolán McNamara <caolanm@redhat.com>
17 : *
18 : * Contributor(s):
19 : * Caolán McNamara <caolanm@redhat.com>
20 : * Dózsa Bálint <dozsa@linux-dugf.site>
21 : *
22 : * Alternatively, the contents of this file may be used under the terms of
23 : * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 : * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 : * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 : * instead of those above.
27 : */
28 :
29 :
30 : #include "unotools/caserotate.hxx"
31 : #include <com/sun/star/i18n/TransliterationModules.hpp>
32 : #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
33 :
34 : //TODO Use XCharacterClassification::getStringType to determine the current
35 : //(possibly mixed) case type and rotate to the next one
36 :
37 0 : sal_uInt32 RotateTransliteration::getNextMode()
38 : {
39 : using namespace ::com::sun::star::i18n;
40 :
41 0 : sal_uInt32 nMode = 0;
42 :
43 0 : switch (nF3ShiftCounter)
44 : {
45 : case 0:
46 0 : nMode = TransliterationModulesExtra::TITLE_CASE;
47 0 : break;
48 : case 1:
49 0 : nMode = TransliterationModules_LOWERCASE_UPPERCASE;
50 0 : break;
51 : default:
52 : case 2:
53 0 : nMode = TransliterationModules_UPPERCASE_LOWERCASE;
54 0 : nF3ShiftCounter = -1;
55 0 : break;
56 : }
57 :
58 0 : nF3ShiftCounter++;
59 :
60 0 : return nMode;
61 : }
62 :
63 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|