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 #include "widgets/friends/qfriendlistwidget.h"
00026
00027 #include "servicemgr.h"
00028
00029 namespace Ui {
00030 class ProfileBrowserPanel;
00031 }
00032
00043 class ProfileBrowserPanel : public QWidget
00044 {
00045 Q_OBJECT
00046 public:
00052 explicit ProfileBrowserPanel(QWidget *parent = 0);
00053
00061 explicit ProfileBrowserPanel(ServiceMgr *mgr = NULL, QWidget *parent = 0);
00062
00064 ~ProfileBrowserPanel();
00065
00071 void showFriendInfo(Friend fd);
00072
00078 void init();
00079
00085 void hideAll(QLayout *layout);
00086
00092 void showAll(QLayout *layout);
00093
00100 enum WindowState {
00101 WindowFriendList,
00102 WindowProfile
00103 };
00104
00110 void setState(WindowState state);
00111
00115 void setState();
00116
00117 void setFriendsVisible(const bool isShow);
00118
00119 signals:
00125 void openProfile(Friend profile);
00126
00132 void showFriendAlbums(Friend fd);
00133
00139 void sendMessage(Friend fd);
00140
00146 void showFriendMessages(Friend fd);
00147
00148 public slots:
00149
00150 private:
00151 Ui::ProfileBrowserPanel *ui;
00152 QFriendListWidget *friendsPanel;
00153 ProfileBrowser *pb;
00154 ServiceMgr *sm;
00155
00156 QRadioButton *peopleradb;
00157 QRadioButton *newsradb;
00158 QPushButton *buttonRefreshFriends;
00159 QPushButton *buttonRefreshProfile;
00160 QPushButton *buttonAlbums;
00161 QPushButton *buttonSendMsg;
00162 QPushButton *buttonBack;
00163 QPushButton *buttonMessages;
00164 QFont usedFont;
00165
00166 bool isFriendsUpdate;
00167 bool isPortraitMode;
00168
00169
00170 WindowState state;
00171
00172 void ownrSelected(Friend fd, bool isNeedUpdateState);
00173
00174 private slots:
00175 void refreshFriends();
00176 void refreshFriends(bool isNeedUpdate);
00177
00178 void refreshProfile();
00179
00180 void ownrSelected(Friend fd);
00181
00182 void hideProfile();
00183
00184 void showFriendPanel(bool isShow);
00185
00186 void showFriendAlbums();
00187 void showFriendMessages();
00188 void sendMessageToFriend();
00189 void orientationChanged();
00190
00191 void updateListFriends(FriendList list, bool isLastUpdate);
00192 void updateProfile(Friend profile);
00193 void updateAccounts(QString accountId, AccountList list);
00194 };
00195
00196 #endif // PROFILEBROWSERPANEL_H