1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _VCL_INPUTCTX_HXX
21 #define _VCL_INPUTCTX_HXX
23 #include <tools/solar.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/font.hxx>
27 // ----------------------
28 // - InputContext-Flags -
29 // ----------------------
31 #define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
32 #define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
33 #define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
34 #define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
40 class VCL_DLLPUBLIC InputContext
47 InputContext() { mnOptions
= 0; }
48 InputContext( const InputContext
& rInputContext
) :
49 maFont( rInputContext
.maFont
)
50 { mnOptions
= rInputContext
.mnOptions
; }
51 InputContext( const Font
& rFont
, sal_uLong nOptions
= 0 ) :
53 { mnOptions
= nOptions
; }
55 void SetFont( const Font
& rFont
) { maFont
= rFont
; }
56 const Font
& GetFont() const { return maFont
; }
58 void SetOptions( sal_uLong nOptions
) { mnOptions
= nOptions
; }
59 sal_uLong
GetOptions() const { return mnOptions
; }
61 InputContext
& operator=( const InputContext
& rInputContext
);
62 sal_Bool
operator==( const InputContext
& rInputContext
) const;
63 sal_Bool
operator!=( const InputContext
& rInputContext
) const
64 { return !(InputContext::operator==( rInputContext
)); }
67 inline InputContext
& InputContext::operator=( const InputContext
& rInputContext
)
69 maFont
= rInputContext
.maFont
;
70 mnOptions
= rInputContext
.mnOptions
;
74 inline sal_Bool
InputContext::operator==( const InputContext
& rInputContext
) const
76 return ((mnOptions
== rInputContext
.mnOptions
) &&
77 (maFont
== rInputContext
.maFont
));
80 #endif // _VCL_INPUTCTX_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */