source: trunk/tools/designer/editor/cindent.h

Last change on this file was 197, checked in by rudi, 14 years ago

Added QtDesigner

File size: 1.8 KB
Line 
1/**********************************************************************
2** Copyright (C) 2000-2007 Trolltech ASA. All rights reserved.
3**
4** This file is part of Qt Designer.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
12** licenses may use this file in accordance with the Qt Commercial License
13** Agreement provided with the Software.
14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17**
18** See http://www.trolltech.com/gpl/ for GPL licensing information.
19** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
20** information about Qt Commercial License Agreements.
21**
22** Contact info@trolltech.com if any conditions of this licensing are
23** not clear to you.
24**
25**********************************************************************/
26
27#ifndef CINDENT_H
28#define CINDENT_H
29
30#include <private/qrichtext_p.h>
31
32class CIndent : public QTextIndent
33{
34public:
35 CIndent();
36 virtual ~CIndent() {}
37 void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent, int *newIndent );
38
39 void setTabSize( int ts );
40 void setIndentSize( int is );
41 void setAutoIndent( bool ai ) { autoIndent = ai; reindent(); }
42 void setKeepTabs( bool kt ) { keepTabs = kt; }
43
44private:
45 void reindent();
46 void indentLine( QTextParagraph *p, int &oldIndent, int &newIndent );
47 void tabify( QString &s );
48
49public:
50 int tabSize, indentSize;
51 bool autoIndent, keepTabs;
52 QTextDocument *lastDoc;
53
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.