bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / inc / cuicharmap.hxx
blobd06f55a33fd6407549c71c855708a7451d5988ef
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_CUI_SOURCE_INC_CUICHARMAP_HXX
20 #define INCLUDED_CUI_SOURCE_INC_CUICHARMAP_HXX
22 #include <vcl/ctrl.hxx>
23 #include <vcl/metric.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <sfx2/basedlgs.hxx>
28 #include <svx/charmap.hxx>
30 class SubsetMap;
32 #define CHARMAP_MAXLEN 32
34 namespace svx
36 struct SvxShowCharSetItem;
39 class SvxShowText : public Control
41 public:
42 SvxShowText(vcl::Window* pParent, bool bCenter = false);
44 void SetFont( const vcl::Font& rFont );
45 void SetText( const OUString& rText ) SAL_OVERRIDE;
46 void SetCentered(bool bCenter) { mbCenter = bCenter; }
48 virtual void Resize() SAL_OVERRIDE;
50 virtual Size GetOptimalSize() const SAL_OVERRIDE;
52 protected:
53 virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE;
55 private:
56 long mnY;
57 bool mbCenter;
58 vcl::Font maFont;
62 /** The main purpose of this dialog is to enable the use of characters
63 that are not easily accessible from the keyboard. */
64 class SvxCharacterMap : public SfxModalDialog
66 private:
68 void init();
70 VclPtr<SvxShowCharSet> m_pShowSet;
71 VclPtr<Edit> m_pShowText;
72 VclPtr<PushButton> m_pOKBtn;
73 VclPtr<FixedText> m_pFontText;
74 VclPtr<ListBox> m_pFontLB;
75 VclPtr<FixedText> m_pSubsetText;
76 VclPtr<ListBox> m_pSubsetLB;
77 VclPtr<FixedText> m_pSymbolText;
78 VclPtr<SvxShowText> m_pShowChar;
79 VclPtr<FixedText> m_pCharCodeText;
80 vcl::Font aFont;
81 bool bOne;
82 const SubsetMap* pSubsetMap;
84 DECL_LINK(OKHdl, void *);
85 DECL_LINK(FontSelectHdl, void *);
86 DECL_LINK(SubsetSelectHdl, void *);
87 DECL_LINK(CharDoubleClickHdl, void *);
88 DECL_LINK(CharSelectHdl, void *);
89 DECL_LINK(CharHighlightHdl, void *);
90 DECL_LINK(CharPreSelectHdl, void *);
92 static void fillAllSubsets(ListBox &rListBox);
94 public:
95 SvxCharacterMap( vcl::Window* pParent, bool bOne=true, const SfxItemSet* pSet=0 );
96 virtual ~SvxCharacterMap();
97 virtual void dispose() SAL_OVERRIDE;
99 void DisableFontSelection();
101 const vcl::Font& GetCharFont() const { return aFont;}
102 void SetCharFont( const vcl::Font& rFont );
104 void SetChar( sal_UCS4 );
105 sal_UCS4 GetChar() const;
107 OUString GetCharacters() const;
109 virtual short Execute() SAL_OVERRIDE;
112 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */