mysocials-core 1.0

src/widgets/messagecomposer.h

Go to the documentation of this file.
00001 
00007 #ifndef MESSAGECOMPOSER_H
00008 #define MESSAGECOMPOSER_H
00009 
00010 #include <QWidget>
00011 #include <QPushButton>
00012 
00013 #include "datatypes/message.h"
00014 #include "datatypes/friend.h"
00015 
00016 #include "servicemgr.h"
00017 
00018 namespace Ui {
00019     class MessageComposer;
00020 }
00021 
00031 class MessageComposer : public QWidget
00032 {
00033     Q_OBJECT
00034 public:
00040     explicit MessageComposer(QWidget *parent = 0);
00041 
00049     explicit MessageComposer(ServiceMgr *sm, QWidget *parent = 0);
00050 
00052     ~MessageComposer();
00053 
00059     void init();
00060 
00064     void resetMessage();
00065 
00071     void setRecepient(Friend fd);
00072 
00078     void setRecepient(QString ownerId);
00079 
00085     void setTitle(QString title);
00086 
00092     void setMessageBody(QString text);
00093 
00099     void replyMessage(Message msg);
00100 
00101 signals:
00111     void sendMessage(QString ownerId, QString title, QString message);
00112 
00118     void saveMessage(Message msg);
00119 
00120 public slots:
00121 
00122 private:
00123     QPushButton *buttonSend;
00124     QPushButton *buttonSave;
00125 
00126     ServiceMgr *sm;
00127     Ui::MessageComposer *ui;
00128 
00129 private slots:
00130     void sendMessage();
00131     void saveMessage();
00132     void updateAccounts(AccountList);
00133     void updateFriendList(FriendList list, bool isLastUpdate);
00134 
00135 };
00136 
00137 #endif // MESSAGECOMPOSER_H