1bb02e0acSNicolas Bonnefon /* 2bb02e0acSNicolas Bonnefon * Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicolas Bonnefon 3bb02e0acSNicolas Bonnefon * and other contributors 4bb02e0acSNicolas Bonnefon * 5bb02e0acSNicolas Bonnefon * This file is part of glogg. 6bb02e0acSNicolas Bonnefon * 7bb02e0acSNicolas Bonnefon * glogg is free software: you can redistribute it and/or modify 8bb02e0acSNicolas Bonnefon * it under the terms of the GNU General Public License as published by 9bb02e0acSNicolas Bonnefon * the Free Software Foundation, either version 3 of the License, or 10bb02e0acSNicolas Bonnefon * (at your option) any later version. 11bb02e0acSNicolas Bonnefon * 12bb02e0acSNicolas Bonnefon * glogg is distributed in the hope that it will be useful, 13bb02e0acSNicolas Bonnefon * but WITHOUT ANY WARRANTY; without even the implied warranty of 14bb02e0acSNicolas Bonnefon * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15bb02e0acSNicolas Bonnefon * GNU General Public License for more details. 16bb02e0acSNicolas Bonnefon * 17bb02e0acSNicolas Bonnefon * You should have received a copy of the GNU General Public License 18bb02e0acSNicolas Bonnefon * along with glogg. If not, see <http://www.gnu.org/licenses/>. 19bb02e0acSNicolas Bonnefon */ 20bb02e0acSNicolas Bonnefon 21bb02e0acSNicolas Bonnefon #ifndef ABSTRACTLOGVIEW_H 22bb02e0acSNicolas Bonnefon #define ABSTRACTLOGVIEW_H 23bb02e0acSNicolas Bonnefon 24bb02e0acSNicolas Bonnefon #include <QAbstractScrollArea> 25bb02e0acSNicolas Bonnefon #include <QBasicTimer> 26bb02e0acSNicolas Bonnefon 27*8bda3285SNicolas Bonnefon #ifdef GLOGG_PERF_MEASURE_FPS 28045703daSNicolas Bonnefon # include "perfcounter.h" 29*8bda3285SNicolas Bonnefon #endif 30045703daSNicolas Bonnefon 31bb02e0acSNicolas Bonnefon #include "selection.h" 32bb02e0acSNicolas Bonnefon #include "quickfind.h" 33bb02e0acSNicolas Bonnefon #include "overviewwidget.h" 34bb02e0acSNicolas Bonnefon #include "quickfindmux.h" 35bb02e0acSNicolas Bonnefon 36bb02e0acSNicolas Bonnefon class QMenu; 37bb02e0acSNicolas Bonnefon class QAction; 38bb02e0acSNicolas Bonnefon class AbstractLogData; 39bb02e0acSNicolas Bonnefon 40bb02e0acSNicolas Bonnefon class LineChunk 41bb02e0acSNicolas Bonnefon { 42bb02e0acSNicolas Bonnefon public: 43bb02e0acSNicolas Bonnefon enum ChunkType { 44bb02e0acSNicolas Bonnefon Normal, 45bb02e0acSNicolas Bonnefon Highlighted, 46bb02e0acSNicolas Bonnefon Selected, 47bb02e0acSNicolas Bonnefon }; 48bb02e0acSNicolas Bonnefon 49bb02e0acSNicolas Bonnefon LineChunk( int first_col, int end_col, ChunkType type ); 50bb02e0acSNicolas Bonnefon 51bb02e0acSNicolas Bonnefon int start() const { return start_; } 52bb02e0acSNicolas Bonnefon int end() const { return end_; } 53bb02e0acSNicolas Bonnefon ChunkType type() const { return type_; } 54bb02e0acSNicolas Bonnefon 55bb02e0acSNicolas Bonnefon // Returns 'true' if the selection is part of this chunk 56bb02e0acSNicolas Bonnefon // (at least partially), if so, it should be replaced by the list returned 57bb02e0acSNicolas Bonnefon QList<LineChunk> select( int selection_start, int selection_end ) const; 58bb02e0acSNicolas Bonnefon 59bb02e0acSNicolas Bonnefon private: 60bb02e0acSNicolas Bonnefon int start_; 61bb02e0acSNicolas Bonnefon int end_; 62bb02e0acSNicolas Bonnefon ChunkType type_; 63bb02e0acSNicolas Bonnefon }; 64bb02e0acSNicolas Bonnefon 65bb02e0acSNicolas Bonnefon // Utility class for syntax colouring. 66bb02e0acSNicolas Bonnefon // It stores the chunks of line to draw 67bb02e0acSNicolas Bonnefon // each chunk having a different colour 68bb02e0acSNicolas Bonnefon class LineDrawer 69bb02e0acSNicolas Bonnefon { 70bb02e0acSNicolas Bonnefon public: 71bb02e0acSNicolas Bonnefon LineDrawer( const QColor& back_color) : 72bb02e0acSNicolas Bonnefon list(), backColor_( back_color ) { }; 73bb02e0acSNicolas Bonnefon 74bb02e0acSNicolas Bonnefon // Add a chunk of line using the given colours. 75bb02e0acSNicolas Bonnefon // Both first_col and last_col are included 76bb02e0acSNicolas Bonnefon // An empty chunk will be ignored. 77bb02e0acSNicolas Bonnefon // the first column will be set to 0 if negative 78bb02e0acSNicolas Bonnefon // The column are relative to the screen 79bb02e0acSNicolas Bonnefon void addChunk( int first_col, int last_col, QColor fore, QColor back ); 80bb02e0acSNicolas Bonnefon void addChunk( const LineChunk& chunk, QColor fore, QColor back ); 81bb02e0acSNicolas Bonnefon 82bb02e0acSNicolas Bonnefon // Draw the current line of text using the given painter, 83bb02e0acSNicolas Bonnefon // in the passed block (in pixels) 84bb02e0acSNicolas Bonnefon // The line must be cut to fit on the screen. 85bb02e0acSNicolas Bonnefon // leftExtraBackgroundPx is the an extra margin to start drawing 86bb02e0acSNicolas Bonnefon // the coloured // background, going all the way to the element 87bb02e0acSNicolas Bonnefon // left of the line looks better. 88bb02e0acSNicolas Bonnefon void draw( QPainter& painter, int xPos, int yPos, 89bb02e0acSNicolas Bonnefon int line_width, const QString& line, 90bb02e0acSNicolas Bonnefon int leftExtraBackgroundPx ); 91bb02e0acSNicolas Bonnefon 92bb02e0acSNicolas Bonnefon private: 93bb02e0acSNicolas Bonnefon class Chunk { 94bb02e0acSNicolas Bonnefon public: 95bb02e0acSNicolas Bonnefon // Create a new chunk 96bb02e0acSNicolas Bonnefon Chunk( int start, int length, QColor fore, QColor back ) 97bb02e0acSNicolas Bonnefon : start_( start ), length_( length ), 98bb02e0acSNicolas Bonnefon foreColor_ ( fore ), backColor_ ( back ) { }; 99bb02e0acSNicolas Bonnefon 100bb02e0acSNicolas Bonnefon // Accessors 101bb02e0acSNicolas Bonnefon int start() const { return start_; } 102bb02e0acSNicolas Bonnefon int length() const { return length_; } 103bb02e0acSNicolas Bonnefon const QColor& foreColor() const { return foreColor_; } 104bb02e0acSNicolas Bonnefon const QColor& backColor() const { return backColor_; } 105bb02e0acSNicolas Bonnefon 106bb02e0acSNicolas Bonnefon private: 107bb02e0acSNicolas Bonnefon int start_; 108bb02e0acSNicolas Bonnefon int length_; 109bb02e0acSNicolas Bonnefon QColor foreColor_; 110bb02e0acSNicolas Bonnefon QColor backColor_; 111bb02e0acSNicolas Bonnefon }; 112bb02e0acSNicolas Bonnefon QList<Chunk> list; 113bb02e0acSNicolas Bonnefon QColor backColor_; 114bb02e0acSNicolas Bonnefon }; 115bb02e0acSNicolas Bonnefon 116bb02e0acSNicolas Bonnefon 117bb02e0acSNicolas Bonnefon // Utility class representing a buffer for number entered on the keyboard 118bb02e0acSNicolas Bonnefon // The buffer keep at most 7 digits, and reset itself after a timeout. 119bb02e0acSNicolas Bonnefon class DigitsBuffer : public QObject 120bb02e0acSNicolas Bonnefon { 121bb02e0acSNicolas Bonnefon Q_OBJECT 122bb02e0acSNicolas Bonnefon 123bb02e0acSNicolas Bonnefon public: 124bb02e0acSNicolas Bonnefon DigitsBuffer(); 125bb02e0acSNicolas Bonnefon 126bb02e0acSNicolas Bonnefon // Reset the buffer. 127bb02e0acSNicolas Bonnefon void reset(); 128bb02e0acSNicolas Bonnefon // Add a single digit to the buffer (discarded if it's not a digit), 129bb02e0acSNicolas Bonnefon // the timeout timer is reset. 130bb02e0acSNicolas Bonnefon void add( char character ); 131bb02e0acSNicolas Bonnefon // Get the content of the buffer (0 if empty) and reset it. 132bb02e0acSNicolas Bonnefon int content(); 133bb02e0acSNicolas Bonnefon 134bb02e0acSNicolas Bonnefon protected: 135bb02e0acSNicolas Bonnefon void timerEvent( QTimerEvent* event ); 136bb02e0acSNicolas Bonnefon 137bb02e0acSNicolas Bonnefon private: 138bb02e0acSNicolas Bonnefon // Duration of the timeout in milliseconds. 139bb02e0acSNicolas Bonnefon static const int timeout_; 140bb02e0acSNicolas Bonnefon 141bb02e0acSNicolas Bonnefon QString digits_; 142bb02e0acSNicolas Bonnefon 143bb02e0acSNicolas Bonnefon QBasicTimer timer_; 144bb02e0acSNicolas Bonnefon }; 145bb02e0acSNicolas Bonnefon 146bb02e0acSNicolas Bonnefon class Overview; 147bb02e0acSNicolas Bonnefon 148bb02e0acSNicolas Bonnefon // Base class representing the log view widget. 149bb02e0acSNicolas Bonnefon // It can be either the top (full) or bottom (filtered) view. 150bb02e0acSNicolas Bonnefon class AbstractLogView : 151bb02e0acSNicolas Bonnefon public QAbstractScrollArea, public SearchableWidgetInterface 152bb02e0acSNicolas Bonnefon { 153bb02e0acSNicolas Bonnefon Q_OBJECT 154bb02e0acSNicolas Bonnefon 155bb02e0acSNicolas Bonnefon public: 156bb02e0acSNicolas Bonnefon // Constructor of the widget, the data set is passed. 157bb02e0acSNicolas Bonnefon // The caller retains ownership of the data set. 158bb02e0acSNicolas Bonnefon // The pointer to the QFP is used for colouring and QuickFind searches 159bb02e0acSNicolas Bonnefon AbstractLogView( const AbstractLogData* newLogData, 160bb02e0acSNicolas Bonnefon const QuickFindPattern* const quickFind, QWidget* parent=0 ); 161bb02e0acSNicolas Bonnefon ~AbstractLogView(); 162bb02e0acSNicolas Bonnefon 163bb02e0acSNicolas Bonnefon // Refresh the widget when the data set has changed. 164bb02e0acSNicolas Bonnefon void updateData(); 165bb02e0acSNicolas Bonnefon // Instructs the widget to update it's content geometry, 166bb02e0acSNicolas Bonnefon // used when the font is changed. 167bb02e0acSNicolas Bonnefon void updateDisplaySize(); 168bb02e0acSNicolas Bonnefon // Return the line number of the top line of the view 169bb02e0acSNicolas Bonnefon int getTopLine() const; 170bb02e0acSNicolas Bonnefon // Return the text of the current selection. 171bb02e0acSNicolas Bonnefon QString getSelection() const; 172bb02e0acSNicolas Bonnefon // Instructs the widget to select the whole text. 173bb02e0acSNicolas Bonnefon void selectAll(); 174bb02e0acSNicolas Bonnefon 175bb02e0acSNicolas Bonnefon protected: 176bb02e0acSNicolas Bonnefon void mousePressEvent( QMouseEvent* mouseEvent ); 177bb02e0acSNicolas Bonnefon void mouseMoveEvent( QMouseEvent* mouseEvent ); 178bb02e0acSNicolas Bonnefon void mouseReleaseEvent( QMouseEvent* ); 179bb02e0acSNicolas Bonnefon void mouseDoubleClickEvent( QMouseEvent* mouseEvent ); 180bb02e0acSNicolas Bonnefon void timerEvent( QTimerEvent* timerEvent ); 181bb02e0acSNicolas Bonnefon void changeEvent( QEvent* changeEvent ); 182bb02e0acSNicolas Bonnefon void paintEvent( QPaintEvent* paintEvent ); 183bb02e0acSNicolas Bonnefon void resizeEvent( QResizeEvent* resizeEvent ); 184bb02e0acSNicolas Bonnefon void scrollContentsBy( int dx, int dy ); 185bb02e0acSNicolas Bonnefon void keyPressEvent( QKeyEvent* keyEvent ); 186bb02e0acSNicolas Bonnefon void wheelEvent( QWheelEvent* wheelEvent ); 187bb02e0acSNicolas Bonnefon 188bb02e0acSNicolas Bonnefon // Must be implemented to return wether the line number is 189bb02e0acSNicolas Bonnefon // a match, a mark or just a normal line (used for coloured bullets) 190bb02e0acSNicolas Bonnefon enum LineType { Normal, Marked, Match }; 191bb02e0acSNicolas Bonnefon virtual LineType lineType( int lineNumber ) const = 0; 192bb02e0acSNicolas Bonnefon 193bb02e0acSNicolas Bonnefon // Line number to display for line at the given index 194bb02e0acSNicolas Bonnefon virtual qint64 displayLineNumber( int lineNumber ) const; 195bb02e0acSNicolas Bonnefon virtual qint64 maxDisplayLineNumber() const; 196bb02e0acSNicolas Bonnefon 197bb02e0acSNicolas Bonnefon // Get the overview associated with this view, or NULL if there is none 198bb02e0acSNicolas Bonnefon Overview* getOverview() const { return overview_; } 199bb02e0acSNicolas Bonnefon // Set the Overview and OverviewWidget 200bb02e0acSNicolas Bonnefon void setOverview( Overview* overview, OverviewWidget* overview_widget ); 201bb02e0acSNicolas Bonnefon 202bb02e0acSNicolas Bonnefon signals: 203bb02e0acSNicolas Bonnefon // Sent when a new line has been selected by the user. 204bb02e0acSNicolas Bonnefon void newSelection(int line); 205bb02e0acSNicolas Bonnefon // Sent up to the MainWindow to disable the follow mode 206bb02e0acSNicolas Bonnefon void followDisabled(); 207bb02e0acSNicolas Bonnefon // Sent when the view wants the QuickFind widget pattern to change. 208bb02e0acSNicolas Bonnefon void changeQuickFind( const QString& newPattern, 209bb02e0acSNicolas Bonnefon QuickFindMux::QFDirection newDirection ); 210bb02e0acSNicolas Bonnefon // Sent up when the current line number is updated 211bb02e0acSNicolas Bonnefon void updateLineNumber( int line ); 212bb02e0acSNicolas Bonnefon // Sent up when quickFind wants to show a message to the user. 213bb02e0acSNicolas Bonnefon void notifyQuickFind( const QFNotification& message ); 214bb02e0acSNicolas Bonnefon // Sent up when quickFind wants to clear the notification. 215bb02e0acSNicolas Bonnefon void clearQuickFindNotification(); 216bb02e0acSNicolas Bonnefon // Sent when the view ask for a line to be marked 217bb02e0acSNicolas Bonnefon // (click in the left margin). 218bb02e0acSNicolas Bonnefon void markLine( qint64 line ); 219bb02e0acSNicolas Bonnefon // Sent up when the user wants to add the selection to the search 220bb02e0acSNicolas Bonnefon void addToSearch( const QString& selection ); 221bb02e0acSNicolas Bonnefon // Sent up when the mouse is hovered over a line's margin 222bb02e0acSNicolas Bonnefon void mouseHoveredOverLine( qint64 line ); 223bb02e0acSNicolas Bonnefon // Sent up when the mouse leaves a line's margin 224bb02e0acSNicolas Bonnefon void mouseLeftHoveringZone(); 225bb02e0acSNicolas Bonnefon // Sent up for view initiated quickfind searches 226bb02e0acSNicolas Bonnefon void searchNext(); 227bb02e0acSNicolas Bonnefon void searchPrevious(); 228bb02e0acSNicolas Bonnefon 229bb02e0acSNicolas Bonnefon public slots: 230bb02e0acSNicolas Bonnefon // Makes the widget select and display the passed line. 231bb02e0acSNicolas Bonnefon // Scrolling as necessary 232bb02e0acSNicolas Bonnefon void selectAndDisplayLine( int line ); 233bb02e0acSNicolas Bonnefon 234bb02e0acSNicolas Bonnefon // Use the current QFP to go and select the next match. 235bb02e0acSNicolas Bonnefon virtual void searchForward(); 236bb02e0acSNicolas Bonnefon // Use the current QFP to go and select the previous match. 237bb02e0acSNicolas Bonnefon virtual void searchBackward(); 238bb02e0acSNicolas Bonnefon 239bb02e0acSNicolas Bonnefon // Use the current QFP to go and select the next match (incremental) 240bb02e0acSNicolas Bonnefon virtual void incrementallySearchForward(); 241bb02e0acSNicolas Bonnefon // Use the current QFP to go and select the previous match (incremental) 242bb02e0acSNicolas Bonnefon virtual void incrementallySearchBackward(); 243bb02e0acSNicolas Bonnefon // Stop the current incremental search (typically when user press return) 244bb02e0acSNicolas Bonnefon virtual void incrementalSearchStop(); 245bb02e0acSNicolas Bonnefon // Abort the current incremental search (typically when user press esc) 246bb02e0acSNicolas Bonnefon virtual void incrementalSearchAbort(); 247bb02e0acSNicolas Bonnefon 248bb02e0acSNicolas Bonnefon // Signals the follow mode has been enabled. 249bb02e0acSNicolas Bonnefon void followSet( bool checked ); 250bb02e0acSNicolas Bonnefon 251bb02e0acSNicolas Bonnefon // Signal the on/off status of the overview has been changed. 252bb02e0acSNicolas Bonnefon void refreshOverview(); 253bb02e0acSNicolas Bonnefon 254bb02e0acSNicolas Bonnefon // Make the view jump to the specified line, regardless of weither it 255bb02e0acSNicolas Bonnefon // is on the screen or not. 256bb02e0acSNicolas Bonnefon // (does NOT emit followDisabled() ) 257bb02e0acSNicolas Bonnefon void jumpToLine( int line ); 258bb02e0acSNicolas Bonnefon 259bb02e0acSNicolas Bonnefon // Configure the setting of whether to show line number margin 260bb02e0acSNicolas Bonnefon void setLineNumbersVisible( bool lineNumbersVisible ); 261bb02e0acSNicolas Bonnefon 262bb02e0acSNicolas Bonnefon private slots: 263bb02e0acSNicolas Bonnefon void handlePatternUpdated(); 264bb02e0acSNicolas Bonnefon void addToSearch(); 265bb02e0acSNicolas Bonnefon void findNextSelected(); 266bb02e0acSNicolas Bonnefon void findPreviousSelected(); 267bb02e0acSNicolas Bonnefon void copy(); 268bb02e0acSNicolas Bonnefon 269bb02e0acSNicolas Bonnefon private: 270bb02e0acSNicolas Bonnefon // Constants 271bb02e0acSNicolas Bonnefon static const int OVERVIEW_WIDTH; 272bb02e0acSNicolas Bonnefon 273bb02e0acSNicolas Bonnefon // Width of the bullet zone, including decoration 274bb02e0acSNicolas Bonnefon int bulletZoneWidthPx_; 275bb02e0acSNicolas Bonnefon 276bb02e0acSNicolas Bonnefon // Total size of all margins and decorations in pixels 277bb02e0acSNicolas Bonnefon int leftMarginPx_; 278bb02e0acSNicolas Bonnefon 279bb02e0acSNicolas Bonnefon // Number of digits to display in line numbers 280bb02e0acSNicolas Bonnefon int nbDigitsInLineNumber_; 281bb02e0acSNicolas Bonnefon 282bb02e0acSNicolas Bonnefon // Digits buffer (for numeric keyboard entry) 283bb02e0acSNicolas Bonnefon DigitsBuffer digitsBuffer_; 284bb02e0acSNicolas Bonnefon 285bb02e0acSNicolas Bonnefon // Follow mode 286bb02e0acSNicolas Bonnefon bool followMode_; 287bb02e0acSNicolas Bonnefon 288bb02e0acSNicolas Bonnefon // Whether to show line numbers or not 289bb02e0acSNicolas Bonnefon bool lineNumbersVisible_; 290bb02e0acSNicolas Bonnefon 291bb02e0acSNicolas Bonnefon // Pointer to the CrawlerWidget's data set 292bb02e0acSNicolas Bonnefon const AbstractLogData* logData; 293bb02e0acSNicolas Bonnefon 294bb02e0acSNicolas Bonnefon // Pointer to the Overview object 295bb02e0acSNicolas Bonnefon Overview* overview_; 296bb02e0acSNicolas Bonnefon 297bb02e0acSNicolas Bonnefon // Pointer to the OverviewWidget, this class doesn't own it, 298bb02e0acSNicolas Bonnefon // but is responsible for displaying it (for purely aesthetic 299bb02e0acSNicolas Bonnefon // reasons). 300bb02e0acSNicolas Bonnefon OverviewWidget* overviewWidget_; 301bb02e0acSNicolas Bonnefon 302bb02e0acSNicolas Bonnefon bool selectionStarted_; 303bb02e0acSNicolas Bonnefon // Start of the selection (characters) 304bb02e0acSNicolas Bonnefon QPoint selectionStartPos_; 305bb02e0acSNicolas Bonnefon // Current end of the selection (characters) 306bb02e0acSNicolas Bonnefon QPoint selectionCurrentEndPos_; 307bb02e0acSNicolas Bonnefon QBasicTimer autoScrollTimer_; 308bb02e0acSNicolas Bonnefon 309bb02e0acSNicolas Bonnefon // Hovering state 310bb02e0acSNicolas Bonnefon // Last line that has been hoovered on, -1 if none 311bb02e0acSNicolas Bonnefon qint64 lastHoveredLine_; 312bb02e0acSNicolas Bonnefon 313bb02e0acSNicolas Bonnefon // Marks (left margin click) 314bb02e0acSNicolas Bonnefon bool markingClickInitiated_; 315bb02e0acSNicolas Bonnefon qint64 markingClickLine_; 316bb02e0acSNicolas Bonnefon 317bb02e0acSNicolas Bonnefon Selection selection_; 318bb02e0acSNicolas Bonnefon qint64 firstLine; 319bb02e0acSNicolas Bonnefon qint64 lastLine; 320bb02e0acSNicolas Bonnefon int firstCol; 321bb02e0acSNicolas Bonnefon 322bb02e0acSNicolas Bonnefon // Text handling 323bb02e0acSNicolas Bonnefon int charWidth_; 324bb02e0acSNicolas Bonnefon int charHeight_; 325bb02e0acSNicolas Bonnefon 326bb02e0acSNicolas Bonnefon // Popup menu 327bb02e0acSNicolas Bonnefon QMenu* popupMenu_; 328bb02e0acSNicolas Bonnefon QAction* copyAction_; 329bb02e0acSNicolas Bonnefon QAction* findNextAction_; 330bb02e0acSNicolas Bonnefon QAction* findPreviousAction_; 331bb02e0acSNicolas Bonnefon QAction* addToSearchAction_; 332bb02e0acSNicolas Bonnefon 333bb02e0acSNicolas Bonnefon // Pointer to the CrawlerWidget's QFP object 334bb02e0acSNicolas Bonnefon const QuickFindPattern* const quickFindPattern_; 335bb02e0acSNicolas Bonnefon // Our own QuickFind object 336bb02e0acSNicolas Bonnefon QuickFind quickFind_; 337bb02e0acSNicolas Bonnefon 338*8bda3285SNicolas Bonnefon #ifdef GLOGG_PERF_MEASURE_FPS 339045703daSNicolas Bonnefon // Performance measurement 340045703daSNicolas Bonnefon PerfCounter perfCounter_; 341*8bda3285SNicolas Bonnefon #endif 342045703daSNicolas Bonnefon 343bb02e0acSNicolas Bonnefon int getNbVisibleLines() const; 344bb02e0acSNicolas Bonnefon int getNbVisibleCols() const; 345bb02e0acSNicolas Bonnefon QPoint convertCoordToFilePos( const QPoint& pos ) const; 346bb02e0acSNicolas Bonnefon int convertCoordToLine( int yPos ) const; 347bb02e0acSNicolas Bonnefon int convertCoordToColumn( int xPos ) const; 348bb02e0acSNicolas Bonnefon void displayLine( int line ); 349bb02e0acSNicolas Bonnefon void moveSelection( int y ); 350bb02e0acSNicolas Bonnefon void jumpToStartOfLine(); 351bb02e0acSNicolas Bonnefon void jumpToEndOfLine(); 352bb02e0acSNicolas Bonnefon void jumpToRightOfScreen(); 353bb02e0acSNicolas Bonnefon void jumpToTop(); 354bb02e0acSNicolas Bonnefon void jumpToBottom(); 355bb02e0acSNicolas Bonnefon void selectWordAtPosition( const QPoint& pos ); 356bb02e0acSNicolas Bonnefon 357bb02e0acSNicolas Bonnefon void createMenu(); 358bb02e0acSNicolas Bonnefon 359bb02e0acSNicolas Bonnefon void considerMouseHovering( int x_pos, int y_pos ); 360bb02e0acSNicolas Bonnefon 361bb02e0acSNicolas Bonnefon // Search functions (for n/N) 362bb02e0acSNicolas Bonnefon void searchUsingFunction ( qint64 (QuickFind::*search_function)() ); 363bb02e0acSNicolas Bonnefon 364bb02e0acSNicolas Bonnefon // Utils functions 365bb02e0acSNicolas Bonnefon bool isCharWord( char c ); 366bb02e0acSNicolas Bonnefon void updateGlobalSelection(); 367bb02e0acSNicolas Bonnefon }; 368bb02e0acSNicolas Bonnefon 369bb02e0acSNicolas Bonnefon #endif 370