1 /*************************************************************************** 2 * This file is part of the Lime Report project * 3 * Copyright (C) 2015 by Alexander Arin * 4 * arin_a@bk.ru * 5 * * 6 ** GNU General Public License Usage ** 7 * * 8 * This library is free software: you can redistribute it and/or modify * 9 * it under the terms of the GNU General Public License as published by * 10 * the Free Software Foundation, either version 3 of the License, or * 11 * (at your option) any later version. * 12 * You should have received a copy of the GNU General Public License * 13 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 14 * * 15 ** GNU Lesser General Public License ** 16 * * 17 * This library is free software: you can redistribute it and/or modify * 18 * it under the terms of the GNU Lesser General Public License as * 19 * published by the Free Software Foundation, either version 3 of the * 20 * License, or (at your option) any later version. * 21 * You should have received a copy of the GNU Lesser General Public * 22 * License along with this library. * 23 * If not, see <http://www.gnu.org/licenses/>. * 24 * * 25 * This library is distributed in the hope that it will be useful, * 26 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 28 * GNU General Public License for more details. * 29 ****************************************************************************/ 30 #ifndef LRSTORAGEINTF_H 31 #define LRSTORAGEINTF_H 32 33 #include <QSharedPointer> 34 35 class QString; 36 class QObject; 37 38 namespace LimeReport{ 39 40 class ObjectLoadingStateIntf{ 41 public: 42 virtual bool isLoading() = 0; 43 virtual void objectLoadStarted() = 0; 44 virtual void objectLoadFinished() = 0; 45 }; 46 47 class ItemsWriterIntf 48 { 49 public: 50 virtual void putItem(QObject* item) = 0; 51 virtual bool saveToFile(QString fileName) = 0; 52 virtual QString saveToString() = 0; 53 virtual QByteArray saveToByteArray() = 0; 54 virtual void setPassPhrase(const QString& passPhrase) = 0; ~ItemsWriterIntf()55 virtual ~ItemsWriterIntf(){} 56 }; 57 58 class ItemsReaderIntf 59 { 60 public: 61 typedef QSharedPointer<ItemsReaderIntf> Ptr; 62 virtual bool first() = 0; 63 virtual bool next() = 0; 64 virtual bool prior() = 0; 65 virtual QString itemType() = 0; 66 virtual QString itemClassName() = 0; 67 virtual bool readItem(QObject *item) = 0; 68 virtual int firstLevelItemsCount() = 0; 69 virtual QString lastError() = 0; 70 virtual void setPassPhrase(const QString& passPhrase) = 0; ~ItemsReaderIntf()71 virtual ~ItemsReaderIntf(){} 72 }; 73 74 } 75 #endif // LRSTORAGEINTF_H 76