KHtml

kmultipart.h
1 /* This file is part of the KDE project
2  Copyright (C) 2002 David Faure <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __kmultipart_h__
21 #define __kmultipart_h__
22 
23 #include <QPointer>
24 
25 #include <kparts/part.h>
26 #include <kparts/browserextension.h>
27 #include <QDate>
28 #include <QElapsedTimer>
29 
30 class HTTPFilterGZip;
31 class QTemporaryFile;
32 class QTimer;
33 class KLineParser;
34 
35 /**
36  * http://wp.netscape.com/assist/net_sites/pushpull.html
37  */
39 {
40  Q_OBJECT
41 public:
42  KMultiPart(QWidget *parentWidget,
43  QObject *parent, const QVariantList &);
44  virtual ~KMultiPart();
45 
46  bool openFile() override
47  {
48  return false;
49  }
50  bool openUrl(const QUrl &url) override;
51 
52  bool closeUrl() override;
53 
54 protected:
55  void guiActivateEvent(KParts::GUIActivateEvent *e) override;
56  void setPart(const QString &mimeType);
57 
58  void startOfData();
59  void sendData(const QByteArray &line);
60  void endOfData();
61 
62 private Q_SLOTS:
63  void reallySendData(const QByteArray &line);
64  //void slotPopupMenu( KXMLGUIClient *cl, const QPoint &pos, const QUrl &u, const QString &mime, mode_t mode );
65  void slotJobFinished(KJob *job);
66  void slotData(KIO::Job *, const QByteArray &);
67  //void updateWindowCaption();
68 
69  void slotPartCompleted();
70 
71  void startHeader();
72 
73  void slotProgressInfo();
74 
75 private:
76  KParts::BrowserExtension *m_extension;
78  bool m_isHTMLPart;
79  bool m_partIsLoading;
80  KIO::Job *m_job;
81  QByteArray m_boundary;
82  int m_boundaryLength;
83  QString m_mimeType; // the one handled by m_part - store the kservice instead?
84  QString m_nextMimeType; // while parsing headers
85  QTemporaryFile *m_tempFile;
86  KLineParser *m_lineParser;
87  bool m_bParsingHeader;
88  bool m_bGotAnyHeader;
89  bool m_gzip;
90  HTTPFilterGZip *m_filter;
91  // Speed measurements
92  long m_totalNumberOfFrames;
93  long m_numberOfFrames;
94  long m_numberOfFramesSkipped;
95  QElapsedTimer m_qtime;
96  QTimer *m_timer;
97 };
98 
99 #if 0
100 class KMultiPartBrowserExtension : public KParts::BrowserExtension
101 {
102  //Q_OBJECT
103 public:
104  KMultiPartBrowserExtension(KMultiPart *parent, const char *name = 0);
105 
106  virtual int xOffset();
107  virtual int yOffset();
108 
109 //protected Q_SLOTS:
110  void print();
111  void reparseConfiguration();
112 
113 private:
114  KMultiPart *m_imgPart;
115 };
116 #endif
117 
118 #endif
http://wp.netscape.com/assist/net_sites/pushpull.html
Definition: kmultipart.h:38
Q_OBJECTQ_OBJECT
QUrl url() const
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Oct 15 2021 22:48:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.