summaryrefslogtreecommitdiffstats
path: root/quanta/parts/preview/whtmlpart.h
blob: 73bd23e5c9ce7f1412b9c71211dc7c6c1f35abc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
                          whtmlpart.h  -  description
                             -------------------
    begin                : Fri Aug 18 2000
    copyright            : (C) 2000 by Dmitry Poplavsky & Alexander Yakovlev & Eric Laffoon <pdima@users.sourceforge.net,yshurik@linuxfan.com,sequitur@easystreet.com>
                           (C) 2002, 2004, 2005 Andras Mantia <amantia@kde.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef WHTMLPART_H
#define WHTMLPART_H

#include <tqstrlist.h>

#include <tdehtml_part.h>

class TDEPopupMenu;
/**
  *@author Dmitry Poplavsky & Alexander Yakovlev & Eric Laffoon
  */

class WHTMLPart : public TDEHTMLPart  {
   Q_OBJECT
  
public:
  WHTMLPart(TQWidget *parentWidget = 0, const char *widgetname = 0, bool enableViewSource = false,
            TQObject *parent = 0, const char *name = 0, GUIProfile prof = DefaultGUI );
  virtual ~WHTMLPart();

  /** Specify the URL where the preview was started */
  void setPreviewedURL(const KURL &url);
  bool backEnable();
  bool forwardEnable();
  virtual bool openURL(const KURL &url);

public slots:

/** back(), forward() - navigation, using history.
 */
  void forward();
  void back();
  void popupMenu(const TQString &url, const TQPoint &point);
  void slotViewSource();
  
  void addToHistory(const TQString &url);
  virtual bool eventFilter(TQObject *watched, TQEvent *e);

signals:
  void updateStatus( bool back, bool forward );
  void previewHasFocus(bool focus);
  void showPreview(bool show);
  void openFile(const KURL&, const TQString&, bool);

protected:
  virtual void urlSelected( const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args = KParts::URLArgs());
  virtual KParts::ReadOnlyPart *createPart( TQWidget *parentWidget, const char *widgetName,
                                            TQObject *parent, const char *name,
                                            const TQString &mimetype, TQString &serviceName,
                                            TQStringList &serviceTypes, const TQStringList &params);

private:
  KURL m_previewedURL;
  TDEPopupMenu *m_contextMenu;
  TQStrList history;
  unsigned int hpos;
  bool m_enableViewSource;
};

#endif