CodeView  Version0.4
 All Classes Functions Variables
format.h
1 /* libcodeview.so - A programmers editor widget for Atheos
2  Copyright (c) 2001 Andreas Engh-Halstvedt
3  Copyright (c) 2003 Henrik Isaksson
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18  MA 02111-1307, USA
19 */
20 
21 #ifndef F_CODEVIEW_FORMAT_H
22 #define F_CODEVIEW_FORMAT_H
23 
24 #include <gui/gfxtypes.h>
25 #include <pyro/types.h>
26 
27 #include <util/string.h>
28 
29 using namespace std;
30 
31 namespace cv
32 {
33 
43 {
44 public:
45  CodeViewContext( uint32 n ) { nContext = n; }
46  CodeViewContext() { nContext = 0; }
47  virtual int operator==( const CodeViewContext& c ) const { return nContext == c.nContext; }
48  uint32 nContext;
49 };
50 
59 {
60 public:
61  os::Color32_s sColor;
62 };
63 
72 class Format{
73 public:
74 
83  virtual uint GetStyleCount() = 0;
84 
95  virtual const os::String& GetStyleName( char nStyle ) = 0;
96 
106  virtual void SetStyle( char nStyle, const CodeViewStyle& cStyle ) = 0;
107 
117  virtual const CodeViewStyle& GetStyle( char nStyle ) = 0;
118 
137  virtual CodeViewContext Parse( const os::String &cText, os::String &cStyle,
138  CodeViewContext nContext ) = 0;
139 
140 
157  virtual os::String GetIndentString( const os::String &cText, bool bUseTabs, uint nTabSize)=0;
158 
166  virtual uint GetPreviousWordLimit( const os::String &cLine, uint nChr)=0;
167 
175  virtual uint GetNextWordLimit( const os::String &cLine, uint nChr) = 0;
176 
186  virtual int GetFoldLevel( const os::String &cLine, int nOldFoldLevel ) { return nOldFoldLevel; }
187 };
188 
189 } /* end of namespace */
190 
191 #endif /* F_CODEVIEW_FORMAT_H */