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 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_drawinglayer.hxx" 26 27 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> 28 29 ////////////////////////////////////////////////////////////////////////////// 30 31 namespace drawinglayer 32 { 33 namespace primitive2d 34 { mapFontUnderlineToTextLine(FontUnderline eLineStyle)35 TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle) 36 { 37 switch(eLineStyle) 38 { 39 case UNDERLINE_SINGLE: return TEXT_LINE_SINGLE; 40 case UNDERLINE_DOUBLE: return TEXT_LINE_DOUBLE; 41 case UNDERLINE_DOTTED: return TEXT_LINE_DOTTED; 42 case UNDERLINE_DASH: return TEXT_LINE_DASH; 43 case UNDERLINE_LONGDASH: return TEXT_LINE_LONGDASH; 44 case UNDERLINE_DASHDOT: return TEXT_LINE_DASHDOT; 45 case UNDERLINE_DASHDOTDOT: return TEXT_LINE_DASHDOTDOT; 46 case UNDERLINE_SMALLWAVE: return TEXT_LINE_SMALLWAVE; 47 case UNDERLINE_WAVE: return TEXT_LINE_WAVE; 48 case UNDERLINE_DOUBLEWAVE: return TEXT_LINE_DOUBLEWAVE; 49 case UNDERLINE_BOLD: return TEXT_LINE_BOLD; 50 case UNDERLINE_BOLDDOTTED: return TEXT_LINE_BOLDDOTTED; 51 case UNDERLINE_BOLDDASH: return TEXT_LINE_BOLDDASH; 52 case UNDERLINE_BOLDLONGDASH: return TEXT_LINE_BOLDLONGDASH; 53 case UNDERLINE_BOLDDASHDOT: return TEXT_LINE_BOLDDASHDOT; 54 case UNDERLINE_BOLDDASHDOTDOT: return TEXT_LINE_BOLDDASHDOTDOT; 55 case UNDERLINE_BOLDWAVE: return TEXT_LINE_BOLDWAVE; 56 // FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE 57 default: return TEXT_LINE_NONE; 58 } 59 } 60 mapTextLineToFontUnderline(TextLine eLineStyle)61 FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle) 62 { 63 switch(eLineStyle) 64 { 65 default: /*TEXT_LINE_NONE*/ return UNDERLINE_NONE; 66 case TEXT_LINE_SINGLE: return UNDERLINE_SINGLE; 67 case TEXT_LINE_DOUBLE: return UNDERLINE_DOUBLE; 68 case TEXT_LINE_DOTTED: return UNDERLINE_DOTTED; 69 case TEXT_LINE_DASH: return UNDERLINE_DASH; 70 case TEXT_LINE_LONGDASH: return UNDERLINE_LONGDASH; 71 case TEXT_LINE_DASHDOT: return UNDERLINE_DASHDOT; 72 case TEXT_LINE_DASHDOTDOT: return UNDERLINE_DASHDOTDOT; 73 case TEXT_LINE_SMALLWAVE: return UNDERLINE_SMALLWAVE; 74 case TEXT_LINE_WAVE: return UNDERLINE_WAVE; 75 case TEXT_LINE_DOUBLEWAVE: return UNDERLINE_DOUBLEWAVE; 76 case TEXT_LINE_BOLD: return UNDERLINE_BOLD; 77 case TEXT_LINE_BOLDDOTTED: return UNDERLINE_BOLDDOTTED; 78 case TEXT_LINE_BOLDDASH: return UNDERLINE_BOLDDASH; 79 case TEXT_LINE_BOLDLONGDASH: return UNDERLINE_LONGDASH; 80 case TEXT_LINE_BOLDDASHDOT: return UNDERLINE_BOLDDASHDOT; 81 case TEXT_LINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT; 82 case TEXT_LINE_BOLDWAVE: return UNDERLINE_BOLDWAVE; 83 } 84 } 85 mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout)86 TextStrikeout mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout) 87 { 88 switch(eFontStrikeout) 89 { 90 case STRIKEOUT_SINGLE: return TEXT_STRIKEOUT_SINGLE; 91 case STRIKEOUT_DOUBLE: return TEXT_STRIKEOUT_DOUBLE; 92 case STRIKEOUT_BOLD: return TEXT_STRIKEOUT_BOLD; 93 case STRIKEOUT_SLASH: return TEXT_STRIKEOUT_SLASH; 94 case STRIKEOUT_X: return TEXT_STRIKEOUT_X; 95 // FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW 96 default: return TEXT_STRIKEOUT_NONE; 97 } 98 } 99 mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout)100 FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout) 101 { 102 switch(eTextStrikeout) 103 { 104 default: /*case primitive2d::TEXT_STRIKEOUT_NONE*/ return STRIKEOUT_NONE; 105 case TEXT_STRIKEOUT_SINGLE: return STRIKEOUT_SINGLE; 106 case TEXT_STRIKEOUT_DOUBLE: return STRIKEOUT_DOUBLE; 107 case TEXT_STRIKEOUT_BOLD: return STRIKEOUT_BOLD; 108 case TEXT_STRIKEOUT_SLASH: return STRIKEOUT_SLASH; 109 case TEXT_STRIKEOUT_X: return STRIKEOUT_X; 110 } 111 } 112 113 } // end of namespace primitive2d 114 } // end of namespace drawinglayer 115 116 ////////////////////////////////////////////////////////////////////////////// 117 // eof 118