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