PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: FontInfo.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLGUI_FONTINFO_H__ 00024 #define __PLGUI_FONTINFO_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/String/String.h> 00032 #include "PLGui/PLGui.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLGui { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Font information 00047 */ 00048 class FontInfo { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Public functions ] 00053 //[-------------------------------------------------------] 00054 public: 00055 /** 00056 * @brief 00057 * Constructor 00058 */ 00059 PLGUI_API FontInfo(); 00060 00061 /** 00062 * @brief 00063 * Constructor 00064 * 00065 * @param[in] sFilename 00066 * Font file name 00067 * @param[in] sFamily 00068 * Font family name 00069 * @param[in] nHeight 00070 * Font height 00071 * @param[in] nWeight 00072 * Font weight (@see EFontWeight) 00073 * @param[in] nStyle 00074 * Font style 00075 */ 00076 PLGUI_API FontInfo(const PLCore::String &sFilename, const PLCore::String &sFamily, PLCore::uint32 nHeight, EFontWeight nWeight, EFontStyle nStyle); 00077 00078 /** 00079 * @brief 00080 * Copy constructor 00081 * 00082 * @param[in] cFontInfo 00083 * Font info that is copied 00084 */ 00085 PLGUI_API FontInfo(const FontInfo &cFontInfo); 00086 00087 /** 00088 * @brief 00089 * Destructor 00090 */ 00091 PLGUI_API ~FontInfo(); 00092 00093 /** 00094 * @brief 00095 * Assignment operator 00096 * 00097 * @param[in] cFontInfo 00098 * Font info that is copied 00099 */ 00100 PLGUI_API FontInfo &operator =(const FontInfo &cFontInfo); 00101 00102 /** 00103 * @brief 00104 * Comparison operator 00105 * 00106 * @param[in] cFontInfo 00107 * Font info that is compared 00108 * 00109 * @return 00110 * 'true' if fonts are equal, else 'false' 00111 */ 00112 PLGUI_API bool operator ==(const FontInfo &cFontInfo) const; 00113 00114 /** 00115 * @brief 00116 * Get font file name 00117 * 00118 * @return 00119 * File name 00120 * 00121 * @remarks 00122 * Will only return a file name if the font file has been added manually 00123 */ 00124 PLGUI_API PLCore::String GetFilename() const; 00125 00126 /** 00127 * @brief 00128 * Get font family 00129 * 00130 * @return 00131 * Font family name 00132 */ 00133 PLGUI_API PLCore::String GetFamily() const; 00134 00135 /** 00136 * @brief 00137 * Get font height 00138 * 00139 * @return 00140 * Font height 00141 */ 00142 PLGUI_API PLCore::uint32 GetHeight() const; 00143 00144 /** 00145 * @brief 00146 * Get font weight 00147 * 00148 * @return 00149 * Font weight 00150 */ 00151 PLGUI_API EFontWeight GetWeight() const; 00152 00153 /** 00154 * @brief 00155 * Get font style 00156 * 00157 * @return 00158 * Font style 00159 */ 00160 PLGUI_API EFontStyle GetStyle() const; 00161 00162 00163 //[-------------------------------------------------------] 00164 //[ Protected data ] 00165 //[-------------------------------------------------------] 00166 protected: 00167 PLCore::String m_sFilename; /**< Filename for directly loaded fonts */ 00168 PLCore::String m_sFamily; /**< Font family */ 00169 PLCore::uint32 m_nHeight; /**< Font height */ 00170 EFontWeight m_nWeight; /**< Font weight */ 00171 EFontStyle m_nStyle; /**< Font style (normal, italics, ...) */ 00172 00173 00174 }; 00175 00176 00177 //[-------------------------------------------------------] 00178 //[ Namespace ] 00179 //[-------------------------------------------------------] 00180 } // PLGui 00181 00182 00183 #endif // __PLGUI_FONTINFO_H__
|