Classified ads
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
FrontWidget Class Reference

#include <FrontWidget.h>

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

Public Slots

virtual void publishProfileButtonClicked ()
 
virtual void revertProfileButtonClicked ()
 
virtual void profileImageClicked ()
 
virtual void profileReadersClicked ()
 
virtual void profileEdited (const QString &aNewText)
 
virtual void isPrivateSettingChanged (int aState)
 
virtual void userProfileSelected (const Hash &aProfile)
 
virtual void fileToBeSharedAdded ()
 
virtual void fileToBeSharedRemoved ()
 
virtual void exportSharedFile ()
 
virtual void viewSharedFileInfo ()
 
virtual void copySharedFileHash ()
 
virtual void editNewSharedFile ()
 
virtual void profileSendMsgButtonClicked ()
 
virtual void profileShowReadersButtonClicked ()
 
virtual void profileSendCommentButtonClicked ()
 
virtual void caTabAboutComboChanged (int aNewIndex)
 
virtual void caTabConcernsComboChanged (int aNewIndex)
 
virtual void caTabWhereComboChanged (int aNewIndex)
 
virtual void replyToCaButtonClicked ()
 
virtual void replyToCaToForumButtonClicked ()
 
virtual void commentCaPosterProfile ()
 
virtual void viewCaPosterProfile ()
 
virtual void viewCaAttachments ()
 
virtual void postNewClassifiedAd ()
 
virtual void performAdsSearchClicked ()
 
virtual void CAselectionChangedSlot (const QItemSelection &, const QItemSelection &)
 
virtual void privMsgselectionChangedSlot (const QItemSelection &, const QItemSelection &)
 
virtual void contactsSelectionChangedSlot (const QItemSelection &, const QItemSelection &)
 
virtual void replyToPrivMsgButtonClicked ()
 
virtual void commentPrivMsgPosterProfile ()
 
virtual void viewPrivMsgPosterProfile ()
 
virtual void postNewPrivateMessage ()
 
virtual void viewPrivMsgAttachments ()
 
virtual void addMessageSenderToContacts ()
 
virtual void addCaSenderToContacts ()
 
virtual void addContactButtonClicked ()
 
virtual void addContactFromContactViewButtonClicked ()
 
virtual void removeContactButtonClicked ()
 
virtual void viewContactProfileButtonClicked ()
 
virtual void sendMsgToContactButtonClicked ()
 
virtual void editContactActionSelected ()
 
virtual void ownProfileCommentselectionChangedSlot (const QItemSelection &, const QItemSelection &)
 
virtual void viewedProfileCommentselectionChangedSlot (const QItemSelection &, const QItemSelection &)
 
virtual void viewedProfileCommentDoubleClicked (const QModelIndex &aSelection)
 
virtual void viewedProfileCommentKeyPressed ()
 
virtual void ownProfileCommentDoubleClicked (const QModelIndex &aSelection)
 
virtual void linkActivated (const QString &aLink)
 
virtual void ownBinaryFileSelectionChangedSlot (const QModelIndex &aItem, const QModelIndex &aPreviousItem)
 
virtual void viewedBinaryFileSelectionChangedSlot (const QModelIndex &aItem, const QModelIndex &aPreviousItem)
 
void updateFileSelectionActions ()
 
void nodeConnectionAttemptStatus (Connection::ConnectionState aStatus, const Hash aHashOfAttemptedNode)
 
void voiceCallButtonPressed ()
 
void callStateChanged (quint32 aCallId, VoiceCallEngine::CallState aState)
 

Signals

void error (MController::CAErrorSituation aError, const QString &aExplanation)
 
void displayedCaChanged ()
 
void displayedPrivMsgChanged ()
 

Public Member Functions

 FrontWidget (Controller *aController, QMainWindow &aParent)
 
 ~FrontWidget ()
 
void showDetailsOfProfile (const Hash &aFingerPrint)
 
void showClassifiedAd (const CA &ca)
 
void showSingleCommentOfProfile (const Hash aCommentFingerPrint)
 
void receiveNotifyOfContentReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfReceivdContent)
 
void receiveNotifyOfContentReceived (const Hash &aHashOfContent, const Hash &aHashOfClassificationOrDestination, const ProtocolItemType aTypeOfReceivdContent)
 
QVariant contactDataOfSelectedProfile ()
 
QList< HashtrustListOfSelectedProfile () const
 
void setContactDataOfSelectedProfile (const QVariantList &aContacts)
 
bool isContactInContactList (const Hash &aFingerPrint) const
 
ProfileselectedProfile () const
 
void openBinaryFile (const Hash &aFingerPrint, bool aUseViewedProfileNodeAsNetreqDest=false)
 

Static Public Member Functions

static void fillCaSelectionCombobox (QComboBox &aComboBox, bool isAboutComboBox, MController &aController)
 
static QString selectedClassification (const QComboBox &aAboutCombo, const QComboBox &aRegardingCombo, const QComboBox &aWhereCombo, const MController &aController)
 

Private Member Functions

void updateUiFromSelectedProfile ()
 
void setUpSelectedProfileFileListingModel ()
 
void setupClassifiedAdsTab ()
 
void setupPrivateMessagesTab ()
 
void setupContactsTab ()
 
void selectClassification (QString aNameOfClassification)
 
void updateUiFromViewedProfile ()
 
void activateProfileCommentDisplay (ProfileCommentListingModel *aListingModel, ProfileCommentModel &aCommentModel, const Hash &aInitialComment, const Hash &aViewedProfile)
 
void setCaDocumentSize ()
 
void setPrivMsgSize ()
 
void doShowFileMetadata (const Hash &aBinaryFileFingerPrint)
 
void setVoiceCallButtonStatus ()
 

Private Attributes

Ui::frontWidget ui
 
ControlleriController
 
QMainWindow & iParent
 
ProfileiSelectedProfile
 
ProfileiViewedProfile
 
QAction * iAddSharedFileAction
 
QAction * iRemoveSharedFileAction
 
QAction * iExportSharedFileAction
 
QAction * iViewSharedFileInfoAction
 
QAction * iCopySharedFileHashAction
 
QAction * iEditNewSharedFileAction
 
BinaryFileListingModeliSelectedProfileFileListingModel
 
BinaryFileListingModeliViewedProfileFileListingModel
 
QPushButton * iReplyToCaButton
 
QPushButton * iReplyToCaToForumButton
 
QPushButton * iNewCaButton
 
QPushButton * iCommentCaPosterButton
 
QPushButton * iViewCaPosterProfileButton
 
QPushButton * iViewCaAttachmentsButton
 
QAction * iAddToContactsFromCaList
 
CAListingModel iCaListingModel
 
QGraphicsScene iCaScene
 
QGraphicsTextItem iCaText
 
CA iCaOnDisplay
 
QGraphicsSimpleTextItem iFromField
 
QGraphicsSimpleTextItem iSubjectField
 
const QPoint iArticleTopLeft
 
PrivateMessageSearchModel iPrivMsgSearchModel
 
PrivMessage iPrivMsgOnDisplay
 
QGraphicsScene iPrivMsgScene
 
QGraphicsTextItem iPrivMsgText
 
QGraphicsSimpleTextItem iPrivMsgFromField
 
QGraphicsSimpleTextItem iPrivMsgSubjectField
 
const QPoint iPrivMsgTopLeft
 
QPushButton * iReplyToPrivMsgButton
 
QPushButton * iNewPrivMsgButton
 
QPushButton * iCommentPrivMsgPosterButton
 
QPushButton * iViewPrivMsgPosterProfileButton
 
QPushButton * iViewPrivMsgAttachmentsButton
 
QAction * iAddToContactsFromMsgList
 
ContactListingModel iContactsModel
 
Hash iSelectedContact
 
QAction * iEditContactAction
 
ProfileCommentListingModel iSelectedProfileCommentListingModel
 
ProfileCommentListingModel iViewedProfileCommentListingModel
 
Hash iSelectedCommentFromOwnCommentListing
 
Hash iSelectedCommentFromViewedCommentListing
 
QShortcut * iProfileListingKeyboardGrabber
 
bool iWindowSizeAdjusted
 
Hash iSelectedOwnBinaryFile
 
Hash iSelectedViewedProfileBinaryfile
 

Constructor & Destructor Documentation

FrontWidget::FrontWidget ( Controller aController,
QMainWindow &  aParent 
)
FrontWidget::~FrontWidget ( )

Member Function Documentation

void FrontWidget::activateProfileCommentDisplay ( ProfileCommentListingModel aListingModel,
ProfileCommentModel aCommentModel,
const Hash aInitialComment,
const Hash aViewedProfile 
)
private

method for bringing up dialog for display of profile comments

Parameters
aListingModeldatamodel holding the comments to list (UI model)
aCommentModeldatamodel holding the comment data (storage model)
aInitialCommentif non-null, hash of comment to initially focus
aViewedProfilefingerprint of profile whose comments are shown
Returns
none
virtual void FrontWidget::addCaSenderToContacts ( )
virtualslot

called from ca listing tab

virtual void FrontWidget::addContactButtonClicked ( )
virtualslot

new contact

virtual void FrontWidget::addContactFromContactViewButtonClicked ( )
virtualslot

new contact from "view contact" tab

virtual void FrontWidget::addMessageSenderToContacts ( )
virtualslot

called from messages tab

void FrontWidget::callStateChanged ( quint32  aCallId,
VoiceCallEngine::CallState  aState 
)
slot

Slot that is hit when call status changes. This is signal/slot equivalent of call status observer.

virtual void FrontWidget::CAselectionChangedSlot ( const QItemSelection &  ,
const QItemSelection &   
)
virtualslot

this slot is called when classified ads header listing view has new selection

virtual void FrontWidget::caTabAboutComboChanged ( int  aNewIndex)
virtualslot
virtual void FrontWidget::caTabConcernsComboChanged ( int  aNewIndex)
virtualslot
virtual void FrontWidget::caTabWhereComboChanged ( int  aNewIndex)
virtualslot
virtual void FrontWidget::commentCaPosterProfile ( )
virtualslot
virtual void FrontWidget::commentPrivMsgPosterProfile ( )
virtualslot

from priv msg tab btn

QVariant FrontWidget::contactDataOfSelectedProfile ( )

method for retrieving contacts list of the profile currently selected

virtual void FrontWidget::contactsSelectionChangedSlot ( const QItemSelection &  ,
const QItemSelection &   
)
virtualslot

this slot is called when contacts listing view has new selection

virtual void FrontWidget::copySharedFileHash ( )
virtualslot

copies shared file SHA1 to clipboard

void FrontWidget::displayedCaChanged ( )
signal

emitted when ca on display is replaced

void FrontWidget::displayedPrivMsgChanged ( )
signal

emitted when privmsg on display is replaced

void FrontWidget::doShowFileMetadata ( const Hash aBinaryFileFingerPrint)
private
virtual void FrontWidget::editContactActionSelected ( )
virtualslot

edit

virtual void FrontWidget::editNewSharedFile ( )
virtualslot

initiates edit+publish of new text document

void FrontWidget::error ( MController::CAErrorSituation  aError,
const QString &  aExplanation 
)
signal
virtual void FrontWidget::exportSharedFile ( )
virtualslot

operator wants to save a shared file

virtual void FrontWidget::fileToBeSharedAdded ( )
virtualslot

operator wants to share a file

virtual void FrontWidget::fileToBeSharedRemoved ( )
virtualslot

operator wants to stop advertasing a shared file

static void FrontWidget::fillCaSelectionCombobox ( QComboBox &  aComboBox,
bool  isAboutComboBox,
MController aController 
)
static

Method for filling ad-category-selection -related comboboxes. This is implemented here in frontwidget but is used by dialogs as well, and that is the reason why this method is public.

bool FrontWidget::isContactInContactList ( const Hash aFingerPrint) const

method for checking if given profile is in contact list of selected profile

virtual void FrontWidget::isPrivateSettingChanged ( int  aState)
virtualslot

callback of "is private" checkbox

virtual void FrontWidget::linkActivated ( const QString &  aLink)
virtualslot

this slot is called when user clicks on link on document

void FrontWidget::nodeConnectionAttemptStatus ( Connection::ConnectionState  aStatus,
const Hash  aHashOfAttemptedNode 
)
slot

when connection is attempted, NetworkListener will emit the status (failed or success) of the connection, emitted signal is connected here, among other places

void FrontWidget::openBinaryFile ( const Hash aFingerPrint,
bool  aUseViewedProfileNodeAsNetreqDest = false 
)

method for opening a binary file, called from url handling and from "save shared file.." selection

virtual void FrontWidget::ownBinaryFileSelectionChangedSlot ( const QModelIndex &  aItem,
const QModelIndex &  aPreviousItem 
)
virtualslot

called when user selects binary file from her own list of shared files

virtual void FrontWidget::ownProfileCommentDoubleClicked ( const QModelIndex &  aSelection)
virtualslot

this slot is called when user doubleclicks profile comment listing of own profile

virtual void FrontWidget::ownProfileCommentselectionChangedSlot ( const QItemSelection &  ,
const QItemSelection &   
)
virtualslot

this slot is called when own profile comments listing is changed

virtual void FrontWidget::performAdsSearchClicked ( )
virtualslot

callback of "search ads"

virtual void FrontWidget::postNewClassifiedAd ( )
virtualslot
virtual void FrontWidget::postNewPrivateMessage ( )
virtualslot

from priv msg tab btn

virtual void FrontWidget::privMsgselectionChangedSlot ( const QItemSelection &  ,
const QItemSelection &   
)
virtualslot

this slot is called when private messages header listing view has new selection

virtual void FrontWidget::profileEdited ( const QString &  aNewText)
virtualslot

callback for any UI actions that edit profile

virtual void FrontWidget::profileImageClicked ( )
virtualslot

callback of image selection

virtual void FrontWidget::profileReadersClicked ( )
virtualslot

callback of reader-list edit

virtual void FrontWidget::profileSendCommentButtonClicked ( )
virtualslot
virtual void FrontWidget::profileSendMsgButtonClicked ( )
virtualslot
virtual void FrontWidget::profileShowReadersButtonClicked ( )
virtualslot
virtual void FrontWidget::publishProfileButtonClicked ( )
virtualslot

callback of publish btn

void FrontWidget::receiveNotifyOfContentReceived ( const Hash aHashOfContent,
const ProtocolItemType  aTypeOfReceivdContent 
)

kind of "observer" method called from controller when there is new content available ; odds are that we're displaying or waiting some of that

void FrontWidget::receiveNotifyOfContentReceived ( const Hash aHashOfContent,
const Hash aHashOfClassificationOrDestination,
const ProtocolItemType  aTypeOfReceivdContent 
)

kind of "observer" method called from controller when there is new content available ; odds are that we're displaying or waiting some of that. This variant is hit with notifications about classified ads or private messages

Parameters
aHashOfContentfingerprint of the object (ca or priv msg) received
aHashOfClassificationOrDestinationin case of ca, this is fingerprint of the classification, in case of private message, this is recipient profile fingerprint.
virtual void FrontWidget::removeContactButtonClicked ( )
virtualslot

remove contact

virtual void FrontWidget::replyToCaButtonClicked ( )
virtualslot
virtual void FrontWidget::replyToCaToForumButtonClicked ( )
virtualslot
virtual void FrontWidget::replyToPrivMsgButtonClicked ( )
virtualslot

from priv msg tab btn

virtual void FrontWidget::revertProfileButtonClicked ( )
virtualslot

callback of revert btn

void FrontWidget::selectClassification ( QString  aNameOfClassification)
private

Method that set selected ad-classification on display

Parameters
aNameOfClassificationis the classification, like "ToBeGivenAway.Clothing.AtYourPlace"
static QString FrontWidget::selectedClassification ( const QComboBox &  aAboutCombo,
const QComboBox &  aRegardingCombo,
const QComboBox &  aWhereCombo,
const MController aController 
)
static

Method for getting the fully qualified name of the group selection that user has made, for reason or another. Called also from dialogs, thus public

Profile* FrontWidget::selectedProfile ( ) const
inline

method for getting currently selected profile or NULL if no profile selected

virtual void FrontWidget::sendMsgToContactButtonClicked ( )
virtualslot

send message to contact list profile

void FrontWidget::setCaDocumentSize ( )
private
void FrontWidget::setContactDataOfSelectedProfile ( const QVariantList &  aContacts)

method for setting contacts list of the profile currently selected

void FrontWidget::setPrivMsgSize ( )
private
void FrontWidget::setupClassifiedAdsTab ( )
private

separate init method for setting up the classified-ads tab as it is fairly complex

void FrontWidget::setupContactsTab ( )
private

contacts tab setup

void FrontWidget::setupPrivateMessagesTab ( )
private

separate init method for setting up the private messages tab as it is fairly complex. This must be called after each profile re-selection

void FrontWidget::setUpSelectedProfileFileListingModel ( )
private

method that sets up shared file listing model based on selected profile. if selected profile is NULL, this will tear down the model too.

void FrontWidget::setVoiceCallButtonStatus ( )
private
void FrontWidget::showClassifiedAd ( const CA ca)

displays a selected classified ad

void FrontWidget::showDetailsOfProfile ( const Hash aFingerPrint)

puts profile of any operator on display

void FrontWidget::showSingleCommentOfProfile ( const Hash  aCommentFingerPrint)

displays a selected profile comment

QList<Hash> FrontWidget::trustListOfSelectedProfile ( ) const

method for retrieving trust list of the profile currently selected

void FrontWidget::updateFileSelectionActions ( )
slot

sets up binary file listing actions in list of shared files for both own profile shared file listing and possible viewed profile shared file listing ; they share same actions

void FrontWidget::updateUiFromSelectedProfile ( )
private

method that reads iSelectedProfile and updates UI elements accordingly into "my profile" tab

void FrontWidget::updateUiFromViewedProfile ( )
private

method that reads iViewedProfile and updates UI elements accordingly into "viewed profile" tab

virtual void FrontWidget::userProfileSelected ( const Hash aProfile)
virtualslot

called from controller when another user profile is selected

virtual void FrontWidget::viewCaAttachments ( )
virtualslot
virtual void FrontWidget::viewCaPosterProfile ( )
virtualslot
virtual void FrontWidget::viewContactProfileButtonClicked ( )
virtualslot

view contact profile

virtual void FrontWidget::viewedBinaryFileSelectionChangedSlot ( const QModelIndex &  aItem,
const QModelIndex &  aPreviousItem 
)
virtualslot

called when user selects binary file from list of shared files from list of a viewed profile

virtual void FrontWidget::viewedProfileCommentDoubleClicked ( const QModelIndex &  aSelection)
virtualslot

this slot is called when user doubleclicks profile comment listing of viewed profile

virtual void FrontWidget::viewedProfileCommentKeyPressed ( )
virtualslot

this slot is called when user hits enter while having keyboard focus on profile comment listing

virtual void FrontWidget::viewedProfileCommentselectionChangedSlot ( const QItemSelection &  ,
const QItemSelection &   
)
virtualslot

this slot is called when viewed profile comments listing is changed

virtual void FrontWidget::viewPrivMsgAttachments ( )
virtualslot

displays list of attachments of a private message

virtual void FrontWidget::viewPrivMsgPosterProfile ( )
virtualslot

from priv msg tab btn

virtual void FrontWidget::viewSharedFileInfo ( )
virtualslot

for viewing metadata of a shared file

void FrontWidget::voiceCallButtonPressed ( )
slot

Slot that is hit when user wants to make a new voice call to operator

Member Data Documentation

QAction* FrontWidget::iAddSharedFileAction
private

context-menu action for adding shared file

QAction* FrontWidget::iAddToContactsFromCaList
private
QAction* FrontWidget::iAddToContactsFromMsgList
private
const QPoint FrontWidget::iArticleTopLeft
private
CAListingModel FrontWidget::iCaListingModel
private

used for content of ad-listing view

CA FrontWidget::iCaOnDisplay
private

Classified ad on

QGraphicsScene FrontWidget::iCaScene
private

this is used to display elements of an ad

QGraphicsTextItem FrontWidget::iCaText
private

this is used to render text of classified ad

QPushButton* FrontWidget::iCommentCaPosterButton
private

button for opening a dialog for commenting a CA poster profile

QPushButton* FrontWidget::iCommentPrivMsgPosterButton
private
ContactListingModel FrontWidget::iContactsModel
private
Controller* FrontWidget::iController
private
QAction* FrontWidget::iCopySharedFileHashAction
private

context-menu action copying SHA1 to clipboard

QAction* FrontWidget::iEditContactAction
private
QAction* FrontWidget::iEditNewSharedFileAction
private

context-menu action for editing new text doc

QAction* FrontWidget::iExportSharedFileAction
private

context-menu action for saving to filesystem a shared file

QGraphicsSimpleTextItem FrontWidget::iFromField
private
QPushButton* FrontWidget::iNewCaButton
private

button for opening dialog for posting a new CA

QPushButton* FrontWidget::iNewPrivMsgButton
private
QMainWindow& FrontWidget::iParent
private
QGraphicsSimpleTextItem FrontWidget::iPrivMsgFromField
private
PrivMessage FrontWidget::iPrivMsgOnDisplay
private
QGraphicsScene FrontWidget::iPrivMsgScene
private

this is used to display elements of an priv msg

PrivateMessageSearchModel FrontWidget::iPrivMsgSearchModel
private
QGraphicsSimpleTextItem FrontWidget::iPrivMsgSubjectField
private
QGraphicsTextItem FrontWidget::iPrivMsgText
private

this is used to render text of priv msg

const QPoint FrontWidget::iPrivMsgTopLeft
private
QShortcut* FrontWidget::iProfileListingKeyboardGrabber
private
QAction* FrontWidget::iRemoveSharedFileAction
private

context-menu action for adding shared file

QPushButton* FrontWidget::iReplyToCaButton
private
QPushButton* FrontWidget::iReplyToCaToForumButton
private
QPushButton* FrontWidget::iReplyToPrivMsgButton
private
Hash FrontWidget::iSelectedCommentFromOwnCommentListing
private
Hash FrontWidget::iSelectedCommentFromViewedCommentListing
private
Hash FrontWidget::iSelectedContact
private
Hash FrontWidget::iSelectedOwnBinaryFile
private

binary file selected from "shared files" list of own profiles shared files

Profile* FrontWidget::iSelectedProfile
private

components of selected "My profile"

ProfileCommentListingModel FrontWidget::iSelectedProfileCommentListingModel
private
BinaryFileListingModel* FrontWidget::iSelectedProfileFileListingModel
private

model for displaying file list "operator profile" ; there may be 2nd instance for displaying file list of some other profile that is not operators own

Hash FrontWidget::iSelectedViewedProfileBinaryfile
private

binary file selected from "shared files" list of viewed profiles shared files

QGraphicsSimpleTextItem FrontWidget::iSubjectField
private
QPushButton* FrontWidget::iViewCaAttachmentsButton
private

button for displaying attachments of a CA on display

QPushButton* FrontWidget::iViewCaPosterProfileButton
private

button for opening view of profile from CA display

Profile* FrontWidget::iViewedProfile
private

contents of "view profile" tab

ProfileCommentListingModel FrontWidget::iViewedProfileCommentListingModel
private
BinaryFileListingModel* FrontWidget::iViewedProfileFileListingModel
private

model for displaying file list of random viewed profile

QPushButton* FrontWidget::iViewPrivMsgAttachmentsButton
private
QPushButton* FrontWidget::iViewPrivMsgPosterProfileButton
private
QAction* FrontWidget::iViewSharedFileInfoAction
private

context-menu action for checking file metadata

bool FrontWidget::iWindowSizeAdjusted
private
Ui::frontWidget FrontWidget::ui
private

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