1 | /*************************************************************************** |
2 | * Copyright (C) 2002 by Wilco Greven <greven@kde.org> * |
3 | * Copyright (C) 2008 by Pino Toscano <pino@kde.org> * |
4 | * * |
5 | * This program is free software; you can redistribute it and/or modify * |
6 | * it under the terms of the GNU General Public License as published by * |
7 | * the Free Software Foundation; either version 2 of the License, or * |
8 | * (at your option) any later version. * |
9 | ***************************************************************************/ |
10 | |
11 | #ifndef _EXTENSIONS_H_ |
12 | #define _EXTENSIONS_H_ |
13 | |
14 | #include <kparts/browserextension.h> |
15 | |
16 | namespace Okular |
17 | { |
18 | |
19 | class Part; |
20 | |
21 | class BrowserExtension : public KParts::BrowserExtension |
22 | { |
23 | Q_OBJECT |
24 | |
25 | public: |
26 | BrowserExtension(Part*); |
27 | |
28 | public slots: |
29 | // Automatically detected by the host. |
30 | void print(); |
31 | |
32 | private: |
33 | Part *m_part; |
34 | }; |
35 | |
36 | class OkularLiveConnectExtension : public KParts::LiveConnectExtension |
37 | { |
38 | Q_OBJECT |
39 | |
40 | public: |
41 | OkularLiveConnectExtension( Part *parent ); |
42 | |
43 | // from LiveConnectExtension |
44 | virtual bool get( const unsigned long objid, const QString &field, Type &type, |
45 | unsigned long &retobjid, QString &value ); |
46 | virtual bool put( const unsigned long objid, const QString &field, const QString &value ); |
47 | virtual bool call( const unsigned long objid, const QString &func, const QStringList &args, |
48 | Type &type, unsigned long &retobjid, QString &value ); |
49 | |
50 | private: |
51 | QString eval( const QString &script ); |
52 | void postMessage( const QStringList &args ); |
53 | |
54 | bool m_inEval; |
55 | QString m_evalRes; |
56 | }; |
57 | |
58 | } |
59 | |
60 | #endif |
61 | |
62 | /* kate: replace-tabs on; indent-width 4; */ |
63 | |