X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffeedswindow.h;fp=src%2Ffeedswindow.h;h=4c0fb0c7b6e7ac04b65c9ec5b65c0254f0b8aab4;hb=7f1f955b572af3ed84cf079fdd9cee4626db010a;hp=0000000000000000000000000000000000000000;hpb=7dce24304bbca9ff6639fa212183c6cc6c203a26;p=grr diff --git a/src/feedswindow.h b/src/feedswindow.h new file mode 100644 index 0000000..4c0fb0c --- /dev/null +++ b/src/feedswindow.h @@ -0,0 +1,94 @@ +#ifndef _WINDOW_H +#define _WINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "googlereader.h" + +class FeedsWindow : public QMainWindow { + Q_OBJECT + + public: + FeedsWindow(QWidget *parent = 0); + virtual ~FeedsWindow(); + + private slots: + void showUpdated(bool); + void showSettings(); + void sync(); + void feedsUpdated(); + void feedSelected(const QModelIndex &); + void refreshModel(); + void loginFailed(QString); + void about(); + + private: + QListView *list; + GoogleReader *reader; + QAction *show_all; + QAction *show_updated; + QSettings *settings; +}; + +class FeedListModel : public QAbstractListModel { + Q_OBJECT + + public: + FeedListModel(QObject *parent = 0, QListlist = QList(), bool updated = false) + : QAbstractListModel(parent) { + feed_list = list; + show_updated = updated; + } + + int rowCount(const QModelIndex &model = QModelIndex()) const; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + + public slots: + void showUpdated(bool); + + private: + QList feed_list; + bool show_updated; +}; + +class FeedListDelegate : public QStyledItemDelegate { + Q_OBJECT + + public: + FeedListDelegate(QObject *parent = 0) + : QStyledItemDelegate(parent) {}; + + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const; +}; + +class SettingsDialog : public QDialog { + Q_OBJECT + + public: + SettingsDialog(QWidget *parent = 0, QSettings *s = 0); + + public slots: + void accept(); + + private: + QLabel *loginLabel; + QLineEdit *loginEdit; + QLabel *passwdLabel; + QLineEdit *passwdEdit; + QDialogButtonBox *buttonBox; + QPushButton *saveButton; + QPushButton *cancelButton; + QSettings *settings; +}; + +#endif +