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