mysocials-core 1.0

src/panels/profilebrowserpanel.h

Go to the documentation of this file.
00001 
00007 #ifndef PROFILEBROWSERPANEL_H
00008 #define PROFILEBROWSERPANEL_H
00009 
00010 #include <QWidget>
00011 #include <QRadioButton>
00012 #include <QPushButton>
00013 #include <QMessageBox>
00014 #include <QListWidget>
00015 #include <QDesktopWidget>
00016 
00017 #include "widgets/qtoppanel.h"
00018 #include "utils/hintedit.h"
00019 
00020 #include "datatypes/message.h"
00021 #include "datatypes/friend.h"
00022 #include "datatypes/account.h"
00023 
00024 #include "widgets/profilebrowser.h"
00025 
00026 #include "servicemgr.h"
00027 
00028 namespace Ui {
00029     class ProfileBrowserPanel;
00030 }
00031 
00042 class ProfileBrowserPanel : public QWidget
00043 {
00044     Q_OBJECT
00045 public:
00051     explicit ProfileBrowserPanel(QWidget *parent = 0);
00052 
00060     explicit ProfileBrowserPanel(ServiceMgr *mgr = NULL, QWidget *parent = 0);
00061 
00063     ~ProfileBrowserPanel();
00064 
00065     void clearEditOwnr();
00066 
00072     void showFriendInfo(Friend fd);
00073 
00079     void init();
00080 
00086     void hideAll(QLayout *layout);
00087 
00093     void showAll(QLayout *layout);
00094 
00101     enum WindowState {
00102         WindowFriendList,   
00103         WindowProfile       
00104     };
00105 
00111     void setState(WindowState state);
00112 
00116     void setState();
00117 
00118 signals:
00124     void openProfile(Friend profile);
00125 
00131     void showFriendAlbums(Friend fd);
00132 
00138     void sendMessage(Friend fd);
00139 
00145     void showFriendMessages(Friend fd);
00146 
00147 public slots:
00148 
00149 private:    
00150     Ui::ProfileBrowserPanel *ui;
00151     ProfileBrowser *pb;
00152     ServiceMgr *sm;
00153     HintEdit *editOwnr;
00154 
00155     QRadioButton *peopleradb;
00156     QPushButton *buttonEditOwnr;
00157     QPushButton *buttonRefreshFriends;
00158     QPushButton *buttonAlbums;
00159     QPushButton *buttonSendMsg;
00160     QPushButton *buttonBack;
00161     QPushButton *buttonMessages;
00162     QFont usedFont;
00163 
00164     bool isFriendsUpdate;
00165     bool isPortraitMode;
00166 
00167     bool isSkipFriendUpdate;
00168 
00169     // current state for window
00170     WindowState state;
00171 
00172     void ownrSelected(QListWidgetItem *item, bool isNeedUpdateState);
00173 
00174     QListWidgetItem *createFriendWidget(Friend fr);
00175     void addMeToFriends();
00176 
00177 private slots:
00178     void refreshFriends();
00179     void refreshFriends(bool isNeedUpdate);
00180     void buttonResetOwnr_clicked();
00181 
00182     void editOwnr_textChanged(QString str);
00183     void ownrSelected(QListWidgetItem *item);
00184 
00185     void hideProfile();
00186 
00187     void showFriendAlbums();
00188     void showFriendMessages();
00189     void sendMessageToFriend();
00190     void orientationChanged();
00191 
00192     void updateListFriends(FriendList list, bool isLastUpdate);
00193     void updateProfile(Friend profile);
00194     void updateAccounts(AccountList list);
00195     void disableFriendSkipUpdate();
00196 };
00197 
00198 #endif // PROFILEBROWSERPANEL_H