LibreOffice Module lingucomponent (master)  1
macspellimp.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_MACOSXSPELL_MACSPELLIMP_HXX
21 #define INCLUDED_LINGUCOMPONENT_SOURCE_SPELLCHECK_MACOSXSPELL_MACSPELLIMP_HXX
22 
23 #include <cppuhelper/implbase.hxx>
24 
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>
40 
41 #include <linguistic/misc.hxx>
43 
44 #include <lingutil.hxx>
45 
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;
50 
52  public cppu::WeakImplHelper
53  <
54  XSpellChecker,
55  XLinguServiceEventBroadcaster,
56  XInitialization,
57  XComponent,
58  XServiceInfo,
59  XServiceDisplayName
60  >
61 {
62  Sequence< Locale > aSuppLocales;
63  rtl_TextEncoding * aDEncs;
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
74  bool bDisposing;
75 
76  MacSpellChecker(const MacSpellChecker &) = delete;
77  MacSpellChecker & operator = (const MacSpellChecker &) = delete;
78 
79  linguistic::PropertyHelper_Spell & GetPropHelper_Impl();
80  linguistic::PropertyHelper_Spell & GetPropHelper()
81  {
82  return xPropHelper.is() ? *xPropHelper : GetPropHelper_Impl();
83  }
84 
85  sal_Int16 GetSpellFailure( const OUString &rWord, const Locale &rLocale );
86  Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale );
87 
88 public:
90  virtual ~MacSpellChecker() override;
91 
92  // XSupportedLocales (for XSpellChecker)
93  virtual Sequence< Locale > SAL_CALL getLocales() override;
94  virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) override;
95 
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;
99 
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;
103 
104  // XServiceDisplayName
105  virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) override;
106 
107  // XInitialization
108  virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) override;
109 
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;
114 
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;
119 };
120 
121 #endif
122 
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getImplementationName() override
Definition: macspellimp.mm:618
sal_Int32 numdict
Definition: macspellimp.hxx:66
virtual OUString SAL_CALL getServiceDisplayName(const Locale &rLocale) override
Definition: macspellimp.mm:549
virtual ~MacSpellChecker() override
Definition: macspellimp.mm:67
virtual Sequence< Locale > SAL_CALL getLocales() override
Definition: macspellimp.mm:94
virtual sal_Bool SAL_CALL hasLocale(const Locale &rLocale) override
Definition: macspellimp.mm:306
linguistic::PropertyHelper_Spell & GetPropHelper()
Definition: macspellimp.hxx:80
virtual sal_Bool SAL_CALL addLinguServiceEventListener(const Reference< XLinguServiceEventListener > &rxLstnr) override
Definition: macspellimp.mm:518
virtual void SAL_CALL dispose() override
Definition: macspellimp.mm:585
virtual void SAL_CALL initialize(const Sequence< Any > &rArguments) override
Definition: macspellimp.mm:557
UITextChecker * pChecker
Definition: macspellimp.hxx:70
virtual Reference< XSpellAlternatives > SAL_CALL spell(const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< PropertyValue > &rProperties) override
Definition: macspellimp.mm:498
Reference< XSpellAlternatives > GetProposals(const OUString &rWord, const Locale &rLocale)
Definition: macspellimp.mm:429
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: macspellimp.mm:623
linguistic::PropertyHelper_Spell & GetPropHelper_Impl()
Definition: macspellimp.mm:81
rtl_TextEncoding * aDEncs
Definition: macspellimp.hxx:63
virtual void SAL_CALL addEventListener(const Reference< XEventListener > &rxListener) override
Definition: macspellimp.mm:599
virtual sal_Bool SAL_CALL removeLinguServiceEventListener(const Reference< XLinguServiceEventListener > &rxLstnr) override
Definition: macspellimp.mm:533
sal_Int16 GetSpellFailure(const OUString &rWord, const Locale &rLocale)
Definition: macspellimp.mm:328
unsigned char sal_Bool
::comphelper::OInterfaceContainerHelper2 aEvtListeners
Definition: macspellimp.hxx:72
OUString * aDNames
Definition: macspellimp.hxx:65
rtl::Reference< linguistic::PropertyHelper_Spell > xPropHelper
Definition: macspellimp.hxx:73
Sequence< Locale > aSuppLocales
Definition: macspellimp.hxx:62
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: macspellimp.mm:628
virtual void SAL_CALL removeEventListener(const Reference< XEventListener > &rxListener) override
Definition: macspellimp.mm:609
MacSpellChecker & operator=(const MacSpellChecker &)=delete
virtual sal_Bool SAL_CALL isValid(const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< PropertyValue > &rProperties) override
Definition: macspellimp.mm:391