1*d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionaryList_idl__ 24cdf0e10cSrcweir#define __com_sun_star_linguistic2_XDictionaryList_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionary_idl__ 31cdf0e10cSrcweir#include <com/sun/star/linguistic2/XDictionary.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_linguistic2_XDictionaryListEventListener_idl__ 35cdf0e10cSrcweir#include <com/sun/star/linguistic2/XDictionaryListEventListener.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir//============================================================================= 39cdf0e10cSrcweir 40cdf0e10cSrcweirmodule com { module sun { module star { module linguistic2 { 41cdf0e10cSrcweir 42cdf0e10cSrcweir//============================================================================= 43cdf0e10cSrcweir/** is used to manage and maintain a list of dictionaries. 44cdf0e10cSrcweir 45cdf0e10cSrcweir <P>A dictionary-list may be given to a spellchecker or hyphenator 46cdf0e10cSrcweir service implementation on their creation in order to supply a set 47cdf0e10cSrcweir of dictionaries and additional information to be used for 48cdf0e10cSrcweir those purposes.</P> 49cdf0e10cSrcweir 50cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 51cdf0e10cSrcweir @see <type scope="com::sun::star::uno">XInterface</type> 52cdf0e10cSrcweir*/ 53cdf0e10cSrcweirpublished interface XDictionaryList : com::sun::star::uno::XInterface 54cdf0e10cSrcweir{ 55cdf0e10cSrcweir //------------------------------------------------------------------------- 56cdf0e10cSrcweir /** 57cdf0e10cSrcweir @returns 58cdf0e10cSrcweir the number of dictionaries in the list. 59cdf0e10cSrcweir */ 60cdf0e10cSrcweir short getCount(); 61cdf0e10cSrcweir 62cdf0e10cSrcweir //------------------------------------------------------------------------- 63cdf0e10cSrcweir /** 64cdf0e10cSrcweir @returns 65cdf0e10cSrcweir a sequence with an entry for every dictionary 66cdf0e10cSrcweir in the list. 67cdf0e10cSrcweir 68cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 69cdf0e10cSrcweir */ 70cdf0e10cSrcweir sequence<com::sun::star::linguistic2::XDictionary> getDictionaries(); 71cdf0e10cSrcweir 72cdf0e10cSrcweir //------------------------------------------------------------------------- 73cdf0e10cSrcweir /** searches the list for a dictionary with a given name. 74cdf0e10cSrcweir 75cdf0e10cSrcweir @returns 76cdf0e10cSrcweir the XDictionary with the specified name. If no such 77cdf0e10cSrcweir dictionary exists, <NULL/> will be returned. 78cdf0e10cSrcweir 79cdf0e10cSrcweir @param aDictionaryName 80cdf0e10cSrcweir specifies the name of the dictionary to look for. 81cdf0e10cSrcweir 82cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 83cdf0e10cSrcweir */ 84cdf0e10cSrcweir com::sun::star::linguistic2::XDictionary getDictionaryByName( 85cdf0e10cSrcweir [in] string aDictionaryName ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir //------------------------------------------------------------------------- 88cdf0e10cSrcweir /** adds a dictionary to the list. 89cdf0e10cSrcweir 90cdf0e10cSrcweir <P>Additionally, the dictionary-list will add itself to the list of dictionary 91cdf0e10cSrcweir event listeners of that dictionary.</P> 92cdf0e10cSrcweir 93cdf0e10cSrcweir @returns 94cdf0e10cSrcweir <TRUE/> if the dictionary was added successfully, 95cdf0e10cSrcweir <FALSE/> otherwise. 96cdf0e10cSrcweir 97cdf0e10cSrcweir @param xDictionary 98cdf0e10cSrcweir the dictionary to be added. 99cdf0e10cSrcweir 100cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 101cdf0e10cSrcweir */ 102cdf0e10cSrcweir boolean addDictionary( 103cdf0e10cSrcweir [in] com::sun::star::linguistic2::XDictionary xDictionary ); 104cdf0e10cSrcweir 105cdf0e10cSrcweir //------------------------------------------------------------------------- 106cdf0e10cSrcweir /** removes a single dictionary from the list. 107cdf0e10cSrcweir 108cdf0e10cSrcweir <P>If the dictionary is still active, it will be deactivated 109cdf0e10cSrcweir first. The dictionary-list will remove itself from the list of 110cdf0e10cSrcweir dictionary event listeners of the dictionary.</P> 111cdf0e10cSrcweir 112cdf0e10cSrcweir @returns 113cdf0e10cSrcweir <TRUE/> if the dictionary was removed successfully, <FALSE/> 114cdf0e10cSrcweir otherwise. 115cdf0e10cSrcweir 116cdf0e10cSrcweir @param xDictionary 117cdf0e10cSrcweir dictionary to be removed from the list of dictionaries. 118cdf0e10cSrcweir 119cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 120cdf0e10cSrcweir */ 121cdf0e10cSrcweir boolean removeDictionary( 122cdf0e10cSrcweir [in] com::sun::star::linguistic2::XDictionary xDictionary ); 123cdf0e10cSrcweir 124cdf0e10cSrcweir //------------------------------------------------------------------------- 125cdf0e10cSrcweir /** adds an entry to the list of dictionary-list event listeners. 126cdf0e10cSrcweir 127cdf0e10cSrcweir <P>On dictionary-list events, each entry in the listener list will 128cdf0e10cSrcweir be notified via a call to 129cdf0e10cSrcweir <member scope="com::sun::star::linguistic2">XDictionaryListEventListener::processDictionaryListEvent</member>.</P> 130cdf0e10cSrcweir 131cdf0e10cSrcweir @returns 132cdf0e10cSrcweir <TRUE/> if the entry was made, <FALSE/> otherwise. 133cdf0e10cSrcweir If <member scope="com::sun::star::lang">XEventListener::disposing</member> 134cdf0e10cSrcweir was called before, it will always fail. 135cdf0e10cSrcweir 136cdf0e10cSrcweir @param xListener 137cdf0e10cSrcweir the object to be notified of dictionary-list events. 138cdf0e10cSrcweir 139cdf0e10cSrcweir @param bReceiveVerbose 140cdf0e10cSrcweir <TRUE/> if the listener requires more detailed event 141cdf0e10cSrcweir notification than usual. 142cdf0e10cSrcweir 143cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type> 144cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type> 145cdf0e10cSrcweir */ 146cdf0e10cSrcweir boolean addDictionaryListEventListener( 147cdf0e10cSrcweir [in] com::sun::star::linguistic2::XDictionaryListEventListener xListener, 148cdf0e10cSrcweir [in] boolean bReceiveVerbose ); 149cdf0e10cSrcweir 150cdf0e10cSrcweir //------------------------------------------------------------------------- 151cdf0e10cSrcweir /** removes an entry from the list of dictionary-list event listeners. 152cdf0e10cSrcweir 153cdf0e10cSrcweir @returns 154cdf0e10cSrcweir <TRUE/> if the object to be removed was found and removed, 155cdf0e10cSrcweir <FALSE/> otherwise. 156cdf0e10cSrcweir 157cdf0e10cSrcweir @param xListener 158cdf0e10cSrcweir the object to be removed from the listener list. 159cdf0e10cSrcweir 160cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type> 161cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type> 162cdf0e10cSrcweir */ 163cdf0e10cSrcweir boolean removeDictionaryListEventListener( 164cdf0e10cSrcweir [in] com::sun::star::linguistic2::XDictionaryListEventListener xListener ); 165cdf0e10cSrcweir 166cdf0e10cSrcweir //------------------------------------------------------------------------- 167cdf0e10cSrcweir /** increases request level for event buffering by one. 168cdf0e10cSrcweir 169cdf0e10cSrcweir <P>The request level for event buffering is an integer 170cdf0e10cSrcweir counter that is initially set to 0. 171cdf0e10cSrcweir As long as the request level is not 0, events will be buffered 172cdf0e10cSrcweir until the next flushing of the buffer.</P> 173cdf0e10cSrcweir 174cdf0e10cSrcweir @returns 175cdf0e10cSrcweir the current request level for event buffering. 176cdf0e10cSrcweir 177cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type> 178cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type> 179cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::endCollectEvents</member> 180cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::flushEvents</member> 181cdf0e10cSrcweir */ 182cdf0e10cSrcweir short beginCollectEvents(); 183cdf0e10cSrcweir 184cdf0e10cSrcweir //------------------------------------------------------------------------- 185cdf0e10cSrcweir /** flushes the event buffer and decreases the request level for 186cdf0e10cSrcweir event buffering by one. 187cdf0e10cSrcweir 188cdf0e10cSrcweir <P>There should be one matching endCollectEvents call for every 189cdf0e10cSrcweir beginCollectEvents call. Usually you will group these around 190cdf0e10cSrcweir some code where you do not wish to get notfied of every single 191cdf0e10cSrcweir event.</P> 192cdf0e10cSrcweir 193cdf0e10cSrcweir @returns 194cdf0e10cSrcweir the current request level for event buffering. 195cdf0e10cSrcweir 196cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type> 197cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type> 198cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::beginCollectEvents</member> 199cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::flushEvents</member> 200cdf0e10cSrcweir */ 201cdf0e10cSrcweir short endCollectEvents(); 202cdf0e10cSrcweir 203cdf0e10cSrcweir //------------------------------------------------------------------------- 204cdf0e10cSrcweir /** notifies the listeners of all buffered events and then clears 205cdf0e10cSrcweir that buffer. 206cdf0e10cSrcweir 207cdf0e10cSrcweir @returns 208cdf0e10cSrcweir the current request level for event buffering. 209cdf0e10cSrcweir 210cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEvent</type> 211cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionaryListEventListener</type> 212cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::beginCollectEvents</member> 213cdf0e10cSrcweir @see <member scope="com::sun::star::linguistic2">XDictionaryList::endCollectEvents</member> 214cdf0e10cSrcweir */ 215cdf0e10cSrcweir short flushEvents(); 216cdf0e10cSrcweir 217cdf0e10cSrcweir //------------------------------------------------------------------------- 218cdf0e10cSrcweir /** creates a new dictionary. 219cdf0e10cSrcweir 220cdf0e10cSrcweir @returns 221cdf0e10cSrcweir an empty dictionary with the given name, language and type. 222cdf0e10cSrcweir <NULL/> on failure. 223cdf0e10cSrcweir 224cdf0e10cSrcweir @param aName 225cdf0e10cSrcweir is the name of the dictionary (should be unique). 226cdf0e10cSrcweir 227cdf0e10cSrcweir @param aLocale 228cdf0e10cSrcweir defines the language of the dictionary. 229cdf0e10cSrcweir Use an empty aLocale for dictionaries which may contain 230cdf0e10cSrcweir entries of all languages. 231cdf0e10cSrcweir 232cdf0e10cSrcweir @param eDicType 233cdf0e10cSrcweir specifies the type of the dictionary. 234cdf0e10cSrcweir 235cdf0e10cSrcweir @param aURL 236cdf0e10cSrcweir is the URL of the location where the dictionary is persistent, 237cdf0e10cSrcweir if the XStorable interface is supported. 238cdf0e10cSrcweir It may be empty, which means the dictionary will not be persistent. 239cdf0e10cSrcweir 240cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">XDictionary</type> 241cdf0e10cSrcweir @see <type scope="com::sun::star::lang">Locale</type> 242cdf0e10cSrcweir @see <type scope="com::sun::star::linguistic2">DictionaryType</type> 243cdf0e10cSrcweir */ 244cdf0e10cSrcweir com::sun::star::linguistic2::XDictionary createDictionary( 245cdf0e10cSrcweir [in] string aName, 246cdf0e10cSrcweir [in] com::sun::star::lang::Locale aLocale, 247cdf0e10cSrcweir [in] com::sun::star::linguistic2::DictionaryType eDicType, 248cdf0e10cSrcweir [in] string aURL ); 249cdf0e10cSrcweir 250cdf0e10cSrcweir}; 251cdf0e10cSrcweir 252cdf0e10cSrcweir//============================================================================= 253cdf0e10cSrcweir 254cdf0e10cSrcweir}; }; }; }; 255cdf0e10cSrcweir 256cdf0e10cSrcweir#endif 257cdf0e10cSrcweir 258