2012-04-15 09:50:22 +00:00
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <don.h@free.fr>
2009-04-24 23:34:47 +00:00
//
2012-04-15 09:50:22 +00:00
// 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.
2009-04-24 23:34:47 +00:00
//
2012-04-15 09:50:22 +00:00
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
2009-04-24 23:34:47 +00:00
//
2012-04-15 09:50:22 +00:00
// 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.
2009-04-24 23:34:47 +00:00
# ifndef NOTEPAD_PLUS_H
# define NOTEPAD_PLUS_H
2009-09-04 00:10:01 +00:00
# ifndef SCINTILLA_EDIT_VIEW_H
2009-04-24 23:34:47 +00:00
# include "ScintillaEditView.h"
2009-09-04 00:10:01 +00:00
# endif //SCINTILLA_EDIT_VIEW_H
# ifndef DOCTABVIEW_H
2009-04-24 23:34:47 +00:00
# include "DocTabView.h"
2009-09-04 00:10:01 +00:00
# endif //DOCTABVIEW_H
2009-04-24 23:34:47 +00:00
2009-09-04 00:10:01 +00:00
# ifndef SPLITTER_CONTAINER_H
2009-04-24 23:34:47 +00:00
# include "SplitterContainer.h"
2009-09-04 00:10:01 +00:00
# endif //SPLITTER_CONTAINER_H
# ifndef FIND_REPLACE_DLG_H
2009-04-24 23:34:47 +00:00
# include "FindReplaceDlg.h"
2009-09-04 00:10:01 +00:00
# endif //FIND_REPLACE_DLG_H
# ifndef ABOUT_DLG_H
2009-04-24 23:34:47 +00:00
# include "AboutDlg.h"
2009-09-04 00:10:01 +00:00
# endif //ABOUT_DLG_H
# ifndef RUN_DLG_H
2009-04-24 23:34:47 +00:00
# include "RunDlg.h"
2009-09-04 00:10:01 +00:00
# endif //RUN_DLG_H
# ifndef STATUS_BAR_H
2009-04-24 23:34:47 +00:00
# include "StatusBar.h"
2009-09-04 00:10:01 +00:00
# endif //STATUS_BAR_H
# ifndef LASTRECENTFILELIST_H
2009-04-24 23:34:47 +00:00
# include "lastRecentFileList.h"
2009-09-04 00:10:01 +00:00
# endif //LASTRECENTFILELIST_H
# ifndef GOTILINE_DLG_H
2009-04-24 23:34:47 +00:00
# include "GoToLineDlg.h"
2009-09-04 00:10:01 +00:00
# endif //GOTILINE_DLG_H
2011-05-19 21:19:05 +00:00
# ifndef FINDCHARSINRANGE_DLG_H
# include "FindCharsInRange.h"
# endif //FINDCHARSINRANGE_DLG_H
2009-09-04 00:10:01 +00:00
# ifndef COLUMNEDITOR_H
2009-04-24 23:34:47 +00:00
# include "columnEditor.h"
2009-09-04 00:10:01 +00:00
# endif //COLUMNEDITOR_H
# ifndef WORD_STYLE_H
2009-04-24 23:34:47 +00:00
# include "WordStyleDlg.h"
2009-09-04 00:10:01 +00:00
# endif //WORD_STYLE_H
# ifndef TRAY_ICON_CONTROLER_H
2009-04-24 23:34:47 +00:00
# include "trayIconControler.h"
2009-09-04 00:10:01 +00:00
# endif //TRAY_ICON_CONTROLER_H
# ifndef PLUGINSMANAGER_H
2009-04-24 23:34:47 +00:00
# include "PluginsManager.h"
2009-09-04 00:10:01 +00:00
# endif //PLUGINSMANAGER_H
/*
# ifndef NOTEPAD_PLUS_MSGS_H
2009-04-24 23:34:47 +00:00
# include "Notepad_plus_msgs.h"
2009-09-04 00:10:01 +00:00
# endif //NOTEPAD_PLUS_MSGS_H
*/
# ifndef PREFERENCE_DLG_H
2009-04-24 23:34:47 +00:00
# include "preferenceDlg.h"
2009-09-04 00:10:01 +00:00
# endif //PREFERENCE_DLG_H
# ifndef WINDOWS_DLG_H
2009-04-24 23:34:47 +00:00
# include "WindowsDlg.h"
2009-09-04 00:10:01 +00:00
# endif //WINDOWS_DLG_H
# ifndef RUN_MACRO_DLG_H
2009-04-24 23:34:47 +00:00
# include "RunMacroDlg.h"
2009-09-04 00:10:01 +00:00
# endif //RUN_MACRO_DLG_H
# ifndef DOCKINGMANAGER_H
2009-04-24 23:34:47 +00:00
# include "DockingManager.h"
2009-09-04 00:10:01 +00:00
# endif //DOCKINGMANAGER_H
# ifndef PROCESSUS_H
2009-04-24 23:34:47 +00:00
# include "Process.h"
2009-09-04 00:10:01 +00:00
# endif //PROCESSUS_H
# ifndef AUTOCOMPLETION_H
2009-04-24 23:34:47 +00:00
# include "AutoCompletion.h"
2009-09-04 00:10:01 +00:00
# endif //AUTOCOMPLETION_H
# ifndef SMARTHIGHLIGHTER_H
2009-04-24 23:34:47 +00:00
# include "SmartHighlighter.h"
2009-09-04 00:10:01 +00:00
# endif //SMARTHIGHLIGHTER_H
# ifndef SCINTILLACTRLS_H
# include "ScintillaCtrls.h"
# endif //SCINTILLACTRLS_H
2009-04-24 23:34:47 +00:00
2009-12-13 23:54:02 +00:00
# ifndef SIZE_DLG_H
# include "lesDlgs.h"
# endif //SIZE_DLG_H
2010-03-05 00:15:06 +00:00
# include "localization.h"
2013-08-03 23:40:07 +00:00
# include <vector>
2011-05-19 21:19:05 +00:00
2010-03-05 00:15:06 +00:00
2009-04-24 23:34:47 +00:00
# define MENU 0x01
# define TOOLBAR 0x02
2010-02-21 18:17:54 +00:00
# define URL_REG_EXPR "[A-Za-z]+: //[A-Za-z0-9_\\-\\+~.:?&@=/%#,;\\{\\}\\(\\)\\[\\]\\|\\*\\!\\\\]+"
2010-02-13 01:12:17 +00:00
2009-04-24 23:34:47 +00:00
enum FileTransferMode {
TransferClone = 0x01 ,
TransferMove = 0x02
} ;
enum WindowStatus { //bitwise mask
WindowMainActive = 0x01 ,
WindowSubActive = 0x02 ,
WindowBothActive = 0x03 , //little helper shortcut
WindowUserActive = 0x04 ,
WindowMask = 0x07
} ;
2010-12-05 19:33:48 +00:00
enum trimOp {
lineHeader = 0 ,
lineTail = 1 ,
lineEol = 2
2009-04-24 23:34:47 +00:00
} ;
2010-01-29 23:52:47 +00:00
2012-08-25 19:23:16 +00:00
enum spaceTab {
tab2Space = 0 ,
space2TabLeading = 1 ,
space2TabAll = 2
} ;
2009-04-24 23:34:47 +00:00
struct TaskListInfo ;
struct VisibleGUIConf {
bool isPostIt ;
bool isFullScreen ;
//Used by both views
bool isMenuShown ;
//bool isToolbarShown; //toolbar forcefully hidden by hiding rebar
DWORD_PTR preStyle ;
//used by postit only
bool isTabbarShown ;
bool isAlwaysOnTop ;
bool isStatusbarShown ;
//used by fullscreen only
WINDOWPLACEMENT _winPlace ;
VisibleGUIConf ( ) : isPostIt ( false ) , isFullScreen ( false ) ,
isAlwaysOnTop ( false ) , isMenuShown ( true ) , isTabbarShown ( true ) ,
isStatusbarShown ( true ) , preStyle ( WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN )
{
_winPlace . length = 0 ;
} ;
} ;
2012-01-01 19:29:31 +00:00
2009-04-24 23:34:47 +00:00
class FileDialog ;
2010-03-26 00:22:14 +00:00
class Notepad_plus_Window ;
2011-04-13 07:08:51 +00:00
class AnsiCharPanel ;
2011-05-19 21:19:05 +00:00
class ClipboardHistoryPanel ;
class VerticalFileSwitcher ;
2011-08-29 23:01:41 +00:00
class ProjectPanel ;
2012-01-30 00:00:50 +00:00
class DocumentMap ;
2012-11-24 20:14:52 +00:00
class FunctionListPanel ;
2011-05-19 21:19:05 +00:00
2010-03-26 00:22:14 +00:00
class Notepad_plus {
friend class Notepad_plus_Window ;
2009-04-24 23:34:47 +00:00
public :
Notepad_plus ( ) ;
2010-02-13 01:12:17 +00:00
virtual ~ Notepad_plus ( ) ;
2010-03-26 00:22:14 +00:00
LRESULT init ( HWND hwnd ) ;
LRESULT process ( HWND hwnd , UINT Message , WPARAM wParam , LPARAM lParam ) ;
2010-02-13 01:12:17 +00:00
void killAllChildren ( ) ;
2010-04-20 19:30:50 +00:00
/*
HWND getWindowHandle ( ) const {
return _pPublicInterface - > getHSelf ( ) ;
} ;
*/
2009-04-24 23:34:47 +00:00
2010-03-26 00:22:14 +00:00
enum comment_mode { cm_comment , cm_uncomment , cm_toggle } ;
2009-04-24 23:34:47 +00:00
void setTitle ( ) ;
void getTaskListInfo ( TaskListInfo * tli ) ;
// For filtering the modeless Dialog message
// fileOperations
//The doXXX functions apply to a single buffer and dont need to worry about views, with the excpetion of doClose, since closing one view doesnt have to mean the document is gone
2013-04-02 16:25:04 +00:00
BufferID doOpen ( const TCHAR * fileName , bool isReadOnly = false , int encoding = - 1 ) ;
2009-04-24 23:34:47 +00:00
bool doReload ( BufferID id , bool alert = true ) ;
bool doSave ( BufferID , const TCHAR * filename , bool isSaveCopy = false ) ;
void doClose ( BufferID , int whichOne ) ;
//bool doDelete(const TCHAR *fileName) const {return ::DeleteFile(fileName) != 0;};
void fileOpen ( ) ;
2010-11-13 11:15:06 +00:00
void fileNew ( ) ;
2010-01-29 23:52:47 +00:00
bool fileReload ( ) {
BufferID buf = _pEditView - > getCurrentBufferID ( ) ;
return doReload ( buf , buf - > isDirty ( ) ) ;
} ;
2009-04-24 23:34:47 +00:00
bool fileClose ( BufferID id = BUFFER_INVALID , int curView = - 1 ) ; //use curView to override view to close from
bool fileCloseAll ( ) ;
bool fileCloseAllButCurrent ( ) ;
2013-08-03 23:40:07 +00:00
bool fileCloseAllGiven ( const std : : vector < int > & krvecBufferIndexes ) ;
bool fileCloseAllToLeft ( ) ;
bool fileCloseAllToRight ( ) ;
2009-04-24 23:34:47 +00:00
bool fileSave ( BufferID id = BUFFER_INVALID ) ;
bool fileSaveAll ( ) ;
bool fileSaveAs ( BufferID id = BUFFER_INVALID , bool isSaveCopy = false ) ;
2009-07-04 11:33:17 +00:00
bool fileDelete ( BufferID id = BUFFER_INVALID ) ;
bool fileRename ( BufferID id = BUFFER_INVALID ) ;
2009-04-24 23:34:47 +00:00
bool addBufferToView ( BufferID id , int whichOne ) ;
bool moveBuffer ( BufferID id , int whereTo ) ; //assumes whereFrom is otherView(whereTo)
bool switchToFile ( BufferID buffer ) ; //find buffer in active view then in other view.
// end fileOperations
bool isFileSession ( const TCHAR * filename ) ;
void filePrint ( bool showDialog ) ;
2010-07-27 15:59:20 +00:00
bool saveScintillaParams ( ) ;
2009-04-24 23:34:47 +00:00
2009-09-04 00:10:01 +00:00
bool saveGUIParams ( ) ;
2011-09-25 01:33:34 +00:00
bool saveProjectPanelsParams ( ) ;
2009-09-04 00:10:01 +00:00
void saveDockingParams ( ) ;
2010-02-17 19:23:18 +00:00
void saveUserDefineLangs ( ) {
if ( ScintillaEditView : : getUserDefineDlg ( ) - > isDirty ( ) )
( NppParameters : : getInstance ( ) ) - > writeUserDefinedLang ( ) ;
} ;
void saveShortcuts ( ) {
NppParameters : : getInstance ( ) - > writeShortcuts ( ) ;
} ;
2009-09-04 00:10:01 +00:00
void saveSession ( const Session & session ) ;
2010-02-17 19:23:18 +00:00
void saveFindHistory ( ) {
_findReplaceDlg . saveFindHistory ( ) ;
( NppParameters : : getInstance ( ) ) - > writeFindHistory ( ) ;
} ;
2009-04-24 23:34:47 +00:00
void getCurrentOpenedFiles ( Session & session ) ;
bool fileLoadSession ( const TCHAR * fn = NULL ) ;
const TCHAR * fileSaveSession ( size_t nbFile , TCHAR * * fileNames , const TCHAR * sessionFile2save ) ;
const TCHAR * fileSaveSession ( size_t nbFile = 0 , TCHAR * * fileNames = NULL ) ;
void changeToolBarIcons ( ) ;
bool doBlockComment ( comment_mode currCommentMode ) ;
bool doStreamComment ( ) ;
2012-08-31 19:14:00 +00:00
//--FLS: undoStreamComment: New function unDoStreamComment()
bool undoStreamComment ( ) ;
2009-04-24 23:34:47 +00:00
bool addCurrentMacro ( ) ;
2010-08-15 18:52:55 +00:00
void macroPlayback ( Macro ) ;
2010-02-13 01:12:17 +00:00
void loadLastSession ( ) {
Session lastSession = ( NppParameters : : getInstance ( ) ) - > getSession ( ) ;
loadSession ( lastSession ) ;
} ;
2009-04-24 23:34:47 +00:00
bool loadSession ( Session & session ) ;
2010-03-26 00:22:14 +00:00
2009-04-24 23:34:47 +00:00
void notifyBufferChanged ( Buffer * buffer , int mask ) ;
bool findInFiles ( ) ;
bool replaceInFiles ( ) ;
void setFindReplaceFolderFilter ( const TCHAR * dir , const TCHAR * filters ) ;
2009-08-11 23:55:57 +00:00
vector < generic_string > addNppComponents ( const TCHAR * destDir , const TCHAR * extFilterName , const TCHAR * extFilter ) ;
2009-11-26 01:34:25 +00:00
int getHtmlXmlEncoding ( const TCHAR * fileName ) const ;
2010-03-26 00:22:14 +00:00
HACCEL getAccTable ( ) const {
return _accelerator . getAccTable ( ) ;
} ;
bool emergency ( generic_string emergencySavedDir ) ;
2009-04-24 23:34:47 +00:00
2010-03-26 00:22:14 +00:00
2009-04-24 23:34:47 +00:00
private :
2010-03-26 00:22:14 +00:00
Notepad_plus_Window * _pPublicInterface ;
2009-04-24 23:34:47 +00:00
Window * _pMainWindow ;
DockingManager _dockingManager ;
2011-05-19 21:19:05 +00:00
vector < int > _internalFuncIDs ;
2009-04-24 23:34:47 +00:00
AutoCompletion _autoCompleteMain ;
AutoCompletion _autoCompleteSub ; //each Scintilla has its own autoComplete
SmartHighlighter _smartHighlighter ;
2010-03-05 00:15:06 +00:00
NativeLangSpeaker _nativeLangSpeaker ;
2009-04-24 23:34:47 +00:00
DocTabView _mainDocTab ;
DocTabView _subDocTab ;
DocTabView * _pDocTab ;
DocTabView * _pNonDocTab ;
ScintillaEditView _subEditView ;
ScintillaEditView _mainEditView ;
ScintillaEditView _invisibleEditView ; //for searches
ScintillaEditView _fileEditView ; //for FileManager
ScintillaEditView * _pEditView ;
ScintillaEditView * _pNonEditView ;
SplitterContainer * _pMainSplitter ;
SplitterContainer _subSplitter ;
2013-05-01 15:43:51 +00:00
ContextMenu _tabPopupMenu , _tabPopupDropMenu , _fileSwitcherMultiFilePopupMenu ;
2009-04-24 23:34:47 +00:00
ToolBar _toolBar ;
IconList _docTabIconList ;
StatusBar _statusBar ;
bool _toReduceTabBar ;
ReBar _rebarTop ;
ReBar _rebarBottom ;
// Dialog
FindReplaceDlg _findReplaceDlg ;
FindIncrementDlg _incrementFindDlg ;
AboutDlg _aboutDlg ;
RunDlg _runDlg ;
GoToLineDlg _goToLineDlg ;
ColumnEditorDlg _colEditorDlg ;
WordStyleDlg _configStyleDlg ;
PreferenceDlg _preference ;
2011-05-19 21:19:05 +00:00
FindCharsInRangeDlg _findCharsInRangeDlg ;
2009-04-24 23:34:47 +00:00
// a handle list of all the Notepad++ dialogs
vector < HWND > _hModelessDlgs ;
LastRecentFileList _lastRecentFileList ;
2010-03-16 22:32:58 +00:00
//vector<iconLocator> _customIconVect;
2009-04-24 23:34:47 +00:00
WindowsMenu _windowsMenu ;
HMENU _mainMenuHandle ;
bool _sysMenuEntering ;
2010-03-26 00:22:14 +00:00
2009-04-24 23:34:47 +00:00
// For FullScreen/PostIt features
VisibleGUIConf _beforeSpecialView ;
void fullScreenToggle ( ) ;
void postItToggle ( ) ;
// Keystroke macro recording and playback
Macro _macro ;
bool _recordingMacro ;
RunMacroDlg _runMacroDlg ;
// For hotspot
bool _linkTriggered ;
bool _isHotspotDblClicked ;
2012-05-25 23:40:44 +00:00
bool _isFolding ;
2009-04-24 23:34:47 +00:00
//For Dynamic selection highlight
CharacterRange _prevSelectedRange ;
struct ActivateAppInfo {
bool _isActivated ;
int _x ;
int _y ;
ActivateAppInfo ( ) : _isActivated ( false ) , _x ( 0 ) , _y ( 0 ) { } ;
} _activeAppInf ;
//Synchronized Scolling
struct SyncInfo {
int _line ;
int _column ;
bool _isSynScollV ;
bool _isSynScollH ;
SyncInfo ( ) : _line ( 0 ) , _column ( 0 ) , _isSynScollV ( false ) , _isSynScollH ( false ) { } ;
bool doSync ( ) const { return ( _isSynScollV | | _isSynScollH ) ; } ;
} _syncInfo ;
bool _isUDDocked ;
trayIconControler * _pTrayIco ;
int _zoomOriginalValue ;
Accelerator _accelerator ;
ScintillaAccelerator _scintaccelerator ;
PluginsManager _pluginsManager ;
2009-12-13 23:54:02 +00:00
ButtonDlg _restoreButton ;
2009-04-24 23:34:47 +00:00
bool _isFileOpening ;
2013-09-09 17:30:24 +00:00
bool _isAdministrator ;
2009-04-24 23:34:47 +00:00
2009-09-04 00:10:01 +00:00
ScintillaCtrls _scintillaCtrls4Plugins ;
2009-04-24 23:34:47 +00:00
vector < pair < int , int > > _hideLinesMarks ;
2009-06-07 01:49:42 +00:00
StyleArray _hotspotStyles ;
2009-09-09 22:56:15 +00:00
bool _rememberThisSession ; // always true. except -nosession is indicated on the launch time
2009-04-24 23:34:47 +00:00
2010-03-26 00:22:14 +00:00
2011-04-13 07:08:51 +00:00
AnsiCharPanel * _pAnsiCharPanel ;
2011-04-20 21:45:18 +00:00
ClipboardHistoryPanel * _pClipboardHistoryPanel ;
2011-05-19 21:19:05 +00:00
VerticalFileSwitcher * _pFileSwitcherPanel ;
2011-09-23 00:19:29 +00:00
ProjectPanel * _pProjectPanel_1 ;
2011-09-20 23:55:35 +00:00
ProjectPanel * _pProjectPanel_2 ;
ProjectPanel * _pProjectPanel_3 ;
2009-04-24 23:34:47 +00:00
2012-01-30 00:00:50 +00:00
DocumentMap * _pDocMap ;
2012-11-24 20:14:52 +00:00
FunctionListPanel * _pFuncList ;
2012-01-30 00:00:50 +00:00
2009-04-24 23:34:47 +00:00
BOOL notify ( SCNotification * notification ) ;
2010-07-26 00:12:02 +00:00
void specialCmd ( int id ) ;
2009-04-24 23:34:47 +00:00
void command ( int id ) ;
//Document management
UCHAR _mainWindowStatus ; //For 2 views and user dialog if docked
int _activeView ;
//User dialog docking
void dockUserDlg ( ) ;
void undockUserDlg ( ) ;
//View visibility
void showView ( int whichOne ) ;
bool viewVisible ( int whichOne ) ;
void hideView ( int whichOne ) ;
void hideCurrentView ( ) ;
bool bothActive ( ) { return ( _mainWindowStatus & WindowBothActive ) = = WindowBothActive ; } ;
bool reloadLang ( ) ;
bool loadStyles ( ) ;
int currentView ( ) {
return _activeView ;
} ;
2009-09-04 00:10:01 +00:00
2009-04-24 23:34:47 +00:00
int otherView ( ) {
return ( _activeView = = MAIN_VIEW ? SUB_VIEW : MAIN_VIEW ) ;
} ;
2009-09-04 00:10:01 +00:00
2009-04-24 23:34:47 +00:00
int otherFromView ( int whichOne ) {
return ( whichOne = = MAIN_VIEW ? SUB_VIEW : MAIN_VIEW ) ;
} ;
2009-09-04 00:10:01 +00:00
2009-04-24 23:34:47 +00:00
bool canHideView ( int whichOne ) ; //true if view can safely be hidden (no open docs etc)
int switchEditViewTo ( int gid ) ; //activate other view (set focus etc)
void docGotoAnotherEditView ( FileTransferMode mode ) ; //TransferMode
void docOpenInNewInstance ( FileTransferMode mode , int x = 0 , int y = 0 ) ;
void loadBufferIntoView ( BufferID id , int whichOne , bool dontClose = false ) ; //Doesnt _activate_ the buffer
2011-06-13 01:24:00 +00:00
bool removeBufferFromView ( BufferID id , int whichOne ) ; //Activates alternative of possible, or creates clean document if not clean already
2009-04-24 23:34:47 +00:00
bool activateBuffer ( BufferID id , int whichOne ) ; //activate buffer in that view if found
void notifyBufferActivated ( BufferID bufid , int view ) ;
void performPostReload ( int whichOne ) ;
//END: Document management
2009-09-04 00:10:01 +00:00
int doSaveOrNot ( const TCHAR * fn ) ;
int doReloadOrNot ( const TCHAR * fn , bool dirty ) ;
int doCloseOrNot ( const TCHAR * fn ) ;
int doDeleteOrNot ( const TCHAR * fn ) ;
int doActionOrNot ( const TCHAR * title , const TCHAR * displayText , int type ) ;
2009-04-24 23:34:47 +00:00
2009-09-04 00:10:01 +00:00
void enableMenu ( int cmdID , bool doEnable ) const ;
2009-04-24 23:34:47 +00:00
void enableCommand ( int cmdID , bool doEnable , int which ) const ;
void checkClipboard ( ) ;
void checkDocState ( ) ;
void checkUndoState ( ) ;
void checkMacroState ( ) ;
void checkSyncState ( ) ;
void dropFiles ( HDROP hdrop ) ;
void checkModifiedDocument ( ) ;
void getMainClientRect ( RECT & rc ) const ;
2010-07-26 00:12:02 +00:00
void staticCheckMenuAndTB ( ) const ;
2009-04-24 23:34:47 +00:00
void dynamicCheckMenuAndTB ( ) const ;
2009-09-04 00:10:01 +00:00
void enableConvertMenuItems ( formatType f ) const ;
2009-12-01 01:20:13 +00:00
void checkUnicodeMenuItems ( ) const ;
2009-04-24 23:34:47 +00:00
2011-06-18 21:53:14 +00:00
generic_string getLangDesc ( LangType langType , bool getName = false ) ;
2009-04-24 23:34:47 +00:00
void setLangStatus ( LangType langType ) {
_statusBar . setText ( getLangDesc ( langType ) . c_str ( ) , STATUSBAR_DOC_TYPE ) ;
} ;
2009-09-04 00:10:01 +00:00
void setDisplayFormat ( formatType f ) ;
2009-11-22 01:52:07 +00:00
int getCmdIDFromEncoding ( int encoding ) const ;
void setUniModeText ( ) ;
2009-04-24 23:34:47 +00:00
void checkLangsMenu ( int id ) const ;
2009-07-04 11:33:17 +00:00
void setLanguage ( LangType langType ) ;
2009-04-24 23:34:47 +00:00
enum LangType menuID2LangType ( int cmdID ) ;
void checkMenuItem ( int itemID , bool willBeChecked ) const {
: : CheckMenuItem ( _mainMenuHandle , itemID , MF_BYCOMMAND | ( willBeChecked ? MF_CHECKED : MF_UNCHECKED ) ) ;
} ;
void MaintainIndentation ( TCHAR ch ) ;
2012-10-19 00:20:40 +00:00
void addHotSpot ( ) ;
2009-04-24 23:34:47 +00:00
void bookmarkAdd ( int lineno ) const {
if ( lineno = = - 1 )
lineno = _pEditView - > getCurrentLineNumber ( ) ;
if ( ! bookmarkPresent ( lineno ) )
_pEditView - > execute ( SCI_MARKERADD , lineno , MARK_BOOKMARK ) ;
} ;
void bookmarkDelete ( int lineno ) const {
if ( lineno = = - 1 )
lineno = _pEditView - > getCurrentLineNumber ( ) ;
if ( bookmarkPresent ( lineno ) )
_pEditView - > execute ( SCI_MARKERDELETE , lineno , MARK_BOOKMARK ) ;
} ;
bool bookmarkPresent ( int lineno ) const {
if ( lineno = = - 1 )
lineno = _pEditView - > getCurrentLineNumber ( ) ;
LRESULT state = _pEditView - > execute ( SCI_MARKERGET , lineno ) ;
return ( ( state & ( 1 < < MARK_BOOKMARK ) ) ! = 0 ) ;
} ;
void bookmarkToggle ( int lineno ) const {
if ( lineno = = - 1 )
lineno = _pEditView - > getCurrentLineNumber ( ) ;
if ( bookmarkPresent ( lineno ) )
bookmarkDelete ( lineno ) ;
else
bookmarkAdd ( lineno ) ;
} ;
void bookmarkNext ( bool forwardScan ) ;
void bookmarkClearAll ( ) const {
_pEditView - > execute ( SCI_MARKERDELETEALL , MARK_BOOKMARK ) ;
} ;
2009-09-04 00:10:01 +00:00
void copyMarkedLines ( ) ;
void cutMarkedLines ( ) ;
2011-02-19 15:06:53 +00:00
void deleteMarkedLines ( bool isMarked ) ;
2009-09-04 00:10:01 +00:00
void pasteToMarkedLines ( ) ;
void deleteMarkedline ( int ln ) ;
2010-05-27 00:05:51 +00:00
void inverseMarks ( ) ;
2009-09-04 00:10:01 +00:00
void replaceMarkedline ( int ln , const TCHAR * str ) ;
generic_string getMarkedLine ( int ln ) ;
2009-04-24 23:34:47 +00:00
void findMatchingBracePos ( int & braceAtCaret , int & braceOpposite ) ;
2009-12-01 01:20:13 +00:00
bool braceMatch ( ) ;
2009-04-24 23:34:47 +00:00
void activateNextDoc ( bool direction ) ;
void activateDoc ( int pos ) ;
void updateStatusBar ( ) ;
2010-09-19 01:27:41 +00:00
size_t getSelectedCharNumber ( UniMode ) ;
size_t getCurrentDocCharCount ( UniMode u ) ;
2009-10-04 13:13:45 +00:00
int getSelectedAreas ( ) ;
size_t getSelectedBytes ( ) ;
bool isFormatUnicode ( UniMode ) ;
int getBOMSize ( UniMode ) ;
2009-04-24 23:34:47 +00:00
void showAutoComp ( ) ;
void autoCompFromCurrentFile ( bool autoInsert = true ) ;
void showFunctionComp ( ) ;
2010-03-05 00:15:06 +00:00
//void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText);
2013-05-11 20:55:09 +00:00
bool replaceInOpenedFiles ( ) ;
2009-04-24 23:34:47 +00:00
bool findInOpenedFiles ( ) ;
bool findInCurrentFile ( ) ;
bool matchInList ( const TCHAR * fileName , const vector < generic_string > & patterns ) ;
void getMatchedFileNames ( const TCHAR * dir , const vector < generic_string > & patterns , vector < generic_string > & fileNames , bool isRecursive , bool isInHiddenDir ) ;
void doSynScorll ( HWND hW ) ;
2009-09-04 00:10:01 +00:00
void setWorkingDir ( const TCHAR * dir ) ;
2009-04-24 23:34:47 +00:00
bool str2Cliboard ( const TCHAR * str2cpy ) ;
bool bin2Cliboard ( const UCHAR * uchar2cpy , size_t length ) ;
bool getIntegralDockingData ( tTbData & dockData , int & iCont , bool & isVisible ) ;
2009-09-04 00:10:01 +00:00
int getLangFromMenuName ( const TCHAR * langName ) ;
generic_string getLangFromMenu ( const Buffer * buf ) ;
2009-04-24 23:34:47 +00:00
2010-01-31 17:45:32 +00:00
generic_string Notepad_plus : : exts2Filters ( generic_string exts ) const ;
2009-09-22 21:30:29 +00:00
int setFileOpenSaveDlgFilters ( FileDialog & fDlg , int langType = - 1 ) ;
2009-04-24 23:34:47 +00:00
void markSelectedTextInc ( bool enable ) ;
2009-09-04 00:10:01 +00:00
Style * getStyleFromName ( const TCHAR * styleName ) ;
2009-04-24 23:34:47 +00:00
bool dumpFiles ( const TCHAR * outdir , const TCHAR * fileprefix = TEXT ( " " ) ) ; //helper func
void drawTabbarColoursFromStylerArray ( ) ;
void loadCommandlineParams ( const TCHAR * commandLine , CmdLineParams * pCmdParams ) ;
2009-09-04 00:10:01 +00:00
bool noOpenedDoc ( ) const ;
2009-11-15 17:01:52 +00:00
bool goToPreviousIndicator ( int indicID2Search , bool isWrap = true ) const ;
bool goToNextIndicator ( int indicID2Search , bool isWrap = true ) const ;
2010-09-25 17:04:44 +00:00
int wordCount ( ) ;
2010-12-05 19:33:48 +00:00
2012-08-25 19:23:16 +00:00
void wsTabConvert ( spaceTab whichWay ) ;
2010-12-05 19:33:48 +00:00
void doTrim ( trimOp whichPart ) ;
2012-11-24 20:14:52 +00:00
void removeEmptyLine ( bool isBlankContained ) ;
2011-04-13 07:08:51 +00:00
void launchAnsiCharPanel ( ) ;
2011-04-20 21:45:18 +00:00
void launchClipboardHistoryPanel ( ) ;
2011-05-19 21:19:05 +00:00
void launchFileSwitcherPanel ( ) ;
2011-09-25 01:33:34 +00:00
void launchProjectPanel ( int cmdID , ProjectPanel * * pProjPanel , int panelID ) ;
2012-01-30 00:00:50 +00:00
void launchDocMap ( ) ;
2012-11-24 20:14:52 +00:00
void launchFunctionList ( ) ;
2012-01-01 19:29:31 +00:00
int getQuoteIndexFrom ( const char * quoter ) const ;
void showQuoteFromIndex ( int index ) const ;
void showAllQuotes ( ) const ;
static DWORD WINAPI threadTextPlayer ( void * text2display ) ;
static DWORD WINAPI threadTextTroller ( void * params ) ;
static int getRandomAction ( int ranNum ) ;
static bool deleteBack ( ScintillaEditView * pCurrentView , BufferID targetBufID ) ;
static bool deleteForward ( ScintillaEditView * pCurrentView , BufferID targetBufID ) ;
static bool selectBack ( ScintillaEditView * pCurrentView , BufferID targetBufID ) ;
static int getRandomNumber ( int rangeMax = - 1 ) {
int randomNumber = rand ( ) ;
if ( rangeMax = = - 1 )
return randomNumber ;
return ( rand ( ) % rangeMax ) ;
} ;
2009-04-24 23:34:47 +00:00
} ;
2010-03-26 00:22:14 +00:00
2009-04-24 23:34:47 +00:00
# endif //NOTEPAD_PLUS_H