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