summaryrefslogtreecommitdiffstats
path: root/kdvi/kdvi_multipage.h
blob: c3e60aea8694fdea72473f10c2cb3af3f31f97ff (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// -*- C++ -*-
#ifndef KDVIMULTIPAGE_H
#define KDVIMULTIPAGE_H

#include "kmultipage.h"
#include "dviRenderer.h"

#include <tqstringlist.h>

class KPrinter;

class KDVIMultiPage : public KMultiPage
{
  Q_OBJECT

public:
  KDVIMultiPage(TQWidget *parentWidget, const char *widgetName, TQObject *parent,
                const char *name, const TQStringList& args = TQStringList());
  virtual ~KDVIMultiPage();

// Interface definition start ------------------------------------------------

  /// returns the list of supported file formats
  virtual TQStringList fileFormats() const;
  
  virtual void setFile(bool r);

  virtual void print();
  
  /// KDVI offers read- and write functionality must re-implement this
  /// method and return true here.
  virtual bool isReadWrite() {return true;}

  virtual void addConfigDialogs(KConfigDialog* configDialog);

  static KAboutData* createAboutData();

private:
  virtual DocumentWidget* createDocumentWidget();

  virtual void initializePageCache();

  /** Used to enable the export menu when a file is successfully
      loaded. */
  virtual void enableActions(bool);
  
public slots:
  /** Opens a file requestor and saves. This really saves the content
      of the DVI-file, and does not just start a copy job */
  virtual void slotSave();
 
  /** Similar to slotSave, but does not ask for a filename. */
  virtual void slotSave_defaultFilename();

  void setEmbedPostScriptAction();

  void slotEmbedPostScript();

  virtual void preferencesChanged();

  /** Shows the "text search" dialog, if text search is supported by
      the renderer. Otherwise, the method returns immediately.
      We reimplement this slot to show a warning message that informs the
      user about the currently limited search capabilities of KDVI. */
  virtual void showFindTextDialog();

protected slots:
  void doExportText();
  void doEnableWarnings();

  void showTip();
  void showTipOnStart();

private:
  // Points to the same object as renderer to avoid downcasting.
  // FIXME: Remove when the API of the Renderer-class is finished.
  dviRenderer     DVIRenderer;

  // Set to true if we used the search function atleast once.
  // It is used to remember if we already have show the warning message.
  bool searchUsed;

  /*************************************************************
   * Methods and classes concerned with the find functionality *
   *************************************************************/

  /** Pointers to several actions which are disabled if no file is
      loaded. */
  KAction      *docInfoAction;
  KAction      *embedPSAction;
  KAction      *exportPDFAction;
  KAction      *exportPSAction;
};


#endif