LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/linguistic - misc.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1 0.0 %
Date: 2012-12-27 Functions: 0 1 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 _LINGUISTIC_MISC_HXX_
      21             : #define _LINGUISTIC_MISC_HXX_
      22             : 
      23             : #include <com/sun/star/uno/Sequence.h>
      24             : #include <com/sun/star/uno/Reference.h>
      25             : #include <com/sun/star/beans/PropertyValues.hpp>
      26             : #include <com/sun/star/frame/XTerminateListener.hpp>
      27             : #include <com/sun/star/lang/Locale.hpp>
      28             : #include <com/sun/star/lang/XComponent.hpp>
      29             : #include <com/sun/star/linguistic2/XDictionaryEntry.hpp>
      30             : #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
      31             : #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
      32             : 
      33             : #include <uno/lbnames.h>            // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
      34             : #include <cppuhelper/implbase1.hxx> // helper for implementations
      35             : #include <unotools/pathoptions.hxx>
      36             : #include <i18npool/lang.h>
      37             : #include <tools/string.hxx>
      38             : #include <unotools/charclass.hxx>
      39             : #include <osl/thread.h>
      40             : #include <osl/mutex.hxx>
      41             : #include <linguistic/lngdllapi.h>
      42             : 
      43             : namespace com { namespace sun { namespace star { namespace beans {
      44             :     class XPropertySet;
      45             :     class XFastPropertySet;
      46             : }}}}
      47             : 
      48             : namespace com { namespace sun { namespace star { namespace frame {
      49             :     class XDesktop2;
      50             : }}}}
      51             : 
      52             : class LocaleDataWrapper;
      53             : 
      54             : 
      55             : #define SN_GRAMMARCHECKER           "com.sun.star.linguistic2.Proofreader"
      56             : #define SN_GRAMMARCHECKINGITERATOR  "com.sun.star.linguistic2.ProofreadingIterator"
      57             : #define SN_SPELLCHECKER             "com.sun.star.linguistic2.SpellChecker"
      58             : #define SN_HYPHENATOR               "com.sun.star.linguistic2.Hyphenator"
      59             : #define SN_THESAURUS                "com.sun.star.linguistic2.Thesaurus"
      60             : #define SN_LINGU_PROPERTIES         "com.sun.star.linguistic2.LinguProperties"
      61             : #define SN_DICTIONARY_LIST          "com.sun.star.linguistic2.DictionaryList"
      62             : 
      63             : 
      64             : namespace linguistic
      65             : {
      66             : 
      67             : // ascii to OUString conversion
      68             : #define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x ))
      69             : 
      70             : /// Flags to be used with the multi-path related functions
      71             : /// @see GetDictionaryPaths
      72             : #define PATH_FLAG_INTERNAL  0x01
      73             : #define PATH_FLAG_USER      0x02
      74             : #define PATH_FLAG_WRITABLE  0x04
      75             : #define PATH_FLAG_ALL       (PATH_FLAG_INTERNAL | PATH_FLAG_USER | PATH_FLAG_WRITABLE)
      76             : 
      77             : 
      78             : // AddEntryToDic return values
      79             : #define DIC_ERR_NONE        0
      80             : #define DIC_ERR_FULL        1
      81             : #define DIC_ERR_READONLY    2
      82             : #define DIC_ERR_UNKNOWN     3
      83             : #define DIC_ERR_NOT_EXISTS  4
      84             : 
      85             : // values asigned to capitalization types
      86             : enum CapType
      87             : {
      88             :     CAPTYPE_UNKNOWN,
      89             :     CAPTYPE_NOCAP,
      90             :     CAPTYPE_INITCAP,
      91             :     CAPTYPE_ALLCAP,
      92             :     CAPTYPE_MIXED
      93             : };
      94             : 
      95             : LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex();
      96             : 
      97             : LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang );
      98             : 
      99             : sal_Int32 LevDistance( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 );
     100             : 
     101             : ::com::sun::star::uno::Sequence< sal_Int16 >
     102             :     LocaleSeqToLangSeq( ::com::sun::star::uno::Sequence<
     103             :         ::com::sun::star::lang::Locale > &rLocaleSeq );
     104             : 
     105             : // checks if file pointed to by rURL is readonly
     106             : // and may also check return if such a file exists or not
     107             : sal_Bool    IsReadOnly( const String &rURL, sal_Bool *pbExist = 0 );
     108             : 
     109             : // checks if a file with the given URL exists
     110             : sal_Bool    FileExists( const String &rURL );
     111             : 
     112             : 
     113             : ::rtl::OUString     GetDictionaryWriteablePath();
     114             : ::com::sun::star::uno::Sequence< ::rtl::OUString > GetDictionaryPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL );
     115             : 
     116             : /// @returns an URL for a new and writable dictionary rDicName.
     117             : ///     The URL will point to the path given by 'GetDictionaryWriteablePath'
     118             : LNG_DLLPUBLIC String  GetWritableDictionaryURL( const String &rDicName );
     119             : 
     120             : LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int32 nPos );
     121             : 
     122             : ::com::sun::star::uno::Reference<
     123             :     ::com::sun::star::linguistic2::XHyphenatedWord >
     124             :             RebuildHyphensAndControlChars( const rtl::OUString &rOrigWord,
     125             :                 ::com::sun::star::uno::Reference<
     126             :                     ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord );
     127             : 
     128             : 
     129             : LNG_DLLPUBLIC sal_Bool        IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage );
     130             : 
     131           0 : inline sal_Bool        IsUpper( const String &rText, sal_Int16 nLanguage )     { return IsUpper( rText, 0, rText.Len(), nLanguage ); }
     132             : LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *);
     133             : 
     134             : String      ToLower( const String &rText, sal_Int16 nLanguage );
     135             : LNG_DLLPUBLIC sal_Bool      HasDigits( const ::rtl::OUString &rText );
     136             : LNG_DLLPUBLIC sal_Bool      IsNumeric( const String &rText );
     137             : 
     138             : 
     139             : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName );
     140             : LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties();
     141             : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSearchableDictionaryList > GetSearchableDictionaryList();
     142             : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList();
     143             : ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
     144             : 
     145             : 
     146             : sal_Bool IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties,
     147             :         const ::com::sun::star::uno::Reference<
     148             :             ::com::sun::star::beans::XPropertySet > &rxPropSet );
     149             : 
     150             : sal_Bool IsIgnoreControlChars( const ::com::sun::star::beans::PropertyValues &rProperties,
     151             :         const ::com::sun::star::uno::Reference<
     152             :             ::com::sun::star::beans::XPropertySet > &rxPropSet );
     153             : 
     154             : ::com::sun::star::uno::Reference<
     155             :     ::com::sun::star::linguistic2::XDictionaryEntry >
     156             :         SearchDicList(
     157             :             const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList >& rDicList,
     158             :             const ::rtl::OUString& rWord, sal_Int16 nLanguage,
     159             :             sal_Bool bSearchPosDics, sal_Bool bSearchSpellEntry );
     160             : 
     161             : LNG_DLLPUBLIC sal_uInt8 AddEntryToDic(
     162             :     ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary >  &rxDic,
     163             :     const ::rtl::OUString &rWord, sal_Bool bIsNeg,
     164             :     const ::rtl::OUString &rRplcTxt, sal_Int16 nRplcLang,
     165             :     sal_Bool bStripDot = sal_True );
     166             : 
     167             : LNG_DLLPUBLIC sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &xDicList );
     168             : 
     169             : // AppExitLstnr:
     170             : // virtual base class that calls it AtExit function when the application
     171             : // (ie the Desktop) is about to terminate
     172             : 
     173             : class AppExitListener :
     174             :     public cppu::WeakImplHelper1
     175             :     <
     176             :         ::com::sun::star::frame::XTerminateListener
     177             :     >
     178             : {
     179             :     ::com::sun::star::uno::Reference<
     180             :         ::com::sun::star::frame::XDesktop2 >     xDesktop;
     181             : 
     182             : public:
     183             :     AppExitListener();
     184             :     virtual ~AppExitListener();
     185             : 
     186             :     virtual void    AtExit() = 0;
     187             : 
     188             :     void            Activate();
     189             :     void            Deactivate();
     190             : 
     191             :     // XEventListener
     192             :     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
     193             : 
     194             :     // XTerminateListener
     195             :     virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
     196             :     virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
     197             : };
     198             : 
     199             : }   // namespace linguistic
     200             : 
     201             : #endif
     202             : 
     203             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10