Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / cuicharmap.hxx
blobe2e8e1c2486d5658db96802382fedf9e245b548b
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 _CUI_CHARMAP_HXX
20 #define _CUI_CHARMAP_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( Window* pParent,
43 sal_Bool bCenter = sal_False );
44 ~SvxShowText();
46 void SetFont( const Font& rFont );
47 void SetText( const String& rText );
48 void SetCentered(bool bCenter) { mbCenter = bCenter; }
50 virtual void Resize();
52 protected:
53 virtual void Paint( const Rectangle& );
55 private:
56 long mnY;
57 sal_Bool mbCenter;
61 /** The main purpose of this dialog is to enable the use of characters
62 that are not easily accesible from the keyboard. */
63 class SvxCharacterMap : public SfxModalDialog
65 private:
67 void init();
69 SvxShowCharSet* m_pShowSet;
70 SvxShowText* m_pShowText;
71 OKButton* m_pOKBtn;
72 PushButton* m_pDeleteBtn;
73 FixedText* m_pFontText;
74 ListBox* m_pFontLB;
75 FixedText* m_pSubsetText;
76 ListBox* m_pSubsetLB;
77 FixedText* m_pSymbolText;
78 SvxShowText* m_pShowChar;
79 FixedText* m_pCharCodeText;
80 Font aFont;
81 sal_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 *);
91 DECL_LINK(DeleteHdl, void *);
93 public:
94 SvxCharacterMap( Window* pParent, sal_Bool bOne=sal_True, const SfxItemSet* pSet=0 );
95 ~SvxCharacterMap();
97 void DisableFontSelection();
99 const Font& GetCharFont() const;
100 void SetCharFont( const Font& rFont );
102 void SetChar( sal_UCS4 );
103 sal_UCS4 GetChar() const;
105 String GetCharacters() const;
107 virtual short Execute();
110 #endif
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */