1 2 #ifndef INDENTMAKER_H 3 #define INDENTMAKER_H 4 5 #include <sdk.h> 6 #ifndef CB_PRECOMP 7 #include <cbstyledtextctrl.h> 8 #endif 9 10 #include "indentestimator.h" 11 12 class IsMultiLines 13 { 14 public : IsMultiLines()15 IsMultiLines() 16 { 17 haveMultiLines = false; 18 iFirstLineNo = -1; 19 iEndLineNo = -1; 20 } 21 ~IsMultiLines()22 ~IsMultiLines() 23 { 24 } 25 reset()26 void reset() 27 { 28 haveMultiLines = false; 29 iFirstLineNo = -1; 30 iEndLineNo = -1; 31 } 32 33 bool haveMultiLines; 34 int iFirstLineNo; 35 int iEndLineNo; 36 }; 37 38 39 40 class FormatIndent 41 { 42 public: 43 /** Constructor. */ 44 FormatIndent(); 45 /** Destructor. */ 46 ~FormatIndent(); 47 48 void Format(); 49 50 private: 51 void FormatProject(); 52 void FormatActiveFile(); 53 void FormatFile(const wxString &filename); 54 void FormatSelection(); 55 void ReadConfig(); 56 void FormatText(const wxString& textIn, int indentStart, const wxString& eolChars, wxString& formattedText); 57 void ReplaceTextInEditor(const wxString& text, bool isSelection, cbStyledTextCtrl* control); 58 wxString GetEOLChars(cbStyledTextCtrl* control); 59 60 IndentEstimator m_IndentEstimator; 61 62 wxString m_IndentStr; 63 bool m_TrimFromRight; 64 }; 65 66 #endif // INDENTMAKER_H 67