Source-highlight Library
/home/bettini/work/source-highlight/src-highlite/lib/srchilite/linenumgenerator.h
00001 //
00002 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
00003 //
00004 // Copyright: See COPYING file that comes with this distribution
00005 //
00006 
00007 #ifndef LINENUMGENERATOR_H_
00008 #define LINENUMGENERATOR_H_
00009 
00010 #include <string>
00011 
00012 #include "textstyle.h"
00013 
00014 namespace srchilite {
00015 
00019 class LineNumGenerator {
00021     unsigned int digitNum;
00022 
00024     char padding;
00025 
00027     TextStyle lineStyle;
00028 
00030     TextStyle anchorStyle;
00031 
00033     std::string anchorLinePrefix;
00034 
00035 public:
00036     LineNumGenerator(const TextStyle &lineStyle, unsigned int digitNum, char padding = '0');
00037     ~LineNumGenerator();
00038 
00039     void setAnchorStyle(const TextStyle &_anchorStyle) {
00040         anchorStyle = _anchorStyle;
00041     }
00042 
00043     void setAnchorPrefix(const std::string &_anchorLinePrefix) {
00044         anchorLinePrefix = _anchorLinePrefix;
00045     }
00046 
00047     void setDigitNum(unsigned int _digitNum) {
00048         digitNum = _digitNum;
00049     }
00050 
00056     const std::string generateLine(unsigned int line);
00057 };
00058 
00059 }
00060 
00061 #endif /*LINENUMGENERATOR_H_*/