summaryrefslogtreecommitdiffstats
path: root/kviewshell/kviewshell.h
blob: 1da78c2063e1e0fbca21366879f92b03e11bf976 (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
// -*- C++ -*-
#ifndef KVIEWSHELL_H
#define KVIEWSHELL_H

#include <tqstring.h>

#include <kparts/mainwindow.h>

class KRecentFilesAction;
class KURL;
class KViewPart_Iface;


class TQLabel;

class KViewShell : public KParts::MainWindow
{
  Q_OBJECT
  TQ_OBJECT

public:
  KStatusBar *statusbar;
  KStatusBar *action;

  KViewShell(const TQString& defaultMimeType = TQString());
  virtual ~KViewShell();

public slots:
  void openURL(const KURL&);
  void addRecentFile();


protected slots:
  void slotFullScreen();
  void slotQuit();
  void slotConfigureKeys();
  void slotEditToolbar();
  void slotFileClose();
  void slotNewToolbarConfig();

  void slotChangeZoomText(const TQString &);
  void slotChangePageText(const TQString &);
  void slotChangeSizeText(const TQString &);

signals:
  void restoreDocument(const KURL &url, int page);
  void saveDocumentRestoreInfo(KConfig* config);

protected:
  void readSettings();
  void writeSettings();

  /**
   * This method is called when it is time for the app to save its
   * properties for session management purposes.
   */
  void saveProperties(KConfig*);

  /**
   * This method is called when this app is restored.  The KConfig
   * object points to the session management config file that was saved
   * with @ref saveProperties
   */
  void readProperties(KConfig*);

  void checkActions();

  void dragEnterEvent(TQDragEnterEvent *event);
  void dropEvent(TQDropEvent *event);
  void keyPressEvent(TQKeyEvent * e);

private:
  KViewPart_Iface *view;

  KRecentFilesAction *recent;
  TQString cwd;

  KAction *closeAction, *reloadAction;
  KToggleAction *fullScreenAction;

  // In the attribute, the status of the statusbar (shown of hidden)
  // is saved when the kviewshell switches to fullscreen mode. The
  // statusbar can then be restored when the application returns to normal mode.
  bool isStatusBarShownInNormalMode;
  // ditto, for the toolbar
  bool isToolBarShownInNormalMode;
};


#endif