Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_CUI_SOURCE_INC_CUICHARMAP_HXX
20 : #define INCLUDED_CUI_SOURCE_INC_CUICHARMAP_HXX
21 :
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>
29 :
30 : class SubsetMap;
31 :
32 : #define CHARMAP_MAXLEN 32
33 :
34 : namespace svx
35 : {
36 : struct SvxShowCharSetItem;
37 : }
38 :
39 : class SvxShowText : public Control
40 : {
41 : public:
42 : SvxShowText( vcl::Window* pParent,
43 : bool bCenter = false );
44 : virtual ~SvxShowText();
45 :
46 : void SetFont( const vcl::Font& rFont );
47 : void SetText( const OUString& rText ) SAL_OVERRIDE;
48 0 : void SetCentered(bool bCenter) { mbCenter = bCenter; }
49 :
50 : virtual void Resize() SAL_OVERRIDE;
51 :
52 : virtual Size GetOptimalSize() const SAL_OVERRIDE;
53 :
54 : protected:
55 : virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
56 :
57 : private:
58 : long mnY;
59 : bool mbCenter;
60 :
61 : };
62 :
63 : /** The main purpose of this dialog is to enable the use of characters
64 : that are not easily accessible from the keyboard. */
65 : class SvxCharacterMap : public SfxModalDialog
66 : {
67 : private:
68 :
69 : void init();
70 :
71 : SvxShowCharSet* m_pShowSet;
72 : Edit* m_pShowText;
73 : OKButton* m_pOKBtn;
74 : FixedText* m_pFontText;
75 : ListBox* m_pFontLB;
76 : FixedText* m_pSubsetText;
77 : ListBox* m_pSubsetLB;
78 : FixedText* m_pSymbolText;
79 : SvxShowText* m_pShowChar;
80 : FixedText* m_pCharCodeText;
81 : vcl::Font aFont;
82 : bool bOne;
83 : const SubsetMap* pSubsetMap;
84 :
85 : DECL_LINK(OKHdl, void *);
86 : DECL_LINK(FontSelectHdl, void *);
87 : DECL_LINK(SubsetSelectHdl, void *);
88 : DECL_LINK(CharDoubleClickHdl, void *);
89 : DECL_LINK(CharSelectHdl, void *);
90 : DECL_LINK(CharHighlightHdl, void *);
91 : DECL_LINK(CharPreSelectHdl, void *);
92 :
93 : void fillAllSubsets(ListBox &rListBox);
94 :
95 : public:
96 : SvxCharacterMap( vcl::Window* pParent, bool bOne=true, const SfxItemSet* pSet=0 );
97 : virtual ~SvxCharacterMap();
98 :
99 : void DisableFontSelection();
100 :
101 0 : const vcl::Font& GetCharFont() const { return aFont;}
102 : void SetCharFont( const vcl::Font& rFont );
103 :
104 : void SetChar( sal_UCS4 );
105 : sal_UCS4 GetChar() const;
106 :
107 : OUString GetCharacters() const;
108 :
109 : virtual short Execute() SAL_OVERRIDE;
110 : };
111 :
112 : #endif
113 :
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|