Classified ads
/tmp/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 modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (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
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Classified Ads. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef M_CONTROLLER_H
21 #define M_CONTROLLER_H
22 #include <QObject>
23 #include "util/hash.h" // Hash
25 
26 class Node ;
27 class Model ;
28 class NetworkListener ;
31 
39 class MController : public QObject {
40  Q_OBJECT
41 
42 public:
55  } ;
56 
65  } ;
66 
76  bool aIsBackgroundDl) = 0 ;
77 
91  virtual void userInterfaceAction ( CAUserInterfaceRequest aRequest,
92  const Hash& aHashConcerned = KNullHash,
93  const Hash& aFetchFromNode = KNullHash) = 0 ;
94 
95  virtual void hideUI() = 0 ;
99  virtual void showUI() = 0 ;
103  virtual void setProfileInUse(const Hash& aProfileHash) = 0 ;
107  virtual const Hash& profileInUse() = 0 ;
114  virtual void setContentKeyPasswd(QString aPasswd) = 0 ;
119  virtual QString contentKeyPasswd() const = 0;
120 
121 public slots:
122  virtual void exitApp() = 0 ;
123  virtual void displayAboutBox() = 0 ;
124  virtual void displayFront() = 0 ;
131  virtual void handleError(MController::CAErrorSituation aError,
132  const QString& aExplanation) = 0 ;
137  virtual Node& getNode() const = 0 ;
142  virtual NetworkListener *networkListener() const = 0 ;
146  virtual Model &model() const = 0 ;
150  virtual void storePrivateDataOfSelectedProfile() = 0 ;
155  virtual void reStorePrivateDataOfSelectedProfile() = 0 ;
159  virtual bool isContactInContactList(const Hash& aFingerPrint) const = 0;
160  virtual QString displayableNameForProfile(const Hash& aProfileFingerPrint) const = 0 ;
161  virtual void offerDisplayNameForProfile(const Hash& aProfileFingerPrint,
162  const QString& aDisplayName,
163  const bool iUpdatePersistenStorage=false) = 0 ;
164 } ;
165 #endif
166 
virtual void setProfileInUse(const Hash &aProfileHash)=0
virtual void userInterfaceAction(CAUserInterfaceRequest aRequest, const Hash &aHashConcerned=KNullHash, const Hash &aFetchFromNode=KNullHash)=0
Node is a peer in network.
Definition: node.h:39
Logic for handling tasks received from other peers or from user.
Definition: netrequestexecutor.h:39
virtual void offerDisplayNameForProfile(const Hash &aProfileFingerPrint, const QString &aDisplayName, const bool iUpdatePersistenStorage=false)=0
Definition: mcontroller.h:64
virtual void showUI()=0
virtual QString contentKeyPasswd() const =0
virtual void displayFront()=0
CAUserInterfaceRequest
Definition: mcontroller.h:61
virtual const Hash & profileInUse()=0
Definition: mcontroller.h:53
Definition: mcontroller.h:51
Hash is class that carries 160-bit digest.
Definition: hash.h:37
CAErrorSituation
Definition: mcontroller.h:48
virtual void exitApp()=0
virtual void displayAboutBox()=0
Definition: mcontroller.h:63
virtual Node & getNode() const =0
virtual NetworkListener * networkListener() const =0
Definition: mcontroller.h:54
virtual void hideUI()=0
virtual Model & model() const =0
class for listening to incoming network connections.
Definition: networklistener.h:40
Pure-virtual interface class for controller. This is spammed across parties needing access to applica...
Definition: mcontroller.h:39
Definition: mcontroller.h:62
Hash KNullHash
M of the MVC pattern. Handles permanent storage.
Definition: model.h:47
virtual QString displayableNameForProfile(const Hash &aProfileFingerPrint) const =0
Class that will initiate 1 or more network connections.
Definition: networkconnectorengine.h:44
virtual void handleError(MController::CAErrorSituation aError, const QString &aExplanation)=0
virtual void startRetrievingContent(NetworkRequestExecutor::NetworkRequestQueueItem aReq, bool aIsBackgroundDl)=0
Definition: mcontroller.h:50
Definition: mcontroller.h:52
Work queue item.
Definition: netrequestexecutor.h:59
virtual void storePrivateDataOfSelectedProfile()=0
virtual void reStorePrivateDataOfSelectedProfile()=0
virtual void setContentKeyPasswd(QString aPasswd)=0
Definition: mcontroller.h:49
virtual bool isContactInContactList(const Hash &aFingerPrint) const =0