Classified ads
Public Types | Public Slots | Public Member Functions | List of all members
MController Class Referenceabstract

Pure-virtual interface class for controller. This is spammed across parties needing access to application controller. Reason for this interface is that for testing purposes we can replace real controller with a dummy mock-up. More...

#include <mcontroller.h>

Inheritance diagram for MController:
Inheritance graph
[legend]
Collaboration diagram for MController:
Collaboration graph
[legend]

Public Types

enum  CAErrorSituation {
  OwnCertNotFound, DataBaseNotMountable, BadPassword, DbTransactionError,
  ContentEncryptionError, FileOperationError
}
 
enum  CAUserInterfaceRequest { ViewProfileDetails, ViewCa, ViewProfileComment }
 

Public Slots

virtual void exitApp ()=0
 
virtual void displayAboutBox ()=0
 
virtual void displayFront ()=0
 
virtual void handleError (MController::CAErrorSituation aError, const QString &aExplanation)=0
 
virtual NodegetNode () const =0
 
virtual NetworkListenernetworkListener () const =0
 
virtual Modelmodel () const =0
 
virtual void storePrivateDataOfSelectedProfile ()=0
 
virtual void reStorePrivateDataOfSelectedProfile ()=0
 
virtual bool isContactInContactList (const Hash &aFingerPrint) const =0
 
virtual QString displayableNameForProfile (const Hash &aProfileFingerPrint) const =0
 
virtual void offerDisplayNameForProfile (const Hash &aProfileFingerPrint, const QString &aDisplayName, const bool iUpdatePersistenStorage=false)=0
 

Public Member Functions

virtual void startRetrievingContent (NetworkRequestExecutor::NetworkRequestQueueItem aReq, bool aIsBackgroundDl)=0
 
virtual void userInterfaceAction (CAUserInterfaceRequest aRequest, const Hash &aHashConcerned=KNullHash, const Hash &aFetchFromNode=KNullHash)=0
 
virtual void hideUI ()=0
 
virtual void showUI ()=0
 
virtual void setProfileInUse (const Hash &aProfileHash)=0
 
virtual const HashprofileInUse ()=0
 
virtual void setContentKeyPasswd (QString aPasswd)=0
 
virtual QString contentKeyPasswd () const =0
 

Detailed Description

Pure-virtual interface class for controller. This is spammed across parties needing access to application controller. Reason for this interface is that for testing purposes we can replace real controller with a dummy mock-up.

Member Enumeration Documentation

Enumeration for different errors that may occur within this app. Class controller is supposed to handle these and may be signaled an error

Enumerator
OwnCertNotFound 

Does not have own cert and can't generate

DataBaseNotMountable 

corrupt database or permission?

BadPassword 

Could not open encryption keys with given pwd

DbTransactionError 

something went foul with db

ContentEncryptionError 

something went foul with content encryption interface

FileOperationError 

Error related to binary files

Enumeration for different user-interface actions that controller tries to route

Enumerator
ViewProfileDetails 

User wants to view details of profile

ViewCa 

User wants to view classified ad

ViewProfileComment 

User wants to view profile comment

Member Function Documentation

virtual QString MController::contentKeyPasswd ( ) const
pure virtual

method for getting passwd of private content keys previously set, see method Controller::setContentKeyPasswd

Implemented in Controller.

virtual QString MController::displayableNameForProfile ( const Hash aProfileFingerPrint) const
pure virtualslot
virtual void MController::displayAboutBox ( )
pure virtualslot

bragging

virtual void MController::displayFront ( )
pure virtualslot

this initializes the "normal" display

virtual void MController::exitApp ( )
pure virtualslot

quitting

virtual Node& MController::getNode ( ) const
pure virtualslot

Method for node ; this may be changed during startup-phase but not after that

Implemented in Controller.

virtual void MController::handleError ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
pure virtualslot

Method for handling errors inside application.

Parameters
aErrorReason for error call, from error enum above
aExplanationNULL or human-readable description about what went wrong.
virtual void MController::hideUI ( )
pure virtual

Implemented in Controller, and MockUpController.

virtual bool MController::isContactInContactList ( const Hash aFingerPrint) const
pure virtualslot

method for checking if contact is in contact list

virtual Model& MController::model ( ) const
pure virtualslot

method for getting datamodel

Implemented in Controller.

virtual NetworkListener* MController::networkListener ( ) const
pure virtualslot

method for network listener ; it is parent of all connections, also the outgoing

Implemented in Controller.

virtual void MController::offerDisplayNameForProfile ( const Hash aProfileFingerPrint,
const QString &  aDisplayName,
const bool  iUpdatePersistenStorage = false 
)
pure virtualslot
virtual const Hash& MController::profileInUse ( )
pure virtual

method getting user profile in use.

Implemented in Controller.

virtual void MController::reStorePrivateDataOfSelectedProfile ( )
pure virtualslot

method for restoring private data of profile currently in use. shall be called after new profile is selected in frontwidget.

virtual void MController::setContentKeyPasswd ( QString  aPasswd)
pure virtual

method for setting passwd used to open private content encryption rsa key. this password is stored in controller and is then used by content-open/sign-operations when crypto lib asks for password.

Implemented in Controller.

virtual void MController::setProfileInUse ( const Hash aProfileHash)
pure virtual

method selecting user profile in use.

Implemented in Controller.

virtual void MController::showUI ( )
pure virtual

method for showing UI

Implemented in Controller, and MockUpController.

virtual void MController::startRetrievingContent ( NetworkRequestExecutor::NetworkRequestQueueItem  aReq,
bool  aIsBackgroundDl 
)
pure virtual

method that starts actions regarding content fetch from network

Parameters
aReqspecifies the content,at least iRequestType and iRequestedItem need to be there
aIsBackgroundDlis true if the retrieval may be queued into background as a low-priority item

Implemented in Controller.

virtual void MController::storePrivateDataOfSelectedProfile ( )
pure virtualslot

method for storing private data of profile currently in use

virtual void MController::userInterfaceAction ( CAUserInterfaceRequest  aRequest,
const Hash aHashConcerned = KNullHash,
const Hash aFetchFromNode = KNullHash 
)
pure virtual

Method for requesting different things to take place in UI. controller mostly routes these to FrontWidget but other actions may be in order too..

Parameters
aRequestusers orders
aHashConcernedpossible hash parameter ; can be null hash if action is not about specific hash
aFetchFromNodepossible node hash parameter ; if concerning item is not found from local storage, try to fetch it from given node ; is KNullHash, then just do fetch using normal algorithm.
Returns
none

Implemented in Controller, and MockUpController.


The documentation for this class was generated from the following file: