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 INCLUDED_SVX_SOURCE_ACCESSIBILITY_LOOKUPCOLORNAME_HXX
21 #define INCLUDED_SVX_SOURCE_ACCESSIBILITY_LOOKUPCOLORNAME_HXX
23 #include <sal/config.h>
25 #include <rtl/ustring.hxx>
26 #include <tools/long.hxx>
28 namespace accessibility
30 /** This is a color name lookup targeted to be used by the accessibility
31 <type>DescriptionGenerator</type> class. It encapsulates a
32 <type>com.sun.star.drawing.ColorTable</type> and provides an inverse look
33 up of color names for given numerical color descriptions (the RGB values
34 encoded as an integer).
36 <p>The implementation uses as singleton so that the
37 <type>com.sun.star.drawing.ColorTable</type> object needs to be created
38 only once. That singleton instance for now lives until the application
39 terminates. However, the color table from which it takes its values may
40 change during this time. Reacting to these changes remains a task for the
44 This integer is the sum of the 8 Bit red value shifted left 16 Bits, the
45 green value shifted left 8 Bits, and the unshifted blue value.
48 The returned string is either the color name of the specified color or,
49 when no name exists, a string of the form "#RRGGBB" with two hexadecimal
50 digits for each color component.
52 OUString
lookUpColorName(tools::Long color
);
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */