xref: /glogg/src/viewinterface.h (revision d96f3f211e1e2a3a5b219145986c18e10b0f96aa)
1*d96f3f21SNicolas Bonnefon /*
2*d96f3f21SNicolas Bonnefon  * Copyright (C) 2013 Nicolas Bonnefon and other contributors
3*d96f3f21SNicolas Bonnefon  *
4*d96f3f21SNicolas Bonnefon  * This file is part of glogg.
5*d96f3f21SNicolas Bonnefon  *
6*d96f3f21SNicolas Bonnefon  * glogg is free software: you can redistribute it and/or modify
7*d96f3f21SNicolas Bonnefon  * it under the terms of the GNU General Public License as published by
8*d96f3f21SNicolas Bonnefon  * the Free Software Foundation, either version 3 of the License, or
9*d96f3f21SNicolas Bonnefon  * (at your option) any later version.
10*d96f3f21SNicolas Bonnefon  *
11*d96f3f21SNicolas Bonnefon  * glogg is distributed in the hope that it will be useful,
12*d96f3f21SNicolas Bonnefon  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*d96f3f21SNicolas Bonnefon  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*d96f3f21SNicolas Bonnefon  * GNU General Public License for more details.
15*d96f3f21SNicolas Bonnefon  *
16*d96f3f21SNicolas Bonnefon  * You should have received a copy of the GNU General Public License
17*d96f3f21SNicolas Bonnefon  * along with glogg.  If not, see <http://www.gnu.org/licenses/>.
18*d96f3f21SNicolas Bonnefon  */
19*d96f3f21SNicolas Bonnefon 
20*d96f3f21SNicolas Bonnefon #ifndef VIEWINTERFACE_H
21*d96f3f21SNicolas Bonnefon #define VIEWINTERFACE_H
22*d96f3f21SNicolas Bonnefon 
23*d96f3f21SNicolas Bonnefon #include <memory>
24*d96f3f21SNicolas Bonnefon 
25*d96f3f21SNicolas Bonnefon class LogData;
26*d96f3f21SNicolas Bonnefon class LogFilteredData;
27*d96f3f21SNicolas Bonnefon 
28*d96f3f21SNicolas Bonnefon // ViewInterface represents a high-level view on a log file.
29*d96f3f21SNicolas Bonnefon class ViewInterface {
30*d96f3f21SNicolas Bonnefon   public:
31*d96f3f21SNicolas Bonnefon     // Set the log data to associate to this view
32*d96f3f21SNicolas Bonnefon     // Ownership stay with the caller but is shared
33*d96f3f21SNicolas Bonnefon     void setLogData( std::shared_ptr<LogData> log_data )
34*d96f3f21SNicolas Bonnefon     { doSetLogData( log_data ); }
35*d96f3f21SNicolas Bonnefon     // Set the Filetered log data to associate to this view
36*d96f3f21SNicolas Bonnefon     // Ownership stay with the caller but is shared
37*d96f3f21SNicolas Bonnefon     void setLogFilteredData( std::shared_ptr<LogFilteredData> filtered_data )
38*d96f3f21SNicolas Bonnefon     { doSetLogFilteredData( filtered_data ); }
39*d96f3f21SNicolas Bonnefon 
40*d96f3f21SNicolas Bonnefon     // For save/restore of the context
41*d96f3f21SNicolas Bonnefon     /*
42*d96f3f21SNicolas Bonnefon     virtual void setViewContext( const ViewContextInterface& view_context ) = 0;
43*d96f3f21SNicolas Bonnefon     virtual ViewContextInterface& getViewContext( void ) = 0;
44*d96f3f21SNicolas Bonnefon     */
45*d96f3f21SNicolas Bonnefon 
46*d96f3f21SNicolas Bonnefon     // No polymorphic destruction please...
47*d96f3f21SNicolas Bonnefon     ~ViewInterface() = delete;
48*d96f3f21SNicolas Bonnefon 
49*d96f3f21SNicolas Bonnefon   protected:
50*d96f3f21SNicolas Bonnefon     // Virtual functions (using NVI)
51*d96f3f21SNicolas Bonnefon     virtual void doSetLogData( std::shared_ptr<LogData> log_data ) = 0;
52*d96f3f21SNicolas Bonnefon     virtual void doSetLogFilteredData( std::shared_ptr<LogFilteredData> filtered_data ) = 0;
53*d96f3f21SNicolas Bonnefon };
54*d96f3f21SNicolas Bonnefon #endif
55