00001 /* 00002 Copyright 2010 Ulrich Weigelt <ulrich.weigelt@gmx.de> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef KSHOWMAILVIEW_H 00019 #define KSHOWMAILVIEW_H 00020 00021 class AccountViewModel; 00022 00023 //Qt headers 00024 #include <qsplitter.h> 00025 #include <QTreeView> 00026 #include <QModelIndexList> 00027 #include <QItemSelectionModel> 00028 #include <QHeaderView> 00029 00030 //KDE headers 00031 #include <KAction> 00032 #include <KConfigGroup> 00033 00034 //KShowmail headers 00035 #include "accountviewmodel.h" 00036 #include "mailviewmodel.h" 00037 #include "accountviewdelegate.h" 00038 #include "constants.h" 00039 00045 class KShowmailView : public QSplitter 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 00059 KShowmailView( AccountViewModel* accountModel, MailViewModel* mailModel, QItemSelectionModel* mailSelectModel, QItemSelectionModel* accountSelectModel, QWidget* parent = 0 ); 00060 00064 ~KShowmailView(); 00065 00070 void refreshViews( QItemSelectionModel* mailSelectModel ); 00071 00075 void saveSetup(); 00076 00080 void loadSetup(); 00081 00086 void addActionToAccountList( KAction* action ); 00087 00092 void addActionToMailList( KAction* action ); 00093 00094 private: 00095 00099 QTreeView* viewAccounts; 00100 00104 QTreeView* viewMails; 00105 00109 MailViewModel* mailModel; 00110 00114 AccountViewModel* accountModel; 00115 00119 QSplitter* splitter; 00120 00121 protected slots: 00122 00128 void slotMailDoubleClicked( const QModelIndex& ); 00129 00130 signals: 00131 00136 void sigMailDoubleClicked(); 00137 }; 00138 00139 #endif // KSHOWMAILVIEW_H