From 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmpopfiltercnfrmdlg.h | 111 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 kmail/kmpopfiltercnfrmdlg.h (limited to 'kmail/kmpopfiltercnfrmdlg.h') diff --git a/kmail/kmpopfiltercnfrmdlg.h b/kmail/kmpopfiltercnfrmdlg.h new file mode 100644 index 00000000..745fdcdd --- /dev/null +++ b/kmail/kmpopfiltercnfrmdlg.h @@ -0,0 +1,111 @@ +/*************************************************************************** + kmpopheadersdlg.h - description + ------------------- + begin : Sat Nov 3 2001 + copyright : (C) 2001 by Heiko Hund + email : heiko@ist.eigentlich.net + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KMPOPHEADERSDLG_H +#define KMPOPHEADERSDLG_H + +#include "kmpopheaders.h" + +#include +#include + +#include +#include + +class QWidget; +class QString; + +class KMPopFilterCnfrmDlg; +/** + * @author Heiko Hund + */ +class KMPopHeadersView : public KListView +{ + Q_OBJECT + +public: + KMPopHeadersView(QWidget *aParent=0, KMPopFilterCnfrmDlg *aDialog=0); + ~KMPopHeadersView(); + static const KMPopFilterAction mapToAction(int aColumn) { return (KMPopFilterAction)aColumn;}; + static const int mapToColumn(KMPopFilterAction aAction) { return (int)aAction;}; + static const char *mUnchecked[26]; + static const char *mChecked[26]; +protected: + static const char *mLater[25]; + static const char *mDown[20]; + static const char *mDel[19]; + void keyPressEvent( QKeyEvent *k); + +protected slots: // Protected slots + void slotPressed(QListViewItem* aItem, const QPoint& aPoint, int aColumn); + +private: + KMPopFilterCnfrmDlg *mDialog; +}; + + + +class KMPopHeadersViewItem : public KListViewItem +{ +public: + KMPopHeadersViewItem(KMPopHeadersView *aParent, KMPopFilterAction aAction); + ~KMPopHeadersViewItem(); + void setAction(KMPopFilterAction aAction); + KMPopFilterAction action() { return mAction; }; + virtual void paintFocus(QPainter *, const QColorGroup & cg, const QRect &r); + virtual QString key(int col, bool ascending) const; +protected: + KMPopHeadersView *mParent; + KMPopFilterAction mAction; +}; + + +class KMPopFilterCnfrmDlg : public KDialogBase +{ + friend class ::KMPopHeadersView; + Q_OBJECT +protected: + KMPopFilterCnfrmDlg() { }; + QMap mItemMap; + QPtrList mDelList; + QPtrList mDDLList; + KMPopHeadersView *mFilteredHeaders; + bool mLowerBoxVisible; + bool mShowLaterMsgs; + void setupLVI(KMPopHeadersViewItem *lvi, KMMessage *msg); + + +public: + KMPopFilterCnfrmDlg(QPtrList *aHeaders, const QString &aAccount, bool aShowLaterMsgs = false, QWidget *aParent=0, const char *aName=0); + ~KMPopFilterCnfrmDlg(); + +public: + void setAction(QListViewItem *aItem, KMPopFilterAction aAction); + +protected slots: // Protected slots + /** + This Slot is called whenever a ListView item was pressed. + It checks for the column the button was pressed in and changes the action if the + click happened over a radio button column. + Of course the radio button state is changed as well if the above is true. +*/ + void slotPressed(QListViewItem *aItem, const QPoint &aPnt, int aColumn); + void slotToggled(bool aOn); + void slotUpdateMinimumSize(); +}; + +#endif -- cgit v1.2.3