LCOV - code coverage report
Current view: top level - linguistic/inc - iprcache.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 3 0.0 %
Date: 2014-04-14 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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_LINGUISTIC_INC_IPRCACHE_HXX
      21             : #define INCLUDED_LINGUISTIC_INC_IPRCACHE_HXX
      22             : 
      23             : #include <cppuhelper/implbase2.hxx>
      24             : 
      25             : #include <com/sun/star/uno/Reference.h>
      26             : #include <com/sun/star/document/XEventListener.hpp>
      27             : #include <com/sun/star/beans/XPropertyChangeListener.hpp>
      28             : #include <com/sun/star/beans/XPropertySet.hpp>
      29             : #include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp>
      30             : #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
      31             : #include <com/sun/star/linguistic2/XLinguProperties.hpp>
      32             : 
      33             : #include <rtl/string.hxx>
      34             : #include <i18nlangtag/lang.h>
      35             : 
      36             : #include <set>
      37             : #include <map>
      38             : 
      39             : namespace linguistic
      40             : {
      41             : 
      42             : 
      43           0 : class Flushable
      44             : {
      45             : public:
      46             :     virtual void    Flush() = 0;
      47             : 
      48             : protected:
      49           0 :     ~Flushable() {}
      50             : };
      51             : 
      52             : 
      53             : class FlushListener :
      54             :     public cppu::WeakImplHelper2
      55             :     <
      56             :         ::com::sun::star::linguistic2::XDictionaryListEventListener,
      57             :         ::com::sun::star::beans::XPropertyChangeListener
      58             :     >
      59             : {
      60             :     ::com::sun::star::uno::Reference<
      61             :         ::com::sun::star::linguistic2::XSearchableDictionaryList >    xDicList;
      62             :     ::com::sun::star::uno::Reference<
      63             :         ::com::sun::star::linguistic2::XLinguProperties >             xPropSet;
      64             :     Flushable                                              *pFlushObj;
      65             : 
      66             :     // don't allow to use copy-constructor and assignment-operator
      67             :     FlushListener(const FlushListener &);
      68             :     FlushListener & operator = (const FlushListener &);
      69             : 
      70             : public:
      71             :     FlushListener( Flushable *pFO );
      72             :     virtual ~FlushListener();
      73             : 
      74           0 :     inline void SetFlushObj( Flushable *pFO)    { pFlushObj = pFO; }
      75             : 
      76             :     void        SetDicList( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > &rDL );
      77             :     void        SetPropSet( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguProperties > &rPS );
      78             : 
      79             :     //XEventListener
      80             :     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rSource ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      81             : 
      82             :     // XDictionaryListEventListener
      83             :     virtual void SAL_CALL processDictionaryListEvent( const ::com::sun::star::linguistic2::DictionaryListEvent& rDicListEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      84             : 
      85             :     // XPropertyChangeListener
      86             :     virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      87             : };
      88             : 
      89             : 
      90             : class SpellCache :
      91             :     public Flushable
      92             : {
      93             :     ::com::sun::star::uno::Reference<
      94             :         ::com::sun::star::linguistic2::XDictionaryListEventListener >
      95             :                         xFlushLstnr;
      96             :     FlushListener      *pFlushLstnr;
      97             : 
      98             :     typedef std::set< OUString >             WordList_t;
      99             :     typedef std::map< LanguageType, WordList_t >    LangWordList_t;
     100             :     LangWordList_t  aWordLists;
     101             : 
     102             :     // don't allow to use copy-constructor and assignment-operator
     103             :     SpellCache(const SpellCache &);
     104             :     SpellCache & operator = (const SpellCache &);
     105             : 
     106             : public:
     107             :     SpellCache();
     108             :     virtual ~SpellCache();
     109             : 
     110             :     // Flushable
     111             :     virtual void    Flush() SAL_OVERRIDE;
     112             : 
     113             :     void    AddWord( const OUString& rWord, LanguageType nLang );
     114             :     bool    CheckWord( const OUString& rWord, LanguageType nLang );
     115             : };
     116             : 
     117             : 
     118             : }   // namespace linguistic
     119             : 
     120             : #endif
     121             : 
     122             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10