1 /* 2 Scan Tailor - Interactive post-processing tool for scanned pages. 3 Copyright (C) Joseph Artsimovich <joseph.artsimovich@gmail.com> 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef FILTERUIINTERFACE_H_ 20 #define FILTERUIINTERFACE_H_ 21 22 #include "AbstractCommand.h" 23 #include "PageId.h" 24 #include "intrusive_ptr.h" 25 26 class DebugImages; 27 class FilterOptionsWidget; 28 class QWidget; 29 30 /** 31 * \brief A reduced interface to MainWindow to allow filters to manupulate the UI. 32 */ 33 class FilterUiInterface { 34 public: 35 enum Ownership { KEEP_OWNERSHIP, TRANSFER_OWNERSHIP }; 36 37 virtual ~FilterUiInterface() = default; 38 39 virtual void setOptionsWidget(FilterOptionsWidget* widget, Ownership ownership) = 0; 40 41 virtual void setImageWidget(QWidget* widget, 42 Ownership ownership, 43 DebugImages* debug_images = nullptr, 44 bool overlay = false) 45 = 0; 46 47 virtual void invalidateThumbnail(const PageId& page_id) = 0; 48 49 virtual void invalidateAllThumbnails() = 0; 50 51 /** 52 * Returns a callable object that when called will open a relinking dialog. 53 */ 54 virtual intrusive_ptr<AbstractCommand<void>> relinkingDialogRequester() = 0; 55 }; 56 57 58 #endif // ifndef FILTERUIINTERFACE_H_ 59