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