khtml_pagecache.h

00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2000  Waldo Bastian <bastian@kde.org>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef __khtml_pagecache_h__
00021 #define __khtml_pagecache_h__
00022 
00023 #include <qobject.h>
00024 #include <qcstring.h>
00025 #include <qvaluelist.h>
00026 #include <qptrlist.h>
00027 
00028 class KHTMLPageCachePrivate;
00029 
00041 class KHTMLPageCache : public QObject
00042 {
00043   Q_OBJECT
00044 public:
00050   static KHTMLPageCache *self();
00051   ~KHTMLPageCache();
00052   
00058   long createCacheEntry();
00059 
00063   void addData(long id, const QByteArray &data);
00064 
00069   void endData(long id);
00070 
00074   void cancelEntry(long id);
00075 
00081   bool isValid(long id);
00082 
00087   bool isComplete(long id);
00088   
00093   void fetchData(long id, QObject *recvObj, const char *recvSlot);
00094 
00098   void cancelFetch(QObject *recvObj);
00099 
00103   void saveData(long id, QDataStream *str);
00104 
00105 private slots:
00106   void sendData();
00107 
00108 private:  
00109   KHTMLPageCache();
00110 
00111   static KHTMLPageCache *_self;
00112 
00113   KHTMLPageCachePrivate *d;  
00114 };
00115 
00116 class KHTMLPageCacheDelivery : public QObject
00117 {
00118    friend class KHTMLPageCache;
00119 Q_OBJECT
00120 public:
00121    KHTMLPageCacheDelivery(int _fd)
00122     : fd(_fd) { }
00123    ~KHTMLPageCacheDelivery();
00124 
00125 signals:
00126    void emitData(const QByteArray &data);
00127 
00128 public: 
00129    QObject *recvObj;
00130    int fd;      
00131 };
00132 
00133 
00134 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys