00001 /*************************************************************************** 00002 documentstyle.h - description 00003 ------------------- 00004 begin : Son Nov 10 2002 00005 copyright : (C) 2002-2007 by Andre Simon 00006 email : andre.simon1@gmx.de 00007 ***************************************************************************/ 00008 00009 00010 /* 00011 This file is part of Highlight. 00012 00013 Highlight is free software: you can redistribute it and/or modify 00014 it under the terms of the GNU General Public License as published by 00015 the Free Software Foundation, either version 3 of the License, or 00016 (at your option) any later version. 00017 00018 Highlight is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with Highlight. If not, see <http://www.gnu.org/licenses/>. 00025 */ 00026 00027 00028 #ifndef DOCUMENTSTYLE_H 00029 #define DOCUMENTSTYLE_H 00030 00031 #include <string> 00032 #include "configurationreader.h" 00033 #include "elementstyle.h" 00034 #include "stylecolour.h" 00035 00036 using namespace std; 00037 00038 namespace highlight 00039 { 00040 00042 typedef map <string, ElementStyle> KeywordStyles; 00043 00045 typedef KeywordStyles::const_iterator KSIterator; 00046 00051 class DocumentStyle 00052 { 00053 private: 00054 ElementStyle comment, slcomment, str, dstr, 00055 escapeChar, number, directive, line, symbol; 00056 ElementStyle defaultElem; 00057 Colour bgColour; 00058 Colour markLineColour; 00059 00060 string fontsize; 00061 bool fileFound; 00062 00063 KeywordStyles keywordStyles; 00064 00065 public: 00068 DocumentStyle ( const string & styleDefinitionPath ); 00069 00071 DocumentStyle(); 00072 ~DocumentStyle(); 00073 00077 bool load ( const string & styleDefinitionFile ); 00078 00080 vector <string> getClassNames() const; 00081 00083 KeywordStyles getKeywordStyles() const; 00084 00086 string getFontSize() const; 00087 00089 Colour getBgColour() const; 00090 00092 Colour getMarkLineColour() const; 00093 00095 ElementStyle getDefaultStyle() const; 00096 00098 ElementStyle getCommentStyle() const; 00099 00101 ElementStyle getSingleLineCommentStyle() const; 00102 00104 ElementStyle getStringStyle() const; 00105 00107 ElementStyle getDirectiveStringStyle() const; 00108 00110 ElementStyle getEscapeCharStyle() const; 00111 00113 ElementStyle getNumberStyle() const; 00114 00116 ElementStyle getDirectiveStyle() const; 00117 00119 ElementStyle getTypeStyle() const; 00120 00122 ElementStyle getLineStyle() const; 00123 00125 ElementStyle getSymbolStyle() const; 00126 00130 ElementStyle getKeywordStyle ( const string &className ) ; 00131 00133 bool found() const ; 00134 }; 00135 00136 } 00137 00138 #endif