00001 /*************************************************************************** 00002 * Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider, * 00003 * Matthias Hardt, Guido Madaus * 00004 * * 00005 * Copyright (C) 2007-2008 BerLinux Solutions GbR * 00006 * Stefan Schwarzer & Guido Madaus * 00007 * * 00008 * Copyright (C) 2009-2013 BerLinux Solutions GmbH * 00009 * * 00010 * Authors: * 00011 * Stefan Schwarzer <stefan.schwarzer@diskohq.org>, * 00012 * Matthias Hardt <matthias.hardt@diskohq.org>, * 00013 * Jens Schneider <jens.schneider@diskohq.org>, * 00014 * Guido Madaus <guido.madaus@diskohq.org>, * 00015 * Patrick Helterhoff <patrick.helterhoff@diskohq.org>, * 00016 * René Bählkow <rene.baehlkow@diskohq.org> * 00017 * * 00018 * This library is free software; you can redistribute it and/or * 00019 * modify it under the terms of the GNU Lesser General Public * 00020 * License version 2.1 as published by the Free Software Foundation. * 00021 * * 00022 * This library is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00025 * Lesser General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU Lesser General Public * 00028 * License along with this library; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 00031 **************************************************************************/ 00032 00033 #include "mmsgui/theme/mmstextbaseclass.h" 00034 #include <string.h> 00035 00036 MMSTextBaseClass::MMSTextBaseClass() { 00037 unsetAll(); 00038 } 00039 00040 MMSTextBaseClass::~MMSTextBaseClass() { 00041 00042 } 00043 00044 void MMSTextBaseClass::unsetAll() { 00045 unsetFontPath(); 00046 unsetFontSize(); 00047 unsetFontNames(); 00048 unsetAlignment(); 00049 unsetColor(); 00050 unsetSelColor(); 00051 unsetColor_p(); 00052 unsetSelColor_p(); 00053 unsetColor_i(); 00054 unsetSelColor_i(); 00055 unsetText(); 00056 unsetShadowColors(); 00057 unsetSelShadowColors(); 00058 } 00059 00060 00061 bool MMSTextBaseClass::isFontPath() { 00062 return this->isfontpath; 00063 } 00064 00065 void MMSTextBaseClass::setFontPath(string fontpath) { 00066 this->fontpath = fontpath; 00067 this->isfontpath = true; 00068 } 00069 00070 void MMSTextBaseClass::unsetFontPath() { 00071 this->isfontpath = false; 00072 } 00073 00074 string MMSTextBaseClass::getFontPath() { 00075 return this->fontpath; 00076 } 00077 00078 bool MMSTextBaseClass::isFontSize() { 00079 return this->isfontsize; 00080 } 00081 00082 void MMSTextBaseClass::setFontSize(unsigned int fontsize) { 00083 this->fontsize = fontsize; 00084 this->isfontsize = true; 00085 } 00086 00087 void MMSTextBaseClass::unsetFontSize() { 00088 this->isfontsize = false; 00089 } 00090 00091 unsigned int MMSTextBaseClass::getFontSize() { 00092 return this->fontsize; 00093 } 00094 00095 00096 bool MMSTextBaseClass::isFontName(MMSLanguage lang) { 00097 if (lang < MMSLANG_NONE || lang >= MMSLANG_SIZE) return false; 00098 return this->fontname[lang].isfontname; 00099 } 00100 00101 void MMSTextBaseClass::setFontName(string fontname, MMSLanguage lang) { 00102 if (lang < MMSLANG_NONE || lang >= MMSLANG_SIZE) return; 00103 this->fontname[lang].fontname = fontname; 00104 this->fontname[lang].isfontname = true; 00105 } 00106 00107 void MMSTextBaseClass::unsetFontName(MMSLanguage lang) { 00108 if (lang < MMSLANG_NONE || lang >= MMSLANG_SIZE) return; 00109 this->fontname[lang].isfontname = false; 00110 } 00111 00112 void MMSTextBaseClass::unsetFontNames() { 00113 for (unsigned int i = MMSLANG_NONE; i < MMSLANG_SIZE; i++) { 00114 unsetFontName((MMSLanguage)i); 00115 } 00116 } 00117 00118 string MMSTextBaseClass::getFontName(MMSLanguage lang) { 00119 if (lang < MMSLANG_NONE || lang >= MMSLANG_SIZE) return ""; 00120 return this->fontname[lang].fontname; 00121 } 00122 00123 00124 bool MMSTextBaseClass::isAlignment() { 00125 return this->isalignment; 00126 } 00127 00128 void MMSTextBaseClass::setAlignment(MMSALIGNMENT alignment) { 00129 this->alignment = alignment; 00130 this->isalignment = true; 00131 } 00132 00133 void MMSTextBaseClass::unsetAlignment() { 00134 this->isalignment = false; 00135 } 00136 00137 MMSALIGNMENT MMSTextBaseClass::getAlignment() { 00138 return this->alignment; 00139 } 00140 00141 bool MMSTextBaseClass::isColor() { 00142 return this->iscolor; 00143 } 00144 00145 void MMSTextBaseClass::setColor(MMSFBColor color) { 00146 this->color = color; 00147 this->iscolor = true; 00148 } 00149 00150 void MMSTextBaseClass::unsetColor() { 00151 this->iscolor = false; 00152 } 00153 00154 MMSFBColor MMSTextBaseClass::getColor() { 00155 return this->color; 00156 } 00157 00158 bool MMSTextBaseClass::isSelColor() { 00159 return this->isselcolor; 00160 } 00161 00162 void MMSTextBaseClass::setSelColor(MMSFBColor selcolor) { 00163 this->selcolor = selcolor; 00164 this->isselcolor = true; 00165 } 00166 00167 void MMSTextBaseClass::unsetSelColor() { 00168 this->isselcolor = false; 00169 } 00170 00171 MMSFBColor MMSTextBaseClass::getSelColor() { 00172 return this->selcolor; 00173 } 00174 00175 00176 bool MMSTextBaseClass::isColor_p() { 00177 return this->iscolor_p; 00178 } 00179 00180 void MMSTextBaseClass::setColor_p(MMSFBColor color_p) { 00181 this->color_p = color_p; 00182 this->iscolor_p = true; 00183 } 00184 00185 void MMSTextBaseClass::unsetColor_p() { 00186 this->iscolor_p = false; 00187 } 00188 00189 MMSFBColor MMSTextBaseClass::getColor_p() { 00190 return this->color_p; 00191 } 00192 00193 bool MMSTextBaseClass::isSelColor_p() { 00194 return this->isselcolor_p; 00195 } 00196 00197 void MMSTextBaseClass::setSelColor_p(MMSFBColor selcolor_p) { 00198 this->selcolor_p = selcolor_p; 00199 this->isselcolor_p = true; 00200 } 00201 00202 void MMSTextBaseClass::unsetSelColor_p() { 00203 this->isselcolor_p = false; 00204 } 00205 00206 MMSFBColor MMSTextBaseClass::getSelColor_p() { 00207 return this->selcolor_p; 00208 } 00209 00210 00211 bool MMSTextBaseClass::isColor_i() { 00212 return this->iscolor_i; 00213 } 00214 00215 void MMSTextBaseClass::setColor_i(MMSFBColor color_i) { 00216 this->color_i = color_i; 00217 this->iscolor_i = true; 00218 } 00219 00220 void MMSTextBaseClass::unsetColor_i() { 00221 this->iscolor_i = false; 00222 } 00223 00224 MMSFBColor MMSTextBaseClass::getColor_i() { 00225 return this->color_i; 00226 } 00227 00228 bool MMSTextBaseClass::isSelColor_i() { 00229 return this->isselcolor_i; 00230 } 00231 00232 void MMSTextBaseClass::setSelColor_i(MMSFBColor selcolor_i) { 00233 this->selcolor_i = selcolor_i; 00234 this->isselcolor_i = true; 00235 } 00236 00237 void MMSTextBaseClass::unsetSelColor_i() { 00238 this->isselcolor_i = false; 00239 } 00240 00241 MMSFBColor MMSTextBaseClass::getSelColor_i() { 00242 return this->selcolor_i; 00243 } 00244 00245 00246 00247 bool MMSTextBaseClass::isText() { 00248 return this->istext; 00249 } 00250 00251 void MMSTextBaseClass::setText(string *text) { 00252 this->text = *text; 00253 this->istext = true; 00254 } 00255 00256 void MMSTextBaseClass::setText(string text) { 00257 setText(&text); 00258 } 00259 00260 void MMSTextBaseClass::unsetText() { 00261 this->istext = false; 00262 } 00263 00264 string MMSTextBaseClass::getText() { 00265 return this->text; 00266 } 00267 00268 00269 00270 bool MMSTextBaseClass::isShadowColor(MMSPOSITION position) { 00271 return this->shadow[position].iscolor; 00272 } 00273 00274 void MMSTextBaseClass::setShadowColor(MMSPOSITION position, MMSFBColor color) { 00275 this->shadow[position].color = color; 00276 this->shadow[position].iscolor = true; 00277 } 00278 00279 void MMSTextBaseClass::unsetShadowColor(MMSPOSITION position) { 00280 this->shadow[position].iscolor = false; 00281 } 00282 00283 void MMSTextBaseClass::unsetShadowColors() { 00284 for (int i = 0; i < MMSPOSITION_SIZE; i++) { 00285 unsetShadowColor((MMSPOSITION)i); 00286 } 00287 } 00288 00289 MMSFBColor MMSTextBaseClass::getShadowColor(MMSPOSITION position) { 00290 return this->shadow[position].color; 00291 } 00292 00293 bool MMSTextBaseClass::isSelShadowColor(MMSPOSITION position) { 00294 return this->shadow[position].isselcolor; 00295 } 00296 00297 void MMSTextBaseClass::setSelShadowColor(MMSPOSITION position, MMSFBColor selcolor) { 00298 this->shadow[position].selcolor = selcolor; 00299 this->shadow[position].isselcolor = true; 00300 } 00301 00302 void MMSTextBaseClass::unsetSelShadowColor(MMSPOSITION position) { 00303 this->shadow[position].isselcolor = false; 00304 } 00305 00306 void MMSTextBaseClass::unsetSelShadowColors() { 00307 for (int i = 0; i < MMSPOSITION_SIZE; i++) { 00308 unsetSelShadowColor((MMSPOSITION)i); 00309 } 00310 } 00311 00312 MMSFBColor MMSTextBaseClass::getSelShadowColor(MMSPOSITION position) { 00313 return this->shadow[position].selcolor; 00314 } 00315 00316 00317