Splashscreen ad support. Wait dialog for ad click/browser start.
[qtmads] / src / qtmadsadwidget.h
index 1dc1b2f..2a7fa35 100644 (file)
@@ -36,6 +36,7 @@ class QLabel;
 class QBoxLayout;
 class QWebView;
 class QTimer;
+class QMessageBox;
 
 enum AdType{
        anyAd = 1,
@@ -72,6 +73,7 @@ public:
     ~QtmadsAdWidget();
 
     void startAd(quint32 adChangeIntervalInSecs = 0);
+    void startSingleShotAd(quint32 durationInSecs);
 
     //TODO: default getAdAsHash()?
     virtual void getAdAsHash(QHash<QString, QVariant> &adParams) = 0;
@@ -82,20 +84,25 @@ protected:
     AdType adType();
 
 private:
-    bool loadPlugin(QString serviceName);
+    bool loadServicePlugin(QString serviceName);
 
 public slots:
     void getNewAd();
+    virtual void clearAd() = 0;
+    void timerEvent(QTimerEvent */*event*/);
 
+private slots:
     void adRequestSucceeded(QHash<QString, QVariant> &ad);
        void adRequestFailed();
 
     void adClicked(const QUrl &url = QUrl());
-    virtual void clearAd() = 0;
+
+    void singleShotEnded();
 
 signals:
     void newAdReady();
     void newAdFailed();
+    void adStopped();
 
 protected:
 
@@ -108,6 +115,8 @@ protected:
 private:
     QTimer *adTimer;
 
+    QMessageBox *msgBox;
+
        quint32 adClickedAmount;
 
        //TODO: shown on screen