Classified ads
tclmodel.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2013-2017.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef CLASSIFIED_TCLPROGRAMMODEL_H
22 #define CLASSIFIED_TCLPROGRAMMODEL_H
23 #include <QMap>
24 #include "../mcontroller.h" // because enum from there is needed
26 #include "datamodelbase.h"
27 
28 class Hash ;
29 class Profile ;
30 class TclProgram ;
31 
38 class TclModel : public QObject {
39  Q_OBJECT
40 
41 public:
42  TclModel(MController *aMController,
43  const MModelProtocolInterface &aModel) ;
44  ~TclModel() ;
45 
59  Hash locallyStoreTclProgram(const TclProgram& aProgram,
60  const Hash& aPreviousFingerPrint = KNullHash) ;
61 
65  TclProgram tclProgramByFingerPrint(const Hash& aFingerPrint) ;
66 
72  bool discardTclProgram(const Hash& aFingerPrint) ;
73 
79  QMap<QString, Hash> getListOfTclPrograms() ;
80 
90  QString storeTCLProgLocalData(const Hash& aProgram,
91  const QByteArray& aData) ;
92 
99  QByteArray retrieveTCLProgLocalData(const Hash& aProgram) ;
100 
101 signals:
103  const QString& aExplanation) ;
104 
105 private: //methods
112  void installExamplePrograms() ;
113 private: // member variables:
116 } ;
117 #endif
TclProgram tclProgramByFingerPrint(const Hash &aFingerPrint)
Carrier-class for TCL-program and related settings.
Definition: tclprogram.h:34
QString storeTCLProgLocalData(const Hash &aProgram, const QByteArray &aData)
void error(MController::CAErrorSituation aError, const QString &aExplanation)
Hash is class that carries 160-bit digest.
Definition: hash.h:38
CAErrorSituation
Definition: mcontroller.h:57
TclModel(MController *aMController, const MModelProtocolInterface &aModel)
MController & iController
Definition: tclmodel.h:114
QMap< QString, Hash > getListOfTclPrograms()
Hash locallyStoreTclProgram(const TclProgram &aProgram, const Hash &aPreviousFingerPrint=KNullHash)
Pure-virtual interface of datamodel for message parser to use.
Definition: mmodelprotocolinterface.h:46
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:48
bool discardTclProgram(const Hash &aFingerPrint)
Hash KNullHash
Datamodel-part of storage related to TCL-programs.
Definition: tclmodel.h:38
const MModelProtocolInterface & iModel
Definition: tclmodel.h:115
QByteArray retrieveTCLProgLocalData(const Hash &aProgram)
void installExamplePrograms()
Carrier-class for user-profile data.
Definition: profile.h:37