knode
kngroupbrowser.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef KNGROUPBROWSER_H
00016 #define KNGROUPBROWSER_H
00017
00018 #include <q3listview.h>
00019
00020 #include <QIcon>
00021 #include <QPixmap>
00022 #include <QLabel>
00023 #include <QGridLayout>
00024
00025 #include <kdialog.h>
00026
00027 #include "kngroupmanager.h"
00028
00029 class KLineEdit;
00030 class QCheckBox;
00031 class QLabel;
00032 class QGridLayout;
00033
00034 class KNNntpAccount;
00035
00036
00038 class KNGroupBrowser : public KDialog {
00039
00040 Q_OBJECT
00041
00042 public:
00044 class CheckItem : public Q3CheckListItem {
00045
00046 public:
00047 CheckItem(Q3ListView *v, const KNGroupInfo &gi, KNGroupBrowser *b);
00048 CheckItem(Q3ListViewItem *i, const KNGroupInfo &gi, KNGroupBrowser *b);
00049 ~CheckItem();
00050 void setChecked(bool c);
00051
00052 KNGroupInfo info;
00053
00054 protected:
00055 void stateChange(bool s);
00056 KNGroupBrowser *browser;
00057 };
00058
00060 class GroupItem : public Q3ListViewItem {
00061
00062 public:
00063 GroupItem(Q3ListView *v, const KNGroupInfo &gi);
00064 GroupItem(Q3ListViewItem *i, const KNGroupInfo &gi);
00065 ~GroupItem();
00066
00067 KNGroupInfo info;
00068 };
00069
00070 KNGroupBrowser( QWidget *parent, const QString &caption, KNNntpAccount *a, ButtonCodes buttons = 0,
00071 bool newCBact = false, const QString &user1 = QString(), const QString &user2 = QString() );
00072 ~KNGroupBrowser();
00073
00074 KNNntpAccount* account()const { return a_ccount; }
00075 virtual void itemChangedState(CheckItem *it, bool s)=0;
00076
00077 public slots:
00078 void slotReceiveList(KNGroupListData* d);
00079
00080 signals:
00081 void loadList(KNNntpAccount *a);
00082
00083 protected:
00084 virtual void updateItemState(CheckItem *it)=0;
00085 void changeItemState(const KNGroupInfo &gi, bool s);
00086 bool itemInListView(Q3ListView *view, const KNGroupInfo &gi);
00087 void removeListItem(Q3ListView *view, const KNGroupInfo &gi);
00088 void createListItems(Q3ListViewItem *parent=0);
00089
00090 QWidget *page;
00091 Q3ListView *groupView;
00092 int delayedCenter;
00093 KLineEdit *filterEdit;
00094 QCheckBox *noTreeCB, *subCB, *newCB;
00095 QPushButton *arrowBtn1, *arrowBtn2;
00096 QPixmap pmGroup, pmNew;
00097 QIcon pmRight, pmLeft;
00098 QGridLayout *listL;
00099 QLabel *leftLabel, *rightLabel;
00100 QTimer *refilterTimer;
00101 QString lastFilter;
00102 bool incrementalFilter;
00103
00104 KNNntpAccount *a_ccount;
00105 QList<KNGroupInfo> *allList, *matchList;
00106
00107 protected slots:
00108 void slotLoadList();
00109 void slotItemExpand(Q3ListViewItem *it);
00110 void slotCenterDelayed();
00112 void slotItemDoubleClicked(Q3ListViewItem *it);
00113 void slotFilter(const QString &txt);
00114 void slotTreeCBToggled();
00115 void slotSubCBToggled();
00116 void slotNewCBToggled();
00117 void slotFilterTextChanged(const QString &txt);
00118 void slotRefilter();
00119
00120 };
00121
00122 #endif