summaryrefslogtreecommitdiffstats
path: root/khelpcenter/mainwindow.h
blob: 8db9247a3254c162d58ba5b4328f2c38dc46b100 (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
97
98
99
100
101
102
103
104
105
106
107
#ifndef __mainwindow_h__
#define __mainwindow_h__

#include <tqptrlist.h>

#include <tdemainwindow.h>
#include <tdeio/job.h>
#include <kurl.h>
#include <tdeparts/browserextension.h>
#include <dcopclient.h>
#include <dcopobject.h>

#include "navigator.h"
#include "glossary.h"

class TDEHTMLPart;
class TQSplitter;

class LogDialog;

namespace KHC {

class View;

class MainWindow : public TDEMainWindow, public DCOPObject
{
    Q_OBJECT
    K_DCOP
  public:
    MainWindow();
    ~MainWindow();

  k_dcop:
    void openUrl( const TQString &url );
    void openUrl( const TQString &url, const TQCString& startup_id );
    void showHome();
    void lastSearch();

  public slots:
    void print();
    void statusBarMessage(const TQString &m);
    void slotShowHome();
    void slotLastSearch();
    void showSearchStderr();
    /**
      Show document corresponding to given URL in viewer part.
    */
    void viewUrl( const KURL &url,
                  const KParts::URLArgs &args = KParts::URLArgs() );
    /**
      Show document corresponding to given URL in viewer part.
    */
    void viewUrl( const TQString & );

    /**
      Open document corresponding to given URL, i.e. show it in the viewer part
      and select the corresponding entry in the navigator widget.
    */
    void openUrl( const KURL &url );

  protected:
    void setupActions();

    virtual void saveProperties( TDEConfig *config );
    virtual void readProperties( TDEConfig *config );

    void readConfig();
    void writeConfig();

  protected slots:
    void enableLastSearchAction();
    void enableCopyTextAction();

  private:
    void stop();

  private slots:
    void slotGlossSelected(const GlossaryEntry &entry);
    void slotStarted(TDEIO::Job *job);
    void slotInfoMessage(TDEIO::Job *, const TQString &);
    void goInternalUrl( const KURL & );
    /**
      This function is called when the user clicks on a link in the viewer part.
    */
    void slotOpenURLRequest( const KURL &url,
                             const KParts::URLArgs &args);
    void documentCompleted();
    void slotIncFontSizes();
    void slotDecFontSizes();
    void slotConfigureFonts();
    void slotCopySelectedText();

private:
    void updateZoomActions();

    TQSplitter *mSplitter;
    View *mDoc;
    Navigator *mNavigator;

    TDEAction *mLastSearchAction;
    TDEAction *mCopyText;
    LogDialog *mLogDialog;
};

}

#endif