xref: /aoo4110/main/cui/source/inc/cuicharmap.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CUI_CHARMAP_HXX
24 #define _CUI_CHARMAP_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <vcl/ctrl.hxx>
29 #include <vcl/metric.hxx>
30 #include <vcl/button.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <sfx2/basedlgs.hxx>
34 #include <svx/charmap.hxx>
35 
36 class SubsetMap;
37 class SvxCharMapData;
38 
39 // define ----------------------------------------------------------------
40 
41 #define CHARMAP_MAXLEN  32
42 
43 namespace svx
44 {
45 	struct SvxShowCharSetItem;
46 	class SvxShowCharSetVirtualAcc;
47 }
48 // class SvxCharacterMap -------------------------------------------------
49 // the main purpose of this dialog is to enable the use of characters
50 // that are not easily accesible from the keyboard
51 
52 // class SvxShowText =====================================================
53 
54 class SvxShowText : public Control
55 {
56 public:
57                     SvxShowText( Window* pParent,
58                                  const ResId& rResId,
59                                  sal_Bool bCenter = sal_False );
60                     ~SvxShowText();
61 
62     void            SetFont( const Font& rFont );
63     void            SetText( const String& rText );
64 
65 protected:
66     virtual void    Paint( const Rectangle& );
67 
68 private:
69     long            mnY;
70     sal_Bool            mbCenter;
71 
72 };
73 
74 class SvxCharMapData
75 {
76 public:
77                     SvxCharMapData( class SfxModalDialog* pDialog, sal_Bool bOne_, ResMgr* pResContext );
78 
79     void            SetCharFont( const Font& rFont );
80 
81 private:
82 friend class SvxCharacterMap;
83     SfxModalDialog* mpDialog;
84 
85     FixedText       aFontText;
86     ListBox         aFontLB;
87     FixedText       aSubsetText;
88     ListBox         aSubsetLB;
89     SvxShowCharSet  aShowSet;
90     FixedText       aSymbolText;
91     SvxShowText     aShowText;
92 //    SvxShowText     aShowShortcut;
93     OKButton        aOKBtn;
94     CancelButton    aCancelBtn;
95     HelpButton      aHelpBtn;
96     PushButton      aDeleteBtn;
97 //    PushButton		aAssignBtn;
98     SvxShowText     aShowChar;
99     FixedText       aCharCodeText;
100 //	FixedText		aAssignText;
101     Font            aFont;
102     sal_Bool            bOne;
103     const SubsetMap* pSubsetMap;
104 
105     DECL_LINK( OKHdl, OKButton* );
106     DECL_LINK( FontSelectHdl, ListBox* );
107     DECL_LINK( SubsetSelectHdl, ListBox* );
108     DECL_LINK( CharDoubleClickHdl, Control* pControl );
109     DECL_LINK( CharSelectHdl, Control* pControl );
110     DECL_LINK( CharHighlightHdl, Control* pControl );
111     DECL_LINK( CharPreSelectHdl, Control* pControl );
112     DECL_LINK( DeleteHdl, PushButton* pBtn );
113     DECL_LINK( AssignHdl, PushButton* pBtn );
114 };
115 
116 class SvxCharacterMap : public SfxModalDialog
117 {
118 private:
119     SvxCharMapData* mpCharMapData;
120 
121 public:
122                     SvxCharacterMap( Window* pParent, sal_Bool bOne=sal_True, const SfxItemSet* pSet=0 );
123                     ~SvxCharacterMap();
124 
125     void            DisableFontSelection();
126 
127     const Font&     GetCharFont() const;
128     void            SetCharFont( const Font& rFont );
129 
130     void            SetChar( sal_UCS4 );
131     sal_UCS4        GetChar() const;
132 
133     String          GetCharacters() const;
134 
135 	virtual short	Execute();
136 };
137 
138 #endif
139 
140