Switched to Google's new authentication method.
[grr] / src / googlereader.h
index 24cad09..360f7dd 100644 (file)
@@ -4,7 +4,6 @@
 #include <QObject>
 #include <QNetworkReply>
 #include <QNetworkRequest>
-#include <QDomDocument>
 #include <QBuffer>
 #include <QDateTime>
 
@@ -28,25 +27,26 @@ class Feed : public QObject {
                uint newestitem;
                
                QString continuation;
+               uint updated;
 
                QDateTime lastUpdated;
 
                GoogleReader *reader;
 
-               bool special;
+               int special;
 
                void updateSubscription(Feed *feed);
 
                Feed(GoogleReader *gr = NULL) : QObject() {
                        unread = 0;
                        reader = gr;
-                       special = false;
+                       special = 0;
+                       updated = 0;
                }
 
                void fetch(bool);
                void addEntry(Entry *);
                void delEntry(Entry *);
-               void signalUpdated(); // TODO: Clean this up...
                QList<Entry *> getEntries();
                int getEntriesSize() { return entries.size(); }
                void markRead();
@@ -59,6 +59,10 @@ class Feed : public QObject {
        private:
                QHash<QString, Entry *> entries;
                QBuffer buffer;
+               QNetworkReply *reply;
+
+       private slots:
+               void fetchFinished();
 };
     
 Q_DECLARE_METATYPE(Feed *)
@@ -66,6 +70,7 @@ Q_DECLARE_METATYPE(Feed *)
 #define ENTRY_FLAG_READ                0x00000001
 #define ENTRY_FLAG_STARRED     0x00000002
 #define ENTRY_FLAG_LOCKED      0x00000004
+#define ENTRY_FLAG_SHARED      0x00000008
 
 class Entry : public QObject {
        Q_OBJECT
@@ -101,10 +106,12 @@ class Entry : public QObject {
 
                void markRead(bool);
                void markStar(bool);
+               void markShared(bool);
 
        private:
                QBuffer postread;
                QBuffer poststar;
+               QBuffer postshared;
 };
 
 Q_DECLARE_METATYPE(Entry *)
@@ -132,27 +139,30 @@ class GoogleReader: public QObject {
                void setLogin(QString l) { login = l; }
                void setPasswd(QString p) { passwd = p; }
                void logOut() { 
-                       SID = NULL; 
+                       auth = NULL;
                        token = NULL;
                        updateSubscriptionsPending = false;
                        updateUnreadPending = false;
-                       SIDPending = false;
+                       authPending = false;
+               }
+
+               QByteArray getAuth() {
+                       return auth;
                }
 
        private slots:
                void downloadFinished(QNetworkReply *reply);
 
        private:
-               char *SID;
+               QByteArray auth;
                QBuffer buffer;
                bool updateSubscriptionsPending;
                bool updateUnreadPending;
-               bool SIDPending;
+               bool authPending;
 
-               void getSID();
-               void parseSubscriptions(QDomDocument dom);
-               void parseUnread(QDomDocument dom);
-               void parseFeed(QDomDocument dom);
+               void clientLogin();
+               void parseSubscriptions(QByteArray data);
+               void parseUnread(QByteArray data);
 
                QUrl login_url;
                QUrl subscriptions_url;