-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathSciMessager.h
87 lines (80 loc) · 3.91 KB
/
SciMessager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/////////////////////////////////////////////////////////////////////////////
// //
// IndentByFold - Auto indent based on the fold level //
// Copyright (C) 2011 Ben Bluemel <[email protected]> //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
// //
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "NPP/Scintilla.h"
class CSciMessager
{
public:
CSciMessager( HWND hSciWnd = NULL );
virtual ~CSciMessager();
LRESULT SendSciMsg( UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0 );
LRESULT SendSciMsg( UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0 ) const;
HWND getSciWnd() const { return m_hSciWnd; }
void setSciWnd( HWND hSciWnd ) { m_hSciWnd = hSciWnd; }
// Text retrieval and modification
int getText( int len, char* pText ) const;
void setText( const char* pText );
void beginUndoAction();
void endUndoAction();
unsigned char getCharAt( int pos ) const;
unsigned int getCodePage() const; // 0 (non-Unicode), SC_CP_UTF8, DBCS etc.
int getCurrentPos() const;
int getCaretInLine() const;
LRESULT getDocPointer() const; // identifies the document
int getLineFromPos( int pos ) const;
int getLineState( int line ) const;
int getSelectionMode() const; // SC_SEL_STREAM, SC_SEL_RECTANGLE, SC_SEL_LINES
int getSelectionEnd() const;
int getSelectionStart() const;
int getStyleAt( int pos ) const;
int getSelText( char* pText ) const;
int getTextLength() const;
int getTextRange( int pos1, int pos2, char* pText ) const;
void goToPos( int pos );
bool isModified() const;
bool isSelectionRectangle() const;
bool isAutoCActive() const;
void setCodePage( unsigned int codePage );
void setSel( int anchorPos, int currentPos );
void setSelectionMode( int mode ); // SC_SEL_STREAM, SC_SEL_RECTANGLE, SC_SEL_LINES
void setSelectionEnd( int pos );
void setSelectionStart( int pos );
void setSelText( const char* pText );
void autoCShow( int len, const char *list );
void autoCSetSeparator( char separator );
void autoCSetIgnoreCase( bool ignoreCase ) const;
int getEOLMode() const;
int getTabWidth() const;
int getFoldParent( int line ) const;
int getFoldLevel( int line ) const;
int getLineIndentation( int line ) const;
int getLineIndentPosition( int line ) const;
int getLineCount() const;
int getLineEndPos( int line ) const;
int getPosFromLine( int line ) const;
int getLineLength( int line ) const;
int getLine( int line, char * textbuf ) const;
void setLineIndentation( int line, int indentation );
protected:
HWND m_hSciWnd;
SciFnDirect m_pSciMsg;
sptr_t m_pSciWndData;
};