| 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 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include <sal/config.h> |
| 23 | #include <svx/svxdllapi.h> |
| 24 | |
| 25 | #include <memory> |
| 26 | |
| 27 | #include <com/sun/star/awt/XWindow.hpp> |
| 28 | #include <cppuhelper/implbase.hxx> |
| 29 | #include <comphelper/interfacecontainer4.hxx> |
| 30 | #include <mutex> |
| 31 | |
| 32 | |
| 33 | namespace textconversiondlgs |
| 34 | { |
| 35 | |
| 36 | |
| 37 | /** This class provides the chinese translation dialog as a uno component. |
| 38 | |
| 39 | It can be created via lang::XMultiComponentFactory::createInstanceWithContext |
| 40 | with servicename "com.sun.star.linguistic2.ChineseTranslationDialog" |
| 41 | or implementation name "com.sun.star.comp.linguistic2.ChineseTranslationDialog" |
| 42 | |
| 43 | It can be initialized via the XInitialization interface with the following single parameter: |
| 44 | PropertyValue-Parameter: Name="ParentWindow" Type="awt::XWindow". |
| 45 | |
| 46 | It can be executed via the ui::dialogs::XExecutableDialog interface. |
| 47 | |
| 48 | Made settings can be retrieved via beans::XPropertySet interface. |
| 49 | Following properties are available (read only and not bound): |
| 50 | 1) Name="IsDirectionToSimplified" Type="sal_Bool" |
| 51 | 2) Name="IsTranslateCommonTerms" Type="sal_Bool" |
| 52 | |
| 53 | The dialog gets this information from the registry on execute and writes it back to the registry if ended with OK. |
| 54 | */ |
| 55 | |
| 56 | class ChineseTranslationDialog; |
| 57 | |
| 58 | // avoid LNK2005 duplicate WeakImplHelper definitions with MSVC |
| 59 | class SAL_DLLPUBLIC_TEMPLATE ChineseTranslation_UnoDialog_Base : public cppu::WeakImplHelper<> |
| 60 | { |
| 61 | }; |
| 62 | |
| 63 | class TEXTCONVERSIONDLGS_DLLPUBLIC ChineseTranslation_UnoDialog final : public ChineseTranslation_UnoDialog_Base |
| 64 | { |
| 65 | public: |
| 66 | ChineseTranslation_UnoDialog(const css::uno::Reference< css::awt::XWindow >& xParentWindow); |
| 67 | virtual ~ChineseTranslation_UnoDialog() override; |
| 68 | |
| 69 | sal_Int16 execute(); |
| 70 | |
| 71 | bool getIsDirectionToSimplified(); |
| 72 | bool getIsTranslateCommonTerms(); |
| 73 | |
| 74 | private: |
| 75 | |
| 76 | void impl_DeleteDialog(); |
| 77 | |
| 78 | private: |
| 79 | css::uno::Reference< css::awt::XWindow > m_xParentWindow; |
| 80 | |
| 81 | std::unique_ptr<ChineseTranslationDialog> m_xDialog; |
| 82 | }; |
| 83 | |
| 84 | |
| 85 | } //end namespace textconversiondlgs |
| 86 | |
| 87 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |