1*0d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*0d63794cSAndrew Rist * distributed with this work for additional information 6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance 9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*0d63794cSAndrew Rist * software distributed under the License is distributed on an 15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the 17*0d63794cSAndrew Rist * specific language governing permissions and limitations 18*0d63794cSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*0d63794cSAndrew Rist *************************************************************/ 21*0d63794cSAndrew Rist 22*0d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _VCL_INPUTCTX_HXX 25cdf0e10cSrcweir #define _VCL_INPUTCTX_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <vcl/sv.h> 28cdf0e10cSrcweir #include <vcl/dllapi.h> 29cdf0e10cSrcweir #include <vcl/font.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir // ---------------------- 32cdf0e10cSrcweir // - InputContext-Flags - 33cdf0e10cSrcweir // ---------------------- 34cdf0e10cSrcweir 35cdf0e10cSrcweir #define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001) 36cdf0e10cSrcweir #define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002) 37cdf0e10cSrcweir #define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004) 38cdf0e10cSrcweir #define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008) 39cdf0e10cSrcweir 40cdf0e10cSrcweir // ---------------- 41cdf0e10cSrcweir // - InputContext - 42cdf0e10cSrcweir // ---------------- 43cdf0e10cSrcweir 44cdf0e10cSrcweir class VCL_DLLPUBLIC InputContext 45cdf0e10cSrcweir { 46cdf0e10cSrcweir private: 47cdf0e10cSrcweir Font maFont; 48cdf0e10cSrcweir sal_uLong mnOptions; 49cdf0e10cSrcweir 50cdf0e10cSrcweir public: InputContext()51cdf0e10cSrcweir InputContext() { mnOptions = 0; } InputContext(const InputContext & rInputContext)52cdf0e10cSrcweir InputContext( const InputContext& rInputContext ) : 53cdf0e10cSrcweir maFont( rInputContext.maFont ) 54cdf0e10cSrcweir { mnOptions = rInputContext.mnOptions; } InputContext(const Font & rFont,sal_uLong nOptions=0)55cdf0e10cSrcweir InputContext( const Font& rFont, sal_uLong nOptions = 0 ) : 56cdf0e10cSrcweir maFont( rFont ) 57cdf0e10cSrcweir { mnOptions = nOptions; } 58cdf0e10cSrcweir SetFont(const Font & rFont)59cdf0e10cSrcweir void SetFont( const Font& rFont ) { maFont = rFont; } GetFont() const60cdf0e10cSrcweir const Font& GetFont() const { return maFont; } 61cdf0e10cSrcweir SetOptions(sal_uLong nOptions)62cdf0e10cSrcweir void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; } GetOptions() const63cdf0e10cSrcweir sal_uLong GetOptions() const { return mnOptions; } 64cdf0e10cSrcweir 65cdf0e10cSrcweir InputContext& operator=( const InputContext& rInputContext ); 66cdf0e10cSrcweir sal_Bool operator==( const InputContext& rInputContext ) const; operator !=(const InputContext & rInputContext) const67cdf0e10cSrcweir sal_Bool operator!=( const InputContext& rInputContext ) const 68cdf0e10cSrcweir { return !(InputContext::operator==( rInputContext )); } 69cdf0e10cSrcweir }; 70cdf0e10cSrcweir operator =(const InputContext & rInputContext)71cdf0e10cSrcweirinline InputContext& InputContext::operator=( const InputContext& rInputContext ) 72cdf0e10cSrcweir { 73cdf0e10cSrcweir maFont = rInputContext.maFont; 74cdf0e10cSrcweir mnOptions = rInputContext.mnOptions; 75cdf0e10cSrcweir return *this; 76cdf0e10cSrcweir } 77cdf0e10cSrcweir operator ==(const InputContext & rInputContext) const78cdf0e10cSrcweirinline sal_Bool InputContext::operator==( const InputContext& rInputContext ) const 79cdf0e10cSrcweir { 80cdf0e10cSrcweir return ((mnOptions == rInputContext.mnOptions) && 81cdf0e10cSrcweir (maFont == rInputContext.maFont)); 82cdf0e10cSrcweir } 83cdf0e10cSrcweir 84cdf0e10cSrcweir #endif // _VCL_INPUTCTX_HXX 85