LibreOffice Module sw (master) 1
translatelangselect.hxx
Go to the documentation of this file.
1
2/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3/*
4 * This file is part of the LibreOffice project.
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 *
10 * This file incorporates work covered by the following license notice:
11 *
12 * Licensed to the Apache Software Foundation (ASF) under one or more
13 * contributor license agreements. See the NOTICE file distributed
14 * with this work for additional information regarding copyright
15 * ownership. The ASF licenses this file to you under the Apache
16 * License, Version 2.0 (the "License"); you may not use this file
17 * except in compliance with the License. You may obtain a copy of
18 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 */
20#pragma once
21#include <vcl/weld.hxx>
22#include <rtl/string.h>
23#include <vector>
24#include <optional>
25#include "translatehelper.hxx"
26
27class SwWrtShell;
28
29// SwLanguageListItem Helper class for displaying available languages with their names and tags on the listbox.
31{
32public:
33 SwLanguageListItem(const OString& sLanguage, const OString& sName)
34 : m_sLanguage(sLanguage)
35 , m_sName(sName)
36 {
37 }
38 const OString& getLanguage() const { return m_sLanguage; }
39 const OString& getName() const { return m_sName; }
40
41private:
42 const OString m_sLanguage;
43 const OString m_sName;
44};
45
46// SwTranslateLangSelectDlg Language selection dialog for translation API.
48{
49public:
50 static int selectedLangIdx;
52 static std::optional<SwLanguageListItem> GetSelectedLanguage();
53
54private:
56 std::unique_ptr<weld::ComboBox> m_xLanguageListBox;
57 std::unique_ptr<weld::Button> m_xBtnCancel;
58 std::unique_ptr<weld::Button> m_xBtnTranslate;
59
62
64 DECL_LINK(LangSelectCancelHdl, weld::Button&, void);
65 DECL_LINK(LangSelectTranslateHdl, weld::Button&, void);
66};
67
68/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OString & getName() const
const OString & getLanguage() const
SwLanguageListItem(const OString &sLanguage, const OString &sName)
std::unique_ptr< weld::ComboBox > m_xLanguageListBox
DECL_LINK(LangSelectTranslateHdl, weld::Button &, void)
static std::optional< SwLanguageListItem > GetSelectedLanguage()
SwTranslateLangSelectDlg(weld::Window *pParent, SwWrtShell &rSh)
std::unique_ptr< weld::Button > m_xBtnTranslate
std::unique_ptr< weld::Button > m_xBtnCancel
DECL_LINK(LangSelectCancelHdl, weld::Button &, void)
DECL_STATIC_LINK(SwTranslateLangSelectDlg, LangSelectHdl, weld::ComboBox &, void)
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
OUString sName