Alexandre Lision | 392ee72 | 2015-01-23 16:27:10 -0500 | [diff] [blame] | 1 | /************************************************************************************ |
Alexandre Lision | 4a7b95e | 2015-02-20 10:06:43 -0500 | [diff] [blame] | 2 | * Copyright (C) 2014-2015 by Savoir-Faire Linux * |
Alexandre Lision | 392ee72 | 2015-01-23 16:27:10 -0500 | [diff] [blame] | 3 | * Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> * |
| 4 | * * |
| 5 | * This library is free software; you can redistribute it and/or * |
| 6 | * modify it under the terms of the GNU Lesser General Public * |
| 7 | * License as published by the Free Software Foundation; either * |
| 8 | * version 2.1 of the License, or (at your option) any later version. * |
| 9 | * * |
| 10 | * This library 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 GNU * |
| 13 | * Lesser General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU Lesser General Public * |
| 16 | * License along with this library; if not, write to the Free Software * |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
| 18 | ***********************************************************************************/ |
| 19 | #ifndef MINIMALHISTORYBACKEND_H |
| 20 | #define MINIMALHISTORYBACKEND_H |
| 21 | |
Alexandre Lision | 91d11e5 | 2015-03-20 17:42:05 -0400 | [diff] [blame] | 22 | #import <collectioninterface.h> |
Alexandre Lision | 392ee72 | 2015-01-23 16:27:10 -0500 | [diff] [blame] | 23 | |
Alexandre Lision | 4a7b95e | 2015-02-20 10:06:43 -0500 | [diff] [blame] | 24 | class Call; |
| 25 | |
| 26 | template<typename T> class CollectionMediator; |
| 27 | |
| 28 | class LIB_EXPORT MinimalHistoryBackend : public CollectionInterface |
Alexandre Lision | 392ee72 | 2015-01-23 16:27:10 -0500 | [diff] [blame] | 29 | { |
| 30 | public: |
Alexandre Lision | 6e81714 | 2015-03-13 11:07:53 -0400 | [diff] [blame] | 31 | explicit MinimalHistoryBackend(CollectionMediator<Call>* mediator); |
| 32 | virtual ~MinimalHistoryBackend(); |
Alexandre Lision | 4a7b95e | 2015-02-20 10:06:43 -0500 | [diff] [blame] | 33 | |
Alexandre Lision | 6e81714 | 2015-03-13 11:07:53 -0400 | [diff] [blame] | 34 | virtual bool load() override; |
| 35 | virtual bool reload() override; |
| 36 | virtual bool clear() override; |
| 37 | virtual QString name () const override; |
| 38 | virtual QString category () const override; |
| 39 | virtual QVariant icon () const override; |
| 40 | virtual bool isEnabled() const override; |
| 41 | virtual QByteArray id () const override; |
| 42 | virtual SupportedFeatures supportedFeatures() const override; |
Alexandre Lision | e404149 | 2015-03-20 18:20:43 -0400 | [diff] [blame^] | 43 | int daysSince(time_t timestamp); |
| 44 | |
Alexandre Lision | 4a7b95e | 2015-02-20 10:06:43 -0500 | [diff] [blame] | 45 | |
| 46 | private: |
Alexandre Lision | 6e81714 | 2015-03-13 11:07:53 -0400 | [diff] [blame] | 47 | CollectionMediator<Call>* m_pMediator; |
Alexandre Lision | 4a7b95e | 2015-02-20 10:06:43 -0500 | [diff] [blame] | 48 | }; |
| 49 | |
Alexandre Lision | 392ee72 | 2015-01-23 16:27:10 -0500 | [diff] [blame] | 50 | #endif |