summaryrefslogtreecommitdiff
path: root/linguistic/inc
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-12-15 12:01:46 +0000
committerRüdiger Timm <rt@openoffice.org>2008-12-15 12:01:46 +0000
commitbd14d6bc197144d99ab8339f7d018d2a4678f610 (patch)
treeeaef7aee129df80b32e6e61cb385a5a5ad7fb4b7 /linguistic/inc
parent095c77393155dfac5bbf3a62a5fdcabc6f0f93f2 (diff)
CWS-TOOLING: integrate CWS tl56_DEV300
Diffstat (limited to 'linguistic/inc')
-rw-r--r--linguistic/inc/iprcache.hxx67
-rw-r--r--linguistic/inc/lngprops.hxx6
-rw-r--r--linguistic/inc/misc.hxx3
-rw-r--r--linguistic/inc/spelldta.hxx32
-rw-r--r--linguistic/inc/supplang.hxx115
5 files changed, 41 insertions, 182 deletions
diff --git a/linguistic/inc/iprcache.hxx b/linguistic/inc/iprcache.hxx
index d0be97480749..0b6fdaad2547 100644
--- a/linguistic/inc/iprcache.hxx
+++ b/linguistic/inc/iprcache.hxx
@@ -32,24 +32,25 @@
#define _LINGUISTIC_IPRCACHE_HXX_
-#include <com/sun/star/uno/Reference.h>
-
#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
#include <cppuhelper/implbase2.hxx> // helper for implementations
+
+#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-
#include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp>
#include <com/sun/star/linguistic2/XDictionaryList.hpp>
-#include <tools/string.hxx>
+#include <rtl/string.hxx>
+#include <i18npool/lang.h>
+
+#include <set>
+#include <map>
namespace linguistic
{
-class IPRCachedWord;
-
///////////////////////////////////////////////////////////////////////////
class Flushable
@@ -83,33 +84,22 @@ public:
inline void SetFlushObj( Flushable *pFO) { pFlushObj = pFO; }
- void SetDicList(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XDictionaryList > &rDL );
- void SetPropSet(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet > &rPS );
+ void SetDicList( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &rDL );
+ void SetPropSet( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &rPS );
//XEventListener
- virtual void SAL_CALL
- disposing( const ::com::sun::star::lang::EventObject& rSource )
- throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rSource ) throw(::com::sun::star::uno::RuntimeException);
// XDictionaryListEventListener
- virtual void SAL_CALL
- processDictionaryListEvent(
- const ::com::sun::star::linguistic2::DictionaryListEvent& rDicListEvent )
- throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processDictionaryListEvent( const ::com::sun::star::linguistic2::DictionaryListEvent& rDicListEvent ) throw(::com::sun::star::uno::RuntimeException);
// XPropertyChangeListener
- virtual void SAL_CALL
- propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt )
- throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) throw(::com::sun::star::uno::RuntimeException);
};
///////////////////////////////////////////////////////////////////////////
-class IPRSpellCache :
+class SpellCache :
public Flushable
{
::com::sun::star::uno::Reference<
@@ -117,36 +107,23 @@ class IPRSpellCache :
xFlushLstnr;
FlushListener *pFlushLstnr;
- IPRCachedWord **ppHash;
- IPRCachedWord *pFirst;
- IPRCachedWord *pLast;
- IPRCachedWord *pRun;
- IPRCachedWord *pInput;
- ULONG nIndex;
- ULONG nCount;
- ULONG nInputPos;
- ULONG nInputValue;
- ULONG nTblSize;
-#ifdef DBG_STATISTIC
- ULONG nMaxInput;
- ULONG nMax;
- ULONG nFound;
- ULONG nLost;
-#endif
+ typedef std::set< ::rtl::OUString > WordList_t;
+ typedef std::map< LanguageType, WordList_t > LangWordList_t;
+ LangWordList_t aWordLists;
// don't allow to use copy-constructor and assignment-operator
- IPRSpellCache(const IPRSpellCache &);
- IPRSpellCache & operator = (const IPRSpellCache &);
+ SpellCache(const SpellCache &);
+ SpellCache & operator = (const SpellCache &);
public:
- IPRSpellCache( ULONG nSize );
- virtual ~IPRSpellCache();
+ SpellCache();
+ virtual ~SpellCache();
// Flushable
virtual void Flush();
- void AddWord( const String& rWord, INT16 nLang );
- BOOL CheckWord( const String& rWord, INT16 nLang, BOOL bAllLang );
+ void AddWord( const ::rtl::OUString& rWord, LanguageType nLang );
+ bool CheckWord( const ::rtl::OUString& rWord, LanguageType nLang );
};
///////////////////////////////////////////////////////////////////////////
diff --git a/linguistic/inc/lngprops.hxx b/linguistic/inc/lngprops.hxx
index 48948bdb1a38..2714c439d18e 100644
--- a/linguistic/inc/lngprops.hxx
+++ b/linguistic/inc/lngprops.hxx
@@ -40,7 +40,7 @@
// WIDs for property names
//!! Don't change values! They are used as the property handles in
//!! the service description
-#define WID_IS_GERMAN_PRE_REFORM UPH_IS_GERMAN_PRE_REFORM
+#define WID_IS_GERMAN_PRE_REFORM UPH_IS_GERMAN_PRE_REFORM /*! deprecated !*/
#define WID_IS_USE_DICTIONARY_LIST UPH_IS_USE_DICTIONARY_LIST
#define WID_IS_IGNORE_CONTROL_CHARACTERS UPH_IS_IGNORE_CONTROL_CHARACTERS
#define WID_IS_SPELL_UPPER_CASE UPH_IS_SPELL_UPPER_CASE
@@ -51,8 +51,8 @@
#define WID_HYPH_MIN_WORD_LENGTH UPH_HYPH_MIN_WORD_LENGTH
#define WID_DEFAULT_LOCALE UPH_DEFAULT_LOCALE
#define WID_IS_SPELL_AUTO UPH_IS_SPELL_AUTO
-#define WID_IS_SPELL_HIDE UPH_IS_SPELL_HIDE
-#define WID_IS_SPELL_IN_ALL_LANGUAGES UPH_IS_SPELL_IN_ALL_LANGUAGES
+#define WID_IS_SPELL_HIDE UPH_IS_SPELL_HIDE /*! deprecated !*/
+#define WID_IS_SPELL_IN_ALL_LANGUAGES UPH_IS_SPELL_IN_ALL_LANGUAGES /*! deprecated !*/
#define WID_IS_SPELL_SPECIAL UPH_IS_SPELL_SPECIAL
#define WID_IS_HYPH_AUTO UPH_IS_HYPH_AUTO
#define WID_IS_HYPH_SPECIAL UPH_IS_HYPH_SPECIAL
diff --git a/linguistic/inc/misc.hxx b/linguistic/inc/misc.hxx
index 55d9fadad387..f9565f2eb873 100644
--- a/linguistic/inc/misc.hxx
+++ b/linguistic/inc/misc.hxx
@@ -64,7 +64,8 @@ namespace com { namespace sun { namespace star { namespace frame {
class LocaleDataWrapper;
///////////////////////////////////////////////////////////////////////////
-#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.GrammarChecker"
+#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader"
+#define SN_GRAMMARCHECKINGITERATOR "com.sun.star.linguistic2.ProofreadingIterator"
#define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker"
#define SN_HYPHENATOR "com.sun.star.linguistic2.Hyphenator"
#define SN_THESAURUS "com.sun.star.linguistic2.Thesaurus"
diff --git a/linguistic/inc/spelldta.hxx b/linguistic/inc/spelldta.hxx
index 356ac4edcd80..559a58e32348 100644
--- a/linguistic/inc/spelldta.hxx
+++ b/linguistic/inc/spelldta.hxx
@@ -33,11 +33,12 @@
#include <vector>
#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
+#include <com/sun/star/linguistic2/XSetSpellAlternatives.hpp>
#include <tools/solar.h>
#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
-#include <cppuhelper/implbase1.hxx> // helper for implementations
+#include <cppuhelper/implbase2.hxx>
namespace com { namespace sun { namespace star {
namespace linguistic2 {
@@ -86,9 +87,10 @@ void SearchSimilarText( const rtl::OUString &rText, INT16 nLanguage,
class SpellAlternatives :
- public cppu::WeakImplHelper1
+ public cppu::WeakImplHelper2
<
- ::com::sun::star::linguistic2::XSpellAlternatives
+ ::com::sun::star::linguistic2::XSpellAlternatives,
+ ::com::sun::star::linguistic2::XSetSpellAlternatives
>
{
::com::sun::star::uno::Sequence< ::rtl::OUString > aAlt; // list of alternatives, may be empty.
@@ -109,21 +111,15 @@ public:
virtual ~SpellAlternatives();
// XSpellAlternatives
- virtual ::rtl::OUString SAL_CALL
- getWord()
- throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::lang::Locale SAL_CALL
- getLocale()
- throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL
- getFailureType()
- throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int16 SAL_CALL
- getAlternativesCount()
- throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
- getAlternatives()
- throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getWord( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getFailureType( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getAlternativesCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAlternatives( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XSetSpellAlternatives
+ virtual void SAL_CALL setAlternatives( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAlternatives ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFailureType( ::sal_Int16 nFailureType ) throw (::com::sun::star::uno::RuntimeException);
// non-interface specific functions
void SetWordLanguage(const ::rtl::OUString &rWord, INT16 nLang);
diff --git a/linguistic/inc/supplang.hxx b/linguistic/inc/supplang.hxx
deleted file mode 100644
index 1d13b3064e39..000000000000
--- a/linguistic/inc/supplang.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: supplang.hxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _LINGUISTIC_SUPPLANG_HXX_
-#define _LINGUISTIC_SUPPLANG_HXX_
-
-#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
-#include <cppuhelper/implbase1.hxx> // helper for implementations
-
-
-#include <osl/mutex.hxx>
-#include <tools/string.hxx>
-#include <tools/table.hxx>
-#include <vcl/svapp.hxx>
-#include <osl/thread.h>
-#include <unotools/charclass.hxx>
-
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/beans/PropertyValues.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <com/sun/star/beans/PropertyValues.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/linguistic2/XDictionaryEntry.hpp>
-#include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
-
-namespace com { namespace sun { namespace star { namespace beans {
- class XPropertySet;
- class XFastPropertySet;
-}}}}
-
-namespace com { namespace sun { namespace star { namespace frame {
- class XDesktop;
-}}}}
-
-
-namespace linguistic
-{
-
-///////////////////////////////////////////////////////////////////////////
-
-// defines for actual state (availability) of languages
-#define LANG_NOT_AVAIL ((short) 0x0303)
-#define LANG_QUERY ((short) 0x5555)
-#define LANG_FAILED ((short) 0)
-#define LANG_OK ((short) 1)
-
-enum ModuleName { MOD_SPELL, MOD_HYPH, MOD_THES };
-
-struct LanguageState
-{
- INT16 nLanguage;
- INT16 nSpellState;
- INT16 nHyphState;
- INT16 nThesState;
-
- INT16 & GetState( ModuleName eModule );
-};
-
-LanguageState * GetLanguageState( INT16 nLanguage, LanguageState *pArray );
-
-///////////////////////////////////////////////////////////////////////////
-
-DECLARE_TABLE( SuppLangTable, INT16 * )
-
-class SuppLanguages
-{
- SuppLangTable aLanguages;
-
-protected:
- virtual INT16 CheckLanguage( INT16 nLanguage ) const = 0;
-
-public:
- SuppLanguages( LanguageState *pState, USHORT nCount );
- virtual ~SuppLanguages();
-
- BOOL HasLanguage( INT16 nLanguage ) const;
- const com::sun::star::uno::Sequence< INT16 >
- GetLanguages() const;
-};
-
-///////////////////////////////////////////////////////////////////////////
-
-} // namespace linguistic
-
-#endif
-