Classified ads
|
Class for keeping app state. More...
#include <controller.h>
Public Slots | |
virtual void | exitApp () |
virtual void | displayAboutBox () |
virtual void | displayFront () |
virtual void | changeProfilePasswd () |
virtual void | createProfile () |
virtual void | deleteProfile () |
virtual void | selectProfile () |
virtual void | displaySettings () |
virtual void | displayStatus () |
virtual void | displaySearch () |
virtual void | handleError (MController::CAErrorSituation aError, const QString &aExplanation) |
void | notifyOfContentReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfReceivedContent) |
void | notifyOfContentReceived (const Hash &aHashOfContent, const Hash &aHashOfClassification, const ProtocolItemType aTypeOfReceivedContent) |
void | notifyOfContentNotReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfNotReceivdContent) |
virtual void | storePrivateDataOfSelectedProfile (bool aPublishTrustListToo=false) |
virtual void | reStorePrivateDataOfSelectedProfile () |
virtual bool | isContactInContactList (const Hash &aFingerPrint) const |
virtual QString | displayableNameForProfile (const Hash &aProfileFingerPrint) const |
virtual void | offerDisplayNameForProfile (const Hash &aProfileFingerPrint, const QString &aDisplayName, const bool iUpdatePersistenStorage=false) |
virtual void | displayFileInfoOnUi (const BinaryFile &aFileMetadata) |
virtual VoiceCallEngine * | voiceCallEngine () |
virtual MVoiceCallEngine * | voiceCallEngineInterface () |
void | sendProfileUpdateQuery (const Hash &aProfileFingerPrint, const Hash &aProfileNodeFingerPrint=KNullHash) |
Public Slots inherited from MController | |
virtual void | exitApp ()=0 |
virtual void | displayAboutBox ()=0 |
virtual void | displayFront ()=0 |
virtual void | handleError (MController::CAErrorSituation aError, const QString &aExplanation)=0 |
virtual void | storePrivateDataOfSelectedProfile (bool aPublishTrustListToo=false)=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 |
virtual void | displayFileInfoOnUi (const BinaryFile &aFileMetadata)=0 |
virtual VoiceCallEngine * | voiceCallEngine ()=0 |
virtual MVoiceCallEngine * | voiceCallEngineInterface ()=0 |
Signals | |
void | userProfileSelected (const Hash &aProfile) |
void | waitDialogToBeDismissed () |
Public Member Functions | |
Controller (QApplication &app) | |
~Controller () | |
virtual void | startRetrievingContent (NetworkRequestExecutor::NetworkRequestQueueItem aReq, bool aIsBackgroundDl, ProtocolItemType aTypeOfExpectedObject) |
virtual void | userInterfaceAction (CAUserInterfaceRequest aRequest, const Hash &aHashConcerned=KNullHash, const Hash &aFetchFromNode=KNullHash, const QString *aAdditionalInformation=NULL) |
virtual void | hideUI () |
virtual void | showUI () |
virtual void | setProfileInUse (const Hash &aProfileHash) |
virtual const Hash & | profileInUse () |
virtual void | setContentKeyPasswd (QString aPasswd) |
virtual QString | contentKeyPasswd () const |
virtual Node & | getNode () const |
virtual NetworkListener * | networkListener () const |
virtual Model & | model () const |
Private Member Functions | |
void | createMenus () |
int | createPidFile () |
void | deletePidFile () |
Private Attributes | |
QMainWindow * | iWin |
FrontWidget * | iCurrentWidget |
QApplication & | iApp |
QBoxLayout * | iLayout |
QMenu * | iFileMenu |
QAction * | iExitAct |
QAction * | iAboutAct |
QAction * | iPwdChangeAct |
QAction * | iProfileDeleteAct |
QAction * | iProfileCreateAct |
QAction * | iProfileSelectAct |
QAction * | iDisplaySettingsAct |
QAction * | iDisplayStatusAct |
QAction * | iDisplaySearchAct |
Node * | iNode |
Model * | iModel |
NetworkListener * | iListener |
NetworkConnectorEngine * | iNetEngine |
QString | iContentKeyPasswd |
Hash | iProfileHash |
PublishingEngine * | iPubEngine |
RetrievalEngine * | iRetrievalEngine |
ProtocolItemType | iTypeOfObjectBeingWaitedFor |
Hash | iHashOfObjectBeingWaitedFor |
Hash | iHashOfProfileCommentBeingWaitedFor |
Hash | iNodeForCommentBeingWaitedFor |
QMap< Hash, QString > | iHashDisplaynameMapping |
VoiceCallEngine * | iVoiceCallEngine |
bool | iInsideDestructor |
Additional Inherited Members | |
Public Types inherited from MController | |
enum | CAErrorSituation { OwnCertNotFound, DataBaseNotMountable, BadPassword, DbTransactionError, ContentEncryptionError, FileOperationError } |
enum | CAUserInterfaceRequest { ViewProfileDetails, ViewCa, ViewProfileComment, DisplayProgressDialog, VoiceCallToNode } |
Class for keeping app state.
C of MVC-pattern is considered here. UI events are routed via this class and this implements scheduling of events so that things happen in correct order.
Controller::Controller | ( | QApplication & | app | ) |
constructor
Controller::~Controller | ( | ) |
Destructor
|
virtualslot |
name says it all. initiates UI sequence
|
virtual |
method for getting passwd of private content keys previously set, see method Controller::setContentKeyPasswd
Implements MController.
|
private |
menus here
|
private |
|
virtualslot |
Initiates UI sequence for new profile
|
private |
leave a mark to filesystem about instance
|
virtualslot |
Initiates UI sequence for deleting profile
|
virtualslot |
method for producing a displayable version of a profile. in practice this utilitizes the contacts of the selected profile and a cache that is collected from private messages, ads, profile comments and profiles
|
virtualslot |
bragging
|
virtualslot |
method that puts dialog or similar on display, about a published file
|
virtualslot |
this initializes the "normal" display
|
virtualslot |
Slot for displaying search dialog
|
virtualslot |
Slot for displaying node settings
|
virtualslot |
Slot for displaying network status
|
virtualslot |
quitting
|
virtual |
Method for node ; this may be changed during startup-phase but not after that
Implements MController.
|
virtualslot |
Method for handling errors inside application.
aError | Reason for error call, from error enum above |
aExplanation | NULL or human-readable description about what went wrong. |
|
virtual |
method for hiding UI
Implements MController.
|
virtualslot |
method for checking if a profile is found from contact list of selected user
|
virtual |
method for getting datamodel
Implements MController.
|
virtual |
method for network listener ; it is parent of all connections, also the outgoing
Implements MController.
|
slot |
This is receiving slot of signals sent from retrieval engine; when we try to receive content and we do not get any, this notifies user that time-out is due
aHashOfContent | item that was requested |
aTypeOfNotReceivdContent | item type requested |
|
slot |
This is receiving slot of signals sent from actual content handlers ; when we receive new content, this method is hit, reason for this is that we may be waiting for specific content somewhere
aHashOfContent | item that was requested |
aTypeOfReceivedContent | item type requested |
|
slot |
This is receiving slot of signals sent from actual content handlers ; when we receive new content, this method is hit, reason for this is that we may be waiting for specific content somewhere. This overload is mostly hit by classified ads.
aHashOfContent | item that was requested |
aHashOfClassification | of item that was requested |
aTypeOfReceivedContent | item type requested |
|
virtualslot |
method for keeping profile hash<->displayname relation up to date. this is called when display names are seen in profiles, ads, private messages etc.
|
virtual |
method getting user profile in use.
Implements MController.
|
virtualslot |
method for restoring private data of profile currently in use. shall be called after new profile is selected in frontwidget.
|
virtualslot |
Initiates UI sequence for selecting profile
|
slot |
method for sending a poll around network regarding possible update for a profile and possible addition of comments about given profile.
datamodel should not be locked when this is called.
in practice this is called after user selects a profile to be viewed ; it could be called periodically too for selected profiles..
aProfileFingerPrint | is fingerprint of the profile concerned. |
aProfileNodeFingerPrint | fingerprint of node that is suspected to be the node where profile is published from. this is naturally good candidate for sending the query. |
|
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.
Implements MController.
|
virtual |
method selecting user profile in use.
Implements MController.
|
virtual |
method for showing UI
Implements MController.
|
virtual |
method that starts actions regarding content fetch from network
aReq | specifies the content,at least iRequestType and iRequestedItem need to be there |
aIsBackgroundDl | is true if the retrieval may be queued into background as a low-priority item |
Implements MController.
|
virtualslot |
Method for persisting profile private data inside datamodel. Tnis is supposed to be called every time after private data changes.
lock the datamodel before calling this method
aPublishTrustListToo | if set to true, has selected profiles trust list to be updated profile data and profile published with the new trust list. |
|
virtual |
From MController.
Method for requesting different things to take place in UI. controller mostly routes these to FrontWidget but other actions may be in order too..
aRequest | users orders |
aHashConcerned | possible hash parameter ; can be null hash if action is not about specific hash |
aFetchFromNode | possible 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. |
aAdditionalInformation | possible explanation or other info |
Implements MController.
|
signal |
|
virtualslot |
Method for getting voice call engine, if there is any. From MController interface.
|
virtualslot |
Method for getting voice call engine, if there is any. From MController interface.
|
signal |
used for signalling possible wait dialog about dismissal
|
private |
|
private |
|
private |
|
private |
normally points to "frontwidget" instance
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
profile hash<->display_name mapping
|
private |
hash of object that user needs to wait.
|
private |
hash of profile comment that user needs to wait. This is used in two-stage fetch process of profile comment where the profile may need to be retrieved first, then the comment: we store there the profile comment hash for duration of profile fetch
|
private |
Flag for destructor. If this is on, don't allocate more objects
|
private |
|
private |
Incoming connections handler, for ipv4
|
private |
data storage animal
|
private |
Outgoing connections handler
|
private |
our network presence object, there is single instance
|
private |
Node where to ask for profile comment once profile has been fetched
|
private |
|
private |
|
private |
passwd used to protect profile private RSA key fingerprint of profile currently in use
|
private |
|
private |
Logic for handling content publish
|
private |
|
private |
Logic for fetcing stuff from other nodes
|
private |
if user requests for item that we do not have, lets put a wait dialog in place and start wait for the object to appear from network. in order to properly dismiss the dialog, have here type (and later hash) of the objects that we're waiting for
|
private |
Currently there is support for one voice call at time
|
private |
remove mark from filesystem about instance