Classified ads
/tmp/classified-ads/classified_ads/mcontroller.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2013.
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 M_CONTROLLER_H
22 #define M_CONTROLLER_H
23 #include <QObject>
24 #include "util/hash.h" // Hash
26 
27 class Node ;
28 class Model ;
29 class NetworkListener ;
32 class BinaryFile ;
33 class VoiceCallEngine ;
34 class MVoiceCallEngine ;
35 
43 class MController : public QObject {
44  Q_OBJECT
45 
46 public:
59  } ;
60 
71  } ;
72 
82  bool aIsBackgroundDl,
83  ProtocolItemType aTypeOfExpectedObject ) = 0 ;
84 
99  virtual void userInterfaceAction ( CAUserInterfaceRequest aRequest,
100  const Hash& aHashConcerned = KNullHash,
101  const Hash& aFetchFromNode = KNullHash,
102  const QString* aAdditionalInformation = NULL ) = 0 ;
103 
104  virtual void hideUI() = 0 ;
108  virtual void showUI() = 0 ;
112  virtual void setProfileInUse(const Hash& aProfileHash) = 0 ;
116  virtual const Hash& profileInUse() = 0 ;
123  virtual void setContentKeyPasswd(QString aPasswd) = 0 ;
128  virtual QString contentKeyPasswd() const = 0;
129 
130 public slots:
131  virtual void exitApp() = 0 ;
132  virtual void displayAboutBox() = 0 ;
133  virtual void displayFront() = 0 ;
140  virtual void handleError(MController::CAErrorSituation aError,
141  const QString& aExplanation) = 0 ;
146  virtual Node& getNode() const = 0 ;
151  virtual NetworkListener *networkListener() const = 0 ;
155  virtual Model &model() const = 0 ;
163  virtual void storePrivateDataOfSelectedProfile(bool aPublishTrustListToo = false ) = 0 ;
168  virtual void reStorePrivateDataOfSelectedProfile() = 0 ;
172  virtual bool isContactInContactList(const Hash& aFingerPrint) const = 0;
173  virtual QString displayableNameForProfile(const Hash& aProfileFingerPrint) const = 0 ;
174  virtual void offerDisplayNameForProfile(const Hash& aProfileFingerPrint,
175  const QString& aDisplayName,
176  const bool iUpdatePersistenStorage=false) = 0 ;
180  virtual void displayFileInfoOnUi(const BinaryFile& aFileMetadata) = 0 ;
186  virtual VoiceCallEngine* voiceCallEngine() = 0 ;
187 
196 } ;
197 #endif
198 
virtual void setProfileInUse(const Hash &aProfileHash)=0
Pure-virtual interface for voice call engine.
Definition: mvoicecallengine.h:33
virtual VoiceCallEngine * voiceCallEngine()=0
Node is a peer in network.
Definition: node.h:40
Logic for handling tasks received from other peers or from user.
Definition: netrequestexecutor.h:40
virtual void offerDisplayNameForProfile(const Hash &aProfileFingerPrint, const QString &aDisplayName, const bool iUpdatePersistenStorage=false)=0
Definition: mcontroller.h:68
virtual void userInterfaceAction(CAUserInterfaceRequest aRequest, const Hash &aHashConcerned=KNullHash, const Hash &aFetchFromNode=KNullHash, const QString *aAdditionalInformation=NULL)=0
virtual void showUI()=0
virtual QString contentKeyPasswd() const =0
virtual void displayFront()=0
CAUserInterfaceRequest
Definition: mcontroller.h:65
virtual const Hash & profileInUse()=0
Definition: mcontroller.h:57
Definition: mcontroller.h:55
Hash is class that carries 160-bit digest.
Definition: hash.h:38
CAErrorSituation
Definition: mcontroller.h:52
virtual void exitApp()=0
Definition: mcontroller.h:70
virtual void displayAboutBox()=0
Definition: mcontroller.h:67
virtual Node & getNode() const =0
virtual NetworkListener * networkListener() const =0
ProtocolItemType
Definition: protocol.h:150
Carrier-class for binary blob.
Definition: binaryfile.h:37
Definition: mcontroller.h:58
virtual void hideUI()=0
virtual Model & model() const =0
class for listening to incoming network connections.
Definition: networklistener.h:42
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:43
Definition: mcontroller.h:69
Definition: mcontroller.h:66
Hash KNullHash
virtual void displayFileInfoOnUi(const BinaryFile &aFileMetadata)=0
M of the MVC pattern. Handles permanent storage.
Definition: model.h:48
virtual QString displayableNameForProfile(const Hash &aProfileFingerPrint) const =0
Class that will initiate 1 or more network connections.
Definition: networkconnectorengine.h:45
virtual void storePrivateDataOfSelectedProfile(bool aPublishTrustListToo=false)=0
virtual void handleError(MController::CAErrorSituation aError, const QString &aExplanation)=0
Definition: mcontroller.h:54
Definition: mcontroller.h:56
Work queue item.
Definition: netrequestexecutor.h:60
virtual void reStorePrivateDataOfSelectedProfile()=0
virtual void setContentKeyPasswd(QString aPasswd)=0
virtual MVoiceCallEngine * voiceCallEngineInterface()=0
virtual void startRetrievingContent(NetworkRequestExecutor::NetworkRequestQueueItem aReq, bool aIsBackgroundDl, ProtocolItemType aTypeOfExpectedObject)=0
Network-related logic for handling voice channel between nodes.
Definition: voicecallengine.h:53
Definition: mcontroller.h:53
virtual bool isContactInContactList(const Hash &aFingerPrint) const =0