1 /* 2 Scan Tailor - Interactive post-processing tool for scanned pages. 3 Copyright (C) 2007-2009 Joseph Artsimovich <joseph_a@mail.ru> 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 ZONE_SET_H_ 20 #define ZONE_SET_H_ 21 22 #include <boost/iterator/iterator_facade.hpp> 23 #include <list> 24 #include "Zone.h" 25 26 class PropertyFactory; 27 class QDomDocument; 28 class QDomElement; 29 class QString; 30 31 class ZoneSet { 32 public: 33 typedef std::list<Zone>::const_iterator const_iterator; 34 35 ZoneSet() = default; 36 37 ZoneSet(const QDomElement& el, const PropertyFactory& prop_factory); 38 39 virtual ~ZoneSet() = default; 40 41 QDomElement toXml(QDomDocument& doc, const QString& name) const; 42 empty()43 bool empty() const { return m_zones.empty(); } 44 add(const Zone & zone)45 void add(const Zone& zone) { m_zones.push_back(zone); } 46 erase(const_iterator position)47 const_iterator erase(const_iterator position) { return m_zones.erase(position); } 48 begin()49 const_iterator begin() const { return m_zones.begin(); } 50 end()51 const_iterator end() const { return m_zones.end(); } 52 53 private: 54 std::list<Zone> m_zones; 55 }; 56 57 58 #endif // ifndef ZONE_SET_H_ 59