Interface INotepadPPGateway
public interface INotepadPPGateway
Methods
AddToolbarIcon(int, ToolbarIcon)
[Obsolete("Use AddToolbarIcon(System.Int32, Npp.DotNet.Plugin.ToolbarIconDarkMode) instead")]
void AddToolbarIcon(int funcItemsIndex, ToolbarIcon icon)
Parameters
funcItemsIndex
inticon
ToolbarIcon
AddToolbarIcon(int, ToolbarIconDarkMode)
void AddToolbarIcon(int funcItemsIndex, ToolbarIconDarkMode icon)
Parameters
funcItemsIndex
inticon
ToolbarIconDarkMode
AddToolbarIcon(int, Bitmap)
[Obsolete("Use AddToolbarIcon(System.Int32, Npp.DotNet.Plugin.ToolbarIconDarkMode) instead")]
void AddToolbarIcon(int funcItemsIndex, Bitmap icon)
Parameters
DefaultModificationFlagsChanged()
Returns true if the active SCN_MODIFIED event mask has been changed from NPP_DEFAULT_SC_MOD_MASK.
bool DefaultModificationFlagsChanged()
Returns
Remarks
Added in 8.7.7
FileNew()
void FileNew()
GetConfigDirectory()
Figure out default N++ config file path
Path is usually %UserProfile%\AppData\Roaming\Notepad++\plugins\config
string GetConfigDirectory()
Returns
GetCurrentFilePath()
Gets the path of the current document.
string GetCurrentFilePath()
Returns
GetCurrentLine()
Gets the text of the currently active line.
string GetCurrentLine()
Returns
- string
The text of the active line.
GetCurrentWord()
Gets the word currently under the caret.
string GetCurrentWord()
Returns
- string
The word under the caret.
GetFilePath(UIntPtr)
Gets the path of the current document.
string GetFilePath(UIntPtr bufferId)
Parameters
bufferId
UIntPtr
Returns
GetNativeLanguage()
Get the name of the active localization file.
string GetNativeLanguage()
Returns
- string
N++ 8.7 and later
The name of the active localization file, without the
.xml
extension.Older versions
"english"
GetNppPath()
string GetNppPath()
Returns
- string
The path to the Notepad++ executable.
GetNppVersion()
(int, int, int) GetNppVersion()
Returns
- (int, int, int)
3-int tuple: (major, minor, bugfix)
Thus GetNppVersion() would return (8, 5, 0) for version 8.5.0 and (7, 7, 1) for version 7.7.1
GetOpenFileNames()
string[] GetOpenFileNames()
Returns
- string[]
GetPluginConfigPath()
string GetPluginConfigPath()
Returns
- string
The path to the Config folder for plugins.
GetPluginsHomePath()
string GetPluginsHomePath()
Returns
- string
The path to the top directory of all installed plugins.
GetSessionFilePath()
string GetSessionFilePath()
Returns
IsDarkModeEnabled()
Checks the return value of the NPPM_ISDARKMODEENABLED message.
bool IsDarkModeEnabled()
Returns
- bool
true if NPPM_ISDARKMODEENABLED returns 1, otherwise false.
Remarks
Added in 8.4.1
OpenFile(string)
Open a file for editing in Notepad++, pretty much like using the app's File - Open menu.
bool OpenFile(string path)
Parameters
path
stringThe path to the file to open.
Returns
SaveCurrentFile()
Open a standard save file dialog to save the current file.
bool SaveCurrentFile()
Returns
SetCurrentLanguage(LangType)
void SetCurrentLanguage(LangType language)
Parameters
language
LangType
SetModificationFlags(ModificationFlags)
Sends NPPM_ADDSCNMODIFIEDFLAGS with the given flags
.
void SetModificationFlags(ModificationFlags flags)
Parameters
flags
ModificationFlagsThe additional ModificationFlags to monitor.
Remarks
Added in 8.7.7
SetStatusBarSection(string, StatusBarSection)
The status bar is the bar at the bottom with the document type, EOL type, current position, line, etc.
Set the message for one of the sections of that bar.
void SetStatusBarSection(string message, StatusBarSection section)
Parameters
message
stringText to display.
section
StatusBarSectionA StatusBarSection value.