Changed daemon to search both people and companies instead of only people. Tuned...
[jenirok] / src / common / source.h
index 34cd356..573563f 100644 (file)
@@ -23,6 +23,7 @@
 #include <QtCore/QString>
 #include <QtCore/QTimerEvent>
 #include <QtCore/QUrl>
+#include <QtCore/QByteArray>
 #include <QtNetwork/QHttp>
 
 class Source : public QObject
@@ -40,7 +41,7 @@ public:
         QString number;
     };
 
-    enum SearchType {YELLOW_PAGES, PERSONS};
+    enum SearchType {YELLOW_PAGES, PERSONS, BOTH};
 
     struct SearchDetails
     {
@@ -91,9 +92,10 @@ signals:
 protected:
     void setError(Error error, QString const& errorString = "");
     virtual void timerEvent(QTimerEvent *te);
-    QString ucFirst(QString& string);
-    QString& cleanUpNumber(QString& number);
-    QString& stripTags(QString& string);
+    static QString ucFirst(QString& string);
+    static QString& cleanUpNumber(QString& number);
+    static QString& stripTags(QString& string);
+    static QString& htmlEntityDecode(QString& string);
     void fixUrl(QUrl& url);
     QHttp http_;
 
@@ -102,7 +104,7 @@ private slots:
 
 private:
     Q_DISABLE_COPY(Source);
-    virtual void handleHttpData(int id, QString const& data) = 0;
+    virtual void handleHttpData(int id, QByteArray const& data) = 0;
     virtual void handleHttpError(int id) = 0;
     unsigned int maxResults_;
     unsigned int timeout_;