xref: /glogg/src/filteredview.h (revision 8e78820269301b7bc20854ff27cb7da6d674ec04)
1bb02e0acSNicolas Bonnefon /*
2bb02e0acSNicolas Bonnefon  * Copyright (C) 2009, 2010, 2012 Nicolas Bonnefon and other contributors
3bb02e0acSNicolas Bonnefon  *
4bb02e0acSNicolas Bonnefon  * This file is part of glogg.
5bb02e0acSNicolas Bonnefon  *
6bb02e0acSNicolas Bonnefon  * glogg is free software: you can redistribute it and/or modify
7bb02e0acSNicolas Bonnefon  * it under the terms of the GNU General Public License as published by
8bb02e0acSNicolas Bonnefon  * the Free Software Foundation, either version 3 of the License, or
9bb02e0acSNicolas Bonnefon  * (at your option) any later version.
10bb02e0acSNicolas Bonnefon  *
11bb02e0acSNicolas Bonnefon  * glogg is distributed in the hope that it will be useful,
12bb02e0acSNicolas Bonnefon  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13bb02e0acSNicolas Bonnefon  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14bb02e0acSNicolas Bonnefon  * GNU General Public License for more details.
15bb02e0acSNicolas Bonnefon  *
16bb02e0acSNicolas Bonnefon  * You should have received a copy of the GNU General Public License
17bb02e0acSNicolas Bonnefon  * along with glogg.  If not, see <http://www.gnu.org/licenses/>.
18bb02e0acSNicolas Bonnefon  */
19bb02e0acSNicolas Bonnefon 
20bb02e0acSNicolas Bonnefon #ifndef FILTEREDVIEW_H
21bb02e0acSNicolas Bonnefon #define FILTEREDVIEW_H
22bb02e0acSNicolas Bonnefon 
23bb02e0acSNicolas Bonnefon #include "abstractlogview.h"
24bb02e0acSNicolas Bonnefon 
25bb02e0acSNicolas Bonnefon #include "data/logfiltereddata.h"
26bb02e0acSNicolas Bonnefon 
27*8e788202SNicolas Bonnefon #include <QKeyEvent>
28*8e788202SNicolas Bonnefon 
29bb02e0acSNicolas Bonnefon // Class implementing the filtered (bottom) view widget.
30bb02e0acSNicolas Bonnefon class FilteredView : public AbstractLogView
31bb02e0acSNicolas Bonnefon {
32bb02e0acSNicolas Bonnefon   public:
33bb02e0acSNicolas Bonnefon     FilteredView( LogFilteredData* newLogData,
34bb02e0acSNicolas Bonnefon             const QuickFindPattern* const quickFindPattern,
35bb02e0acSNicolas Bonnefon             QWidget* parent = 0 );
36bb02e0acSNicolas Bonnefon 
37bb02e0acSNicolas Bonnefon     // What is visible in the view.
38bb02e0acSNicolas Bonnefon     enum Visibility { MatchesOnly, MarksOnly, MarksAndMatches };
39bb02e0acSNicolas Bonnefon     void setVisibility( Visibility visi );
40bb02e0acSNicolas Bonnefon 
41bb02e0acSNicolas Bonnefon   protected:
42bb02e0acSNicolas Bonnefon     virtual LineType lineType( int lineNumber ) const;
43bb02e0acSNicolas Bonnefon 
44bb02e0acSNicolas Bonnefon     // Number of the filtered line relative to the unfiltered source
45bb02e0acSNicolas Bonnefon     virtual qint64 displayLineNumber( int lineNumber ) const;
46bb02e0acSNicolas Bonnefon     virtual qint64 maxDisplayLineNumber() const;
47bb02e0acSNicolas Bonnefon 
48*8e788202SNicolas Bonnefon     virtual void keyPressEvent( QKeyEvent* keyEvent );
49*8e788202SNicolas Bonnefon 
50bb02e0acSNicolas Bonnefon   private:
51bb02e0acSNicolas Bonnefon     LogFilteredData* logFilteredData_;
52bb02e0acSNicolas Bonnefon };
53bb02e0acSNicolas Bonnefon 
54bb02e0acSNicolas Bonnefon #endif
55