2
This file is part of Choqok, the KDE micro-blogging client
4
Copyright (C) 2008-2009 Mehrdad Momeny <mehrdad.momeny@gmail.com>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License as
8
published by the Free Software Foundation; either version 2 of
9
the License or (at your option) version 3 or any later version
10
accepted by the membership of KDE e.V. (or its successor approved
11
by the membership of KDE e.V.), which shall act as a proxy
12
defined in Section 14 of version 3 of the license.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, see http://www.gnu.org/licenses/
24
#ifndef STATUSWIDGET_H
25
#define STATUSWIDGET_H
28
#include <KTextBrowser>
29
#include <KPushButton>
32
#include "datacontainers.h"
33
#include "constants.h"
43
@author Mehrdad Momeny <mehrdad.momeny@gmail.com>
45
class StatusWidget : public KTextBrowser
48
Q_PROPERTY (bool read READ isRead)
50
enum Notify { WithNotify = 0, WithoutNotify};
52
explicit StatusWidget( const Account *account, QWidget *parent = 0 );
56
QString formatDateTime( const QDateTime &time );
58
static void setStyle(const QColor & color, const QColor & back, const QColor & read, const QColor & readBack);
60
Status currentStatus() const;
61
void setCurrentStatus( const Status newStatus );
62
void setUnread( Notify notifyType );
63
void setRead(bool read = true);
64
void updateFavoriteUi();
67
// static QString getColoredStyle() { return style; };
70
void slotFriendAdded(const QString &);
73
void sigSearch(int type, const QString & search);
74
void sigReply( const QString &userName, qulonglong statusId, bool dMsg );
75
void sigDestroy( qulonglong statusId );
76
void sigFavorite( qulonglong statusId, bool isFavorite );
77
void sigReTweet( const QString &text );
80
void setFavorite( bool isFavorite );
82
void requestDestroy();
83
void requestReTweet();
85
void userAvatarFetched( const QString &avatarUrl, const QPixmap & pixmap );
86
void fetchAvatarError( const QString &avatarUrl, const QString &errMsg );
87
void missingStatusReceived( Status status );
89
void checkAnchor(const QUrl & url);
90
void baseStatusReceived( Status status );
92
void twitpicImageFetched( const QString &imageUrl, const QPixmap & pixmap );
93
void twitpicImageFailed( const QString &imageUrl, const QString &errMsg );
95
void showUserInformation(const User& user);
97
void slot301Redirected(KIO::Job *job, const KUrl &fromUrl, const KUrl &toUrl);
100
void resizeEvent ( QResizeEvent * event );
101
void enterEvent ( QEvent * event );
102
void leaveEvent ( QEvent * event );
107
static KPushButton * getButton(const QString & objName, const QString & toolTip, const QString & icon);
110
QString prepareStatus( const QString &text );
111
void checkForTwitPicImages(const QString &status);
113
QString generateSign();
116
static QString getColorString(const QColor & color);
119
Status mCurrentStatus;
121
const Account *mCurrentAccount;
127
static const QString baseText;
128
static const QString baseStyle;
129
static QString style;
131
static const QRegExp mUrlRegExp;
132
static const QRegExp mUserRegExp;
133
static const QRegExp mHashtagRegExp;
134
static const QRegExp mGroupRegExp;
136
KPushButton * btnReply,*btnFavorite,*btnRemove, *btnReTweet;
137
bool isBaseStatusShowed;
138
bool isMissingStatusRequested;
139
QString twitpicImageUrl;
140
QString twitpicPageUrl;