1 #ifndef _KVI_CHANNEL_H_
2 #define _KVI_CHANNEL_H_
46 #include <QStringList>
47 #include <QToolButton>
57 #ifdef COMPILE_ON_WINDOWS
69 #define KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT 40
70 #define KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN 600
72 #ifndef KVI_CHANNEL_AVERAGE_USERS
73 #define KVI_CHANNEL_AVERAGE_USERS 101
124 HaveWhoList = (1 << 2),
126 SentWhoRequest = (1 << 4),
128 Synchronized = (1 << 6),
129 NoCloseOnPart = (1 << 7),
130 SentSyncWhoRequest = (1 << 8)
220 if(m_pModeLists.contains(cMode))
221 return m_pModeLists.value(cMode);
310 if(m_pModeLists.contains(cMode))
311 return m_pModeLists.value(cMode)->count();
332 void setModeInList(
char cMode,
const QString & szMask,
bool bAdd,
const QString & szSetBy,
unsigned int uSetAt, QString szChangeMask = QString());
395 m_szSentModeRequests.remove(cMode);
411 m_iStateFlags |= HaveAllNames;
433 m_iStateFlags |= HaveWhoList;
467 void partMessageSent(
bool bCloseOnPart =
true,
bool bShowMessage =
true);
475 virtual bool activityMeter(
unsigned int * puActivityValue,
unsigned int * puActivityTemperature);
514 virtual QSize sizeHint()
const;
531 KviUserListEntry *
join(
const QString & szNick,
const QString & szUser = QString(),
const QString &
szHost = QString(),
int iFlags = 0) {
return m_pUserListView->
join(szNick, szUser,
szHost, iFlags); };
563 bool setOp(
const QString & szNick,
bool bOp,
bool bIsMe);
571 bool setHalfOp(
const QString & szNick,
bool bHalfOp,
bool) {
return m_pUserListView->
setHalfOp(szNick, bHalfOp); };
579 bool setVoice(
const QString & szNick,
bool bVoice,
bool) {
return m_pUserListView->
setVoice(szNick, bVoice); };
587 bool setUserOp(
const QString & szNick,
bool bUserOp,
bool) {
return m_pUserListView->
setUserOp(szNick, bUserOp); };
595 bool isChanOwner(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isChanOwner(szNick, bAtLeast); };
603 bool isChanAdmin(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isChanAdmin(szNick, bAtLeast); };
611 bool isOp(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isOp(szNick, bAtLeast); };
619 bool isHalfOp(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isHalfOp(szNick, bAtLeast); };
627 bool isVoice(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isVoice(szNick, bAtLeast); };
635 bool isUserOp(
const QString & szNick,
bool bAtLeast =
false) {
return m_pUserListView->
isUserOp(szNick, bAtLeast); };
642 bool isMeIrcOp(
bool bAtLeast =
false);
649 bool isMeChanOwner(
bool bAtLeast =
false);
656 bool isMeChanAdmin(
bool bAtLeast =
false);
663 bool isMeOp(
bool bAtLeast =
false);
670 bool isMeHalfOp(
bool bAtLeast =
false);
677 bool isMeVoice(
bool bAtLeast =
false);
684 bool isMeUserOp(
bool bAtLeast =
false);
692 void userAction(
KviIrcMask * user,
unsigned int uActionType);
700 void userAction(
const QString & szNick,
unsigned int uActionType);
710 void userAction(
const QString & szNick,
const QString & szUser,
const QString &
szHost,
unsigned int uActionType);
719 void channelAction(
const QString & szNick,
unsigned int uActionType,
int iTemperature);
727 bool nickChange(
const QString & szOldNick,
const QString & szNewNick);
734 bool part(
const QString & szNick);
741 bool isOn(
const QString & szNick) {
return (m_pUserListView->
findEntry(szNick) != 0); };
760 void updateModeLabel();
768 virtual void outputMessage(
int iMsgType,
const QString & szMsg,
const QDateTime & datetime = QDateTime());
791 void setChannelMode(
char cMode,
bool bAdd);
804 void getChannelModeString(QString &
szBuffer);
811 void getChannelModeStringWithEmbeddedParams(QString &
szBuffer);
819 void setChannelModeWithParam(
char cMode, QString & szParam);
826 bool hasChannelMode(
char cMode) {
return m_szChannelParameterModes.contains(cMode); };
833 QString
channelModeParam(
char cMode)
const {
return m_szChannelParameterModes.value(cMode); };
840 void addHighlightedUser(
const QString & szNick);
847 void removeHighlightedUser(
const QString & szNick);
854 bool isHighlightedUser(
const QString & szNick) {
return m_pTmpHighLighted->contains(szNick, Qt::CaseInsensitive); };
893 QByteArray loadLogFile(
const QString & szFileName,
bool bGzip);
905 void checkChannelSync();
914 bool eventFilter(QObject * pObject, QEvent * pEvent);
990 void showDoubleView(
bool bShow);
996 void fixActionHistory();
1005 void getTalkingUsersStats(QString &
szBuffer, QStringList & list,
bool bPast);
1014 virtual void resizeEvent(QResizeEvent *);
1015 virtual void closeEvent(QCloseEvent * pEvent);
1021 void toggleDoubleView();
1027 void toggleListView();
1033 void toggleListModeEditor();
1039 void toggleModeEditor();
1044 void modeSelectorDone();
1051 void topicSelected(
const QString & szTopic);
1058 void setMode(QString & szMode);
1066 void textViewRightClicked();
1080 void toggleToolButtons();
1087 void opStatusChanged();
1090 #endif //_KVI_CHANNEL_H_
virtual void lostUserFocus()
Definition: KviWindow.cpp:1149
QStringList lTalkingUsers
Definition: KviChannelWindow.h:105
unsigned int uActionsInTheLastMinute
Definition: KviChannelWindow.h:101
A struct which holds the activity stats.
Definition: KviChannelWindow.h:94
Definition: KviMaskEditor.h:42
bool setChanAdmin(const QString &szNick, bool bChanAdmin)
Sets the chan admin mode.
Definition: KviChannelWindow.h:554
Toolkit Abstraction Layer: hbox class.
Definition: KviTalHBox.h:44
KviWindowToolPageButton * m_pModeEditorButton
Definition: KviChannelWindow.h:165
KviPixmap m_privateBackground
Definition: KviChannelWindow.h:178
const QString & nameWithUserFlag()
Returns the name of the channel with user flags.
Definition: KviChannelWindow.h:247
bool setChanOwner(const QString &szNick, bool bChanOwner)
Sets the chan owner mode.
virtual void getConfigGroupName(QString &szBuffer)
Definition: KviWindow.cpp:495
bool isDeadChan()
Returns true if the channel is dead.
Definition: KviChannelWindow.h:487
int userOpCount()
Returns the number of users with userop status.
Definition: KviChannelWindow.h:296
KviUserListEntry * join(const QString &szNick, const QString &szUser=QString(), const QString &szHost=QString(), int iFlags=0)
Called when a user joins the channel.
Definition: KviUserListView.cpp:746
KviUserListView * m_pUserListView
Definition: KviChannelWindow.h:171
QStringList * m_pTmpHighLighted
Definition: KviChannelWindow.h:181
virtual void preprocessMessage(QString &szMessage)
Definition: KviWindow.cpp:1319
bool isChanOwner(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a chan owner.
Definition: KviChannelWindow.h:595
void setSentListRequest(char cMode)
Sets the "sent request" flag for a specific channel mode.
Definition: KviChannelWindow.h:387
bool isChanAdmin(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a chan admin.
Definition: KviChannelWindow.h:603
Definition: KviConsoleWindow.h:75
virtual void saveProperties(KviConfigurationFile *pCfg)
Definition: KviWindow.cpp:562
bool hasInviteList()
Returns true if the channel has an invite list.
Definition: KviChannelWindow.h:419
void setSentWhoRequest()
Sets the WHO request flag.
Definition: KviChannelWindow.h:375
KviTalHBox * m_pButtonContainer
Definition: KviChannelWindow.h:187
#define KVIRC_API
Definition: kvi_settings.h:128
void setHasWhoList()
Sets the existence of the WHO list.
Definition: KviChannelWindow.h:431
kvi_time_t tTime
Definition: KviChannelWindow.h:85
void setHasAllNames()
Sets the existence of all names.
Definition: KviChannelWindow.h:409
bool isOn(const QString &szNick)
Returns true if the user is on the channel.
Definition: KviChannelWindow.h:741
virtual void closeEvent(QCloseEvent *pEvent)
Definition: KviWindow.cpp:858
unsigned int uActionCount
Definition: KviChannelWindow.h:96
int halfOpCount()
Returns the number of users with halfop status.
Definition: KviChannelWindow.h:284
void clearSentSyncWhoRequest()
Clears the sync WHO request flag.
Definition: KviChannelWindow.h:363
bool isHalfOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is an half operator.
User list view management.
void enableUpdates(bool bEnable)
Enables the updates on the view list area.
Definition: KviUserListView.cpp:381
KviUserListEntry * join(const QString &szNick, const QString &szUser=QString(), const QString &szHost=QString(), int iFlags=0)
Called when a user joins the channel.
Definition: KviChannelWindow.h:531
bool isChanAdmin(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a chan admin.
bool setVoice(const QString &szNick, bool bVoice, bool)
Sets the voice mode.
Definition: KviChannelWindow.h:579
int selectedCount()
Returns the number of selected entries in the userlist.
Definition: KviUserListView.h:349
virtual void loadProperties(KviConfigurationFile *pCfg)
Definition: KviWindow.cpp:588
#define l
Definition: detector.cpp:76
bool closeOnPart()
Returns true if the channel has to be closed on part.
Definition: KviChannelWindow.h:459
QString plainChannelMode()
Returns only the plain (parameter-less) channel modes (eg: mi)
Definition: KviChannelWindow.h:797
unsigned int maskCount(char cMode)
Returns the number of masks is a channel mode list.
Definition: KviChannelWindow.h:308
QString * firstSelectedNickname()
Returns the first selected nickname in the list.
Definition: KviUserListView.cpp:1073
int opCount()
Returns the number of operators.
Definition: KviUserListView.h:373
bool isVoice(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a voice.
void setLastReceivedWhoReply(kvi_time_t tTime)
Sets the time of the last received WHO reply.
Definition: KviChannelWindow.h:345
QMap< char, KviWindowToolPageButton * > m_pListEditorButtons
Definition: KviChannelWindow.h:166
Definition: KviConfigurationFile.h:48
KviModeWidget * m_pModeWidget
Definition: KviChannelWindow.h:172
bool isUserOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a user operator.
Definition: KviChannelWindow.h:635
ActivityLimit
Holds the limits of the activity in a channel.
Definition: KviChannelWindow.h:137
unsigned int count()
Returns the number of the entries in the userlist.
Definition: KviUserListView.h:343
unsigned int uHotActionCount
Definition: KviChannelWindow.h:103
KviIrcView * messageView() const
Returns the irc view object.
Definition: KviChannelWindow.h:206
KviPointerList< KviMaskEntry > * modeMasks(char cMode)
Returns a list of masks for a specific mode.
Definition: KviChannelWindow.h:218
bool bStatsInaccurate
Definition: KviChannelWindow.h:97
virtual const QString & target()
Returns the name of the channel.
Definition: KviChannelWindow.h:241
bool hasQuietBanList()
Returns true if the channel has a quiet ban list.
Definition: KviChannelWindow.h:453
KviTopicWidget * m_pTopicWidget
Definition: KviChannelWindow.h:170
virtual bool activityMeter(unsigned int *puActivityValue, unsigned int *puActivityTemperature)
Definition: KviWindow.cpp:278
QString * firstSelectedNickname()
Returns the first selected nickname in the userlist.
Definition: KviChannelWindow.h:229
KviModeEditor * m_pModeEditor
Definition: KviChannelWindow.h:168
bool setChanAdmin(const QString &szNick, bool bChanAdmin)
Sets the chan admin mode.
QMap< char, KviMaskEditor * > m_pListEditors
Definition: KviChannelWindow.h:167
bool isHighlightedUser(const QString &szNick)
Returns true if the user is highlighted.
Definition: KviChannelWindow.h:854
bool sentWhoRequest()
Returns true if we have sent the WHO request.
Definition: KviChannelWindow.h:369
#define kvi_time_t
Definition: KviTimeUtils.h:43
KviPointerList< KviChannelAction > * m_pActionHistory
Definition: KviChannelWindow.h:183
const QString & windowName()
Returns the name of this window.
Definition: KviWindow.h:228
bool setUserOp(const QString &szNick, bool bUserOp, bool)
Sets the user operator mode.
Definition: KviChannelWindow.h:587
QList< int > m_SplitterSizesList
Definition: KviChannelWindow.h:186
QStringList lWereTalkingUsers
Definition: KviChannelWindow.h:106
Irc user mask handling.
Definition: KviIrcMask.h:45
char getUserFlag(KviUserListEntry *pEntry)
Returns the flags of a user.
Definition: KviUserListView.cpp:1006
bool sentSyncWhoRequest()
Returns true if we have sent the sync WHO request.
Definition: KviChannelWindow.h:351
unsigned int uFirstActionTimeSpan
Definition: KviChannelWindow.h:99
QString m_szSentModeRequests
Definition: KviChannelWindow.h:174
bool isHalfOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a half operator.
Definition: KviChannelWindow.h:619
QString * nextSelectedNickname()
Returns the next selected nickname in the userlist.
Definition: KviChannelWindow.h:235
QMap< char, QString > m_szChannelParameterModes
Definition: KviChannelWindow.h:176
QToolButton * m_pDoubleViewButton
Definition: KviChannelWindow.h:163
void setSentSyncWhoRequest()
Sets the sync WHO request flag.
Definition: KviChannelWindow.h:357
Definition: KviPixmap.h:33
virtual QPixmap * myIconPtr()
Definition: KviWindow.cpp:619
KviWindowToolPageButton * m_pListViewButton
Definition: KviChannelWindow.h:164
int userOpCount()
Returns the number of user operators.
Definition: KviUserListView.h:391
KviUserListEntry * findEntry(const QString &szNick)
Searches an entry in the userlist.
Definition: KviUserListView.h:400
QString szHost
Definition: libkvisetup.cpp:45
virtual void applyOptions()
Definition: KviWindow.cpp:1129
void prependUserFlag(const QString &szNick, QString &szBuffer)
Prepends the user flag to the nickname.
Definition: KviChannelWindow.h:501
bool avatarChanged(const QString &szNick)
Returns true if the avatar of a user is changed.
Definition: KviChannelWindow.h:538
virtual void ownMessage(const QString &, bool=true)
Definition: KviWindow.h:380
StateFlag
Holds the state flags of the channel.
Definition: KviChannelWindow.h:121
unsigned int uLastActionTimeSpan
Definition: KviChannelWindow.h:98
bool setChanOwner(const QString &szNick, bool bChanOwner)
Sets the chan owner mode.
Definition: KviChannelWindow.h:546
void setListRequestDone(char cMode)
Clears the "sent request" flag for a specific chanel mode.
Definition: KviChannelWindow.h:393
bool hasBanExceptionList()
Returns true if the channel has a ban exception list.
Definition: KviChannelWindow.h:447
virtual void fillCaptionBuffers()
Definition: KviWindow.cpp:624
Definition: KviWindowToolWidget.h:47
bool isVoice(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a voice.
Definition: KviChannelWindow.h:627
Definition: KviIrcConnectionServerInfo.h:296
virtual void triggerCreationEvents()
Definition: KviWindow.h:437
kvi_time_t lastReceivedWhoReply()
Returns the time of the last received WHO reply.
Definition: KviChannelWindow.h:338
bool isOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is an operator.
Definition: KviChannelWindow.h:611
Definition: KviIrcView.h:57
KviTalSplitter * m_pVertSplitter
Definition: KviChannelWindow.h:162
Definition: KviModeEditor.h:45
bool isOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is an operator.
bool setHalfOp(const QString &szNick, bool bHalfOp)
Sets the half operator mode.
KviTalSplitter * m_pTopSplitter
Definition: KviChannelWindow.h:161
virtual void getWindowListTipText(QString &szBuffer)
Definition: KviWindow.h:348
virtual void ownAction(const QString &)
Definition: KviWindow.h:381
int m_iStateFlags
Definition: KviChannelWindow.h:173
int chanOwnerCount()
Returns the number of users with chanowner status.
Definition: KviChannelWindow.h:266
bool eventFilter(QObject *pObject, QEvent *pEvent)
Definition: KviWindow.cpp:999
int iTemperature
Definition: KviChannelWindow.h:86
void unhighlight()
Definition: KviWindow.cpp:1312
QString channelModeParam(char cMode) const
Returns the value (parameter) for a channel mode (eg. the password for mode k)
Definition: KviChannelWindow.h:833
QString szNick
Definition: KviChannelWindow.h:83
int opCount()
Returns the number of users with op status.
Definition: KviChannelWindow.h:278
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
A template double linked list of pointers.
Definition: KviPointerList.h:55
Definition: KviMaskEditor.h:95
QString * nextSelectedNickname()
Returns the next selected nickname in the list.
Definition: KviUserListView.cpp:1089
bool setUserOp(const QString &szNick, bool bUserOp)
Sets the user operator mode.
KviUserListEntry * findEntry(const QString &szNick)
Searches for a user in the userlist.
Definition: KviChannelWindow.h:748
int halfOpCount()
Returns the number of half operators.
Definition: KviUserListView.h:379
int chanAdminCount()
Returns the number of chan admins.
Definition: KviUserListView.h:367
bool avatarChanged(const QString &szNick)
Returns true if the avatar of a user is changed.
Definition: KviUserListView.cpp:801
bool isChanOwner(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a chan owner.
int selectedCount()
Returns the number of selected users.
Definition: KviChannelWindow.h:260
A struct which holds the channel actions.
Definition: KviChannelWindow.h:81
double dActionsPerMinute
Definition: KviChannelWindow.h:100
Definition: KviThemedLabel.h:33
kvi_time_t m_tLastReceivedWhoReply
Definition: KviChannelWindow.h:184
int iAverageActionTemperature
Definition: KviChannelWindow.h:102
bool setVoice(const QString &szNick, bool bVoice)
Sets the voice mode.
unsigned int count()
Returns the number of users.
Definition: KviChannelWindow.h:302
#define KviTalSplitter
Definition: KviTalSplitter.h:35
Contains the KviWindow class.
virtual void getBaseLogFileName(QString &szBuffer)
Definition: KviWindow.cpp:557
bool isUserOp(const QString &szNick, bool bAtLeast=false)
Returns true if the user is a user operator.
void prependUserFlag(const QString &szNick, QString &szBuffer)
Prepends the user flags before the nickname.
Definition: KviUserListView.cpp:1014
KviTopicWidget * topicWidget()
Returns the topic widget object.
Definition: KviChannelWindow.h:200
char szBuffer[4096]
Definition: winamp.cpp:77
unsigned int uHotActionPercent
Definition: KviChannelWindow.h:104
unsigned int m_uActionHistoryHotActionCount
Definition: KviChannelWindow.h:182
void enableUserListUpdates(bool bEnable)
Enables or disable the userlist updates.
Definition: KviChannelWindow.h:521
char getUserFlag(const QString &szNick)
Returns the flag of a user.
Definition: KviChannelWindow.h:508
struct _KviChannelActivityStats KviChannelActivityStats
This file contains compile time settings.
QFrame * buttonContainer()
Returns the button container object.
Definition: KviChannelWindow.h:212
KviIrcView * m_pMessageView
Definition: KviChannelWindow.h:169
KviUserListView * userListView()
Returns the user listview object.
Definition: KviChannelWindow.h:194
QList< int > m_VertSplitterSizesList
Definition: KviChannelWindow.h:185
int chanOwnerCount()
Returns the number of chan owners.
Definition: KviUserListView.h:361
bool setHalfOp(const QString &szNick, bool bHalfOp, bool)
Sets the half operator mode.
Definition: KviChannelWindow.h:571
QDateTime m_joinTime
Definition: KviChannelWindow.h:179
User list view management class.
Definition: KviUserListView.h:226
struct _KviChannelAction KviChannelAction
bool sentListRequest(char cMode)
Returns true if we have sent a list request for a specific channel mode.
Definition: KviChannelWindow.h:381
QString m_szChannelMode
Definition: KviChannelWindow.h:175
int voiceCount()
Returns the number of users with voice status.
Definition: KviChannelWindow.h:290
int voiceCount()
Returns the number of voices.
Definition: KviUserListView.h:385
Userlist entry management class.
Definition: KviUserListView.h:134
int chanAdminCount()
Returns the number of users with chanadmin status.
Definition: KviChannelWindow.h:272
unsigned int uActionType
Definition: KviChannelWindow.h:84
bool hasBanList()
Returns true if the channel has a ban list.
Definition: KviChannelWindow.h:441
QString m_szNameWithUserFlag
Definition: KviChannelWindow.h:180
bool hasChannelMode(char cMode)
Returns true if the channel has a mode with parameter set (eg. mode k)
Definition: KviChannelWindow.h:826
The class which manages a channel.
Definition: KviChannelWindow.h:113
QMap< char, KviPointerList< KviMaskEntry > * > m_pModeLists
Definition: KviChannelWindow.h:177
bool hasWhoList()
Returns true if the channel has a WHO list.
Definition: KviChannelWindow.h:425
bool hasAllNames()
Returns true if the channel has all names.
Definition: KviChannelWindow.h:403