1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _CUI_CHARMAP_HXX 28 #define _CUI_CHARMAP_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <vcl/ctrl.hxx> 33 #include <vcl/metric.hxx> 34 #include <vcl/button.hxx> 35 #include <vcl/fixed.hxx> 36 #include <vcl/lstbox.hxx> 37 #include <sfx2/basedlgs.hxx> 38 #include <svx/charmap.hxx> 39 40 class SubsetMap; 41 class SvxCharMapData; 42 43 // define ---------------------------------------------------------------- 44 45 #define CHARMAP_MAXLEN 32 46 47 namespace svx 48 { 49 struct SvxShowCharSetItem; 50 class SvxShowCharSetVirtualAcc; 51 } 52 // class SvxCharacterMap ------------------------------------------------- 53 // the main purpose of this dialog is to enable the use of characters 54 // that are not easily accesible from the keyboard 55 56 // class SvxShowText ===================================================== 57 58 class SvxShowText : public Control 59 { 60 public: 61 SvxShowText( Window* pParent, 62 const ResId& rResId, 63 sal_Bool bCenter = sal_False ); 64 ~SvxShowText(); 65 66 void SetFont( const Font& rFont ); 67 void SetText( const String& rText ); 68 69 protected: 70 virtual void Paint( const Rectangle& ); 71 72 private: 73 long mnY; 74 sal_Bool mbCenter; 75 76 }; 77 78 class SvxCharMapData 79 { 80 public: 81 SvxCharMapData( class SfxModalDialog* pDialog, sal_Bool bOne_, ResMgr* pResContext ); 82 83 void SetCharFont( const Font& rFont ); 84 85 private: 86 friend class SvxCharacterMap; 87 SfxModalDialog* mpDialog; 88 89 SvxShowCharSet aShowSet; 90 SvxShowText aShowText; 91 // SvxShowText aShowShortcut; 92 OKButton aOKBtn; 93 CancelButton aCancelBtn; 94 HelpButton aHelpBtn; 95 PushButton aDeleteBtn; 96 // PushButton aAssignBtn; 97 FixedText aFontText; 98 ListBox aFontLB; 99 FixedText aSubsetText; 100 ListBox aSubsetLB; 101 FixedText aSymbolText; 102 SvxShowText aShowChar; 103 FixedText aCharCodeText; 104 // FixedText aAssignText; 105 Font aFont; 106 sal_Bool bOne; 107 const SubsetMap* pSubsetMap; 108 109 DECL_LINK( OKHdl, OKButton* ); 110 DECL_LINK( FontSelectHdl, ListBox* ); 111 DECL_LINK( SubsetSelectHdl, ListBox* ); 112 DECL_LINK( CharDoubleClickHdl, Control* pControl ); 113 DECL_LINK( CharSelectHdl, Control* pControl ); 114 DECL_LINK( CharHighlightHdl, Control* pControl ); 115 DECL_LINK( CharPreSelectHdl, Control* pControl ); 116 DECL_LINK( DeleteHdl, PushButton* pBtn ); 117 DECL_LINK( AssignHdl, PushButton* pBtn ); 118 }; 119 120 class SvxCharacterMap : public SfxModalDialog 121 { 122 private: 123 SvxCharMapData* mpCharMapData; 124 125 public: 126 SvxCharacterMap( Window* pParent, sal_Bool bOne=sal_True, const SfxItemSet* pSet=0 ); 127 ~SvxCharacterMap(); 128 129 void DisableFontSelection(); 130 131 const Font& GetCharFont() const; 132 void SetCharFont( const Font& rFont ); 133 134 void SetChar( sal_UCS4 ); 135 sal_UCS4 GetChar() const; 136 137 String GetCharacters() const; 138 139 virtual short Execute(); 140 }; 141 142 #endif 143 144