1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SVX_SCRIPTTYPEITEM_HXX 24 #define _SVX_SCRIPTTYPEITEM_HXX 25 26 // include --------------------------------------------------------------- 27 28 #include <svl/intitem.hxx> 29 #include <svl/languageoptions.hxx> 30 #include <editeng/editengdllapi.h> 31 32 // class SvxScriptTypeItem ---------------------------------------------- 33 34 /* [Description] 35 36 This item describe the scriptype of the selected text and is only 37 used for the user interface. 38 */ 39 40 EDITENG_DLLPUBLIC sal_uInt16 GetI18NScriptTypeOfLanguage( sal_uInt16 nLang ); 41 sal_uInt16 GetItemScriptType( short nI18NType ); 42 short GetI18NScriptType( sal_uInt16 nItemType ); 43 44 class EDITENG_DLLPUBLIC SvxScriptTypeItem : public SfxUInt16Item 45 { 46 public: 47 TYPEINFO(); 48 49 SvxScriptTypeItem( sal_uInt16 nType = SCRIPTTYPE_LATIN ); 50 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 51 52 }; 53 54 class EDITENG_DLLPUBLIC SvxScriptSetItem : public SfxSetItem 55 { 56 public: 57 TYPEINFO(); 58 59 SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool ); 60 61 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 62 virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; 63 64 static const SfxPoolItem* GetItemOfScriptSet( const SfxItemSet& rSet, 65 sal_uInt16 nWhich ); GetItemOfScriptSet(sal_uInt16 _nWhich) const66 inline const SfxPoolItem* GetItemOfScriptSet( sal_uInt16 _nWhich ) const 67 { return SvxScriptSetItem::GetItemOfScriptSet( GetItemSet(), _nWhich ); } 68 69 static const SfxPoolItem* GetItemOfScript( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16 nScript ); 70 71 const SfxPoolItem* GetItemOfScript( sal_uInt16 nScript ) const; 72 73 void PutItemForScriptType( sal_uInt16 nScriptType, const SfxPoolItem& rItem ); 74 75 static void GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex); 76 77 void GetWhichIds( sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex) const; 78 79 static void GetSlotIds( sal_uInt16 nSlotId, sal_uInt16& rLatin, sal_uInt16& rAsian, 80 sal_uInt16& rComplex ); GetSlotIds(sal_uInt16 & rLatin,sal_uInt16 & rAsian,sal_uInt16 & rComplex) const81 inline void GetSlotIds( sal_uInt16& rLatin, sal_uInt16& rAsian, 82 sal_uInt16& rComplex ) const 83 { GetSlotIds( Which(), rLatin, rAsian, rComplex ); } 84 }; 85 86 #endif 87 88