folderlistview.h

来自「Qtopia下的邮件处理程序」· C头文件 代码 · 共 159 行

H
159 行
字号
/******************************************************************************** Copyright (C) 2000-2006 TROLLTECH ASA. All rights reserved.**** This file is part of the Phone Edition of the Qtopia Toolkit.**** Licensees holding a valid license agreement from Trolltech or any of its** authorized distributors may use this file in accordance with** the License Agreement provided with the Licensed Software.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Trolltech's Commercial License Agreements.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.********** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#ifndef FOLDERLISTVIEW_H#define FOLDERLISTVIEW_H#include <qsettings.h>#include "account.h"#include "search.h"#include "folder.h"#include <qtreewidget.h>#include <qtimer.h>#include <qmenubar.h>#include <qmenu.h>#include <qwidget.h>#include <qlineedit.h>#include <qitemdelegate.h>class AccountList;class MailboxList;class FolderListItem : public QTreeWidgetItem{public:    FolderListItem(QTreeWidget *parent, Folder *in);    FolderListItem(QTreeWidgetItem *parent, Folder *in);    Folder* folder();    void setStatusText( const QString &str, bool highlight, const QColor &col );    void statusText( QString *str, bool *highlight, QColor *col );    int depth();protected:#ifdef QTOPIA4_TODO    void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );    int width( const QFontMetrics& fm,  const QTreeWidget* lv, int c ) const;#endif    QString key(int c, bool) const;private:    Folder *_folder;    QString _statusText;    bool _highlight;    QColor _col;};class FolderListView : public QTreeWidget{    Q_OBJECTpublic:    FolderListView(MailboxList *list, QWidget *parent, const char *name);    virtual ~FolderListView();    QMenu* folderParentMenu(QMenuBar *host);    void showFolderChoice(FolderListItem *);    void setupFolders(AccountList *list);    QModelIndex next(QModelIndex mi, bool nextParent = false);    QTreeWidgetItem* next(QTreeWidgetItem *item);    void updateAccountFolder(MailAccount *account);    void deleteAccountFolder(MailAccount *account);    Folder* currentFolder();    MailAccount* currentAccount();    void changeToSystemFolder(const QString &str);    void updateFolderStatus(const QString &mailbox, const QString &txt, bool highlight, const QColor &col = Qt::blue);    void updateAccountStatus(const Folder *account, const QString &txt, bool highlight, const QColor &col = Qt::blue);    void setLastSearch(Search *search);    Search *lastSearch();    void saveQueries(QString mainGroup, QSettings *config);    void readQueries(QString mainGroup, QSettings *config);    QSize sizeHint() const;    QSize minimumSizeHint() const;    FolderListItem *folderItemFromIndex( QModelIndex index );signals:    void emptyFolder();    void folderSelected(Folder *);    void viewMessageList();public slots:    void newQuery();    void modifyQuery();    void deleteFolder();    void showFolderMenu();    void popFolderSelected(int);protected slots:    virtual void keyPressEvent( QKeyEvent *e );    void folderChanged(QTreeWidgetItem *);    void cancelMenuTimer();    void itemClicked(QTreeWidgetItem *);    void mousePressEvent( QMouseEvent * e );    void mouseReleaseEvent( QMouseEvent * e );private:    bool selectedChildOf(FolderListItem *folder);    void buildImapFolder(FolderListItem* item, MailAccount* account);    void saveSingleQuery(QSettings *config, Folder *folder);    Search* readSingleQuery(QSettings *config);    FolderListItem* getParent(FolderListItem *parent, QString name, QString delimiter);private:    QTimer menuTimer;    FolderListItem *itemToRename;    QMenu *folderBar;    QAction *newQueryAction, *modifyQueryAction, *deleteFolderAction;    SystemFolder *searchFolder;    MailboxList *_mailboxList;};class FolderListItemDelegate : public QItemDelegate{    Q_OBJECTpublic:    FolderListItemDelegate(FolderListView *parent = 0);    void paint(QPainter *painter, const QStyleOptionViewItem &option,               const QModelIndex &index) const;private:    FolderListView *mParent;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?