bump product version to 7.2.5.1
[LibreOffice.git] / lingucomponent / source / spellcheck / macosxspell / macspellimp.hxx
blobdc9ad055d3bcb76199762d5ed9ae5545efcf8d65
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_MACOSXSPELL_MACSPELLIMP_HXX
21 #define INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_MACOSXSPELL_MACSPELLIMP_HXX
23 #include <cppuhelper/implbase.hxx>
25 #include <premac.h>
26 #ifdef MACOSX
27 #include <Carbon/Carbon.h>
28 #import <Cocoa/Cocoa.h>
29 #else
30 #include <UIKit/UIKit.h>
31 #endif
32 #include <postmac.h>
33 #include <com/sun/star/lang/XComponent.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/lang/XServiceDisplayName.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/linguistic2/XSpellChecker.hpp>
39 #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
41 #include <linguistic/misc.hxx>
42 #include <linguistic/lngprophelp.hxx>
44 #include <lingutil.hxx>
46 using namespace ::com::sun::star::uno;
47 using namespace ::com::sun::star::beans;
48 using namespace ::com::sun::star::lang;
49 using namespace ::com::sun::star::linguistic2;
51 class MacSpellChecker :
52 public cppu::WeakImplHelper
54 XSpellChecker,
55 XLinguServiceEventBroadcaster,
56 XInitialization,
57 XComponent,
58 XServiceInfo,
59 XServiceDisplayName
62 Sequence< Locale > aSuppLocales;
63 rtl_TextEncoding * aDEncs;
64 Locale * aDLocs;
65 OUString * aDNames;
66 sal_Int32 numdict;
67 #ifdef MACOSX
68 int macTag; // unique tag for this doc
69 #else
70 UITextChecker * pChecker;
71 #endif
72 ::comphelper::OInterfaceContainerHelper2 aEvtListeners;
73 rtl::Reference< linguistic::PropertyHelper_Spell > xPropHelper;
74 bool bDisposing;
76 MacSpellChecker(const MacSpellChecker &) = delete;
77 MacSpellChecker & operator = (const MacSpellChecker &) = delete;
79 linguistic::PropertyHelper_Spell & GetPropHelper_Impl();
80 linguistic::PropertyHelper_Spell & GetPropHelper()
82 return xPropHelper.is() ? *xPropHelper : GetPropHelper_Impl();
85 sal_Int16 GetSpellFailure( const OUString &rWord, const Locale &rLocale );
86 Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale );
88 public:
89 MacSpellChecker();
90 virtual ~MacSpellChecker() override;
92 // XSupportedLocales (for XSpellChecker)
93 virtual Sequence< Locale > SAL_CALL getLocales() override;
94 virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) override;
96 // XSpellChecker
97 virtual sal_Bool SAL_CALL isValid( const OUString& rWord, const Locale& rLocale, const css::uno::Sequence<PropertyValue>& rProperties ) override;
98 virtual Reference< XSpellAlternatives > SAL_CALL spell( const OUString& rWord, const Locale& rLocale, const css::uno::Sequence<PropertyValue>& rProperties ) override;
100 // XLinguServiceEventBroadcaster
101 virtual sal_Bool SAL_CALL addLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) override;
102 virtual sal_Bool SAL_CALL removeLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) override;
104 // XServiceDisplayName
105 virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) override;
107 // XInitialization
108 virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) override;
110 // XComponent
111 virtual void SAL_CALL dispose() override;
112 virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) override;
113 virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) override;
115 // XServiceInfo
116 virtual OUString SAL_CALL getImplementationName() override;
117 virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
118 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
121 #endif
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */