2008-04-01 09:10:46 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2002 by Wilco Greven <greven@kde.org> *
|
|
|
|
* Copyright (C) 2008 by Pino Toscano <pino@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 _EXTENSIONS_H_
|
|
|
|
#define _EXTENSIONS_H_
|
|
|
|
|
|
|
|
#include <kparts/browserextension.h>
|
2014-08-09 23:08:54 +00:00
|
|
|
#include <kparts/liveconnectextension.h>
|
2008-04-01 09:10:46 +00:00
|
|
|
|
2009-10-26 20:59:24 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
|
|
|
|
2008-04-01 09:10:46 +00:00
|
|
|
class Part;
|
|
|
|
|
|
|
|
class BrowserExtension : public KParts::BrowserExtension
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
BrowserExtension(Part*);
|
|
|
|
|
2016-07-11 17:30:31 +00:00
|
|
|
public Q_SLOTS:
|
2008-04-01 09:10:46 +00:00
|
|
|
// Automatically detected by the host.
|
|
|
|
void print();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Part *m_part;
|
|
|
|
};
|
|
|
|
|
|
|
|
class OkularLiveConnectExtension : public KParts::LiveConnectExtension
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
OkularLiveConnectExtension( Part *parent );
|
|
|
|
|
|
|
|
// from LiveConnectExtension
|
|
|
|
virtual bool get( const unsigned long objid, const QString &field, Type &type,
|
|
|
|
unsigned long &retobjid, QString &value );
|
|
|
|
virtual bool put( const unsigned long objid, const QString &field, const QString &value );
|
|
|
|
virtual bool call( const unsigned long objid, const QString &func, const QStringList &args,
|
|
|
|
Type &type, unsigned long &retobjid, QString &value );
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString eval( const QString &script );
|
|
|
|
void postMessage( const QStringList &args );
|
|
|
|
|
|
|
|
bool m_inEval;
|
|
|
|
QString m_evalRes;
|
|
|
|
};
|
2009-10-26 20:59:24 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-04-01 09:10:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* kate: replace-tabs on; indent-width 4; */
|