1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_LINGUISTIC_WORKBEN_SSPELLIMP_HXX
21 #define INCLUDED_LINGUISTIC_WORKBEN_SSPELLIMP_HXX
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/lang/XComponent.hpp>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/lang/XServiceDisplayName.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/PropertyValues.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/linguistic2/XSpellChecker.hpp>
31 #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
32 #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
34 #include "linguistic/misc.hxx"
35 #include "sprophelp.hxx"
37 using namespace ::com::sun::star::uno
;
38 using namespace ::com::sun::star::beans
;
39 using namespace ::com::sun::star::lang
;
40 using namespace ::com::sun::star::linguistic2
;
44 public cppu::WeakImplHelper
47 XLinguServiceEventBroadcaster
,
54 Sequence
< Locale
> aSuppLocales
;
55 ::comphelper::OInterfaceContainerHelper2 aEvtListeners
;
56 Reference
< XPropertyChangeListener
> xPropHelper
;
57 PropertyHelper_Spell
* pPropHelper
;
60 // disallow copy-constructor and assignment-operator for now
61 SpellChecker(const SpellChecker
&);
62 SpellChecker
& operator = (const SpellChecker
&);
64 PropertyHelper_Spell
& GetPropHelper_Impl();
65 PropertyHelper_Spell
& GetPropHelper()
67 return pPropHelper
? *pPropHelper
: GetPropHelper_Impl();
70 sal_Int16
GetSpellFailure( const OUString
&rWord
, const Locale
&rLocale
);
71 Reference
< XSpellAlternatives
>
72 GetProposals( const OUString
&rWord
, const Locale
&rLocale
);
76 virtual ~SpellChecker();
78 // XSupportedLocales (for XSpellChecker)
79 virtual Sequence
< Locale
> SAL_CALL
81 throw(RuntimeException
);
82 virtual sal_Bool SAL_CALL
83 hasLocale( const Locale
& rLocale
)
84 throw(RuntimeException
);
87 virtual sal_Bool SAL_CALL
88 isValid( const OUString
& rWord
, const Locale
& rLocale
,
89 const PropertyValues
& rProperties
)
90 throw(IllegalArgumentException
,
92 virtual Reference
< XSpellAlternatives
> SAL_CALL
93 spell( const OUString
& rWord
, const Locale
& rLocale
,
94 const PropertyValues
& rProperties
)
95 throw(IllegalArgumentException
,
98 // XLinguServiceEventBroadcaster
99 virtual sal_Bool SAL_CALL
100 addLinguServiceEventListener(
101 const Reference
< XLinguServiceEventListener
>& rxLstnr
)
102 throw(RuntimeException
);
103 virtual sal_Bool SAL_CALL
104 removeLinguServiceEventListener(
105 const Reference
< XLinguServiceEventListener
>& rxLstnr
)
106 throw(RuntimeException
);
108 // XServiceDisplayName
109 virtual OUString SAL_CALL
110 getServiceDisplayName( const Locale
& rLocale
)
111 throw(RuntimeException
);
114 virtual void SAL_CALL
115 initialize( const Sequence
< Any
>& rArguments
)
116 throw(Exception
, RuntimeException
);
119 virtual void SAL_CALL
121 throw(RuntimeException
);
122 virtual void SAL_CALL
123 addEventListener( const Reference
< XEventListener
>& rxListener
)
124 throw(RuntimeException
);
125 virtual void SAL_CALL
126 removeEventListener( const Reference
< XEventListener
>& rxListener
)
127 throw(RuntimeException
);
129 // Service specific part
132 virtual OUString SAL_CALL
133 getImplementationName()
134 throw(RuntimeException
);
135 virtual sal_Bool SAL_CALL
136 supportsService( const OUString
& rServiceName
)
137 throw(RuntimeException
);
138 virtual Sequence
< OUString
> SAL_CALL
139 getSupportedServiceNames()
140 throw(RuntimeException
);
143 static inline OUString
144 getImplementationName_Static() throw();
145 static Sequence
< OUString
>
146 getSupportedServiceNames_Static() throw();
149 inline OUString
SpellChecker::getImplementationName_Static() throw()
151 return OUString( "com.sun.star.lingu.examples.SpellChecker" );
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */