kparts: remove unused extensions

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-16 21:23:33 +02:00
parent f993b5e90d
commit e812139c25
8 changed files with 0 additions and 407 deletions

View file

@ -504,7 +504,6 @@ install(
KParts/Factory
KParts/FileInfoExtension
KParts/GUIActivateEvent
KParts/HistoryProvider
KParts/LiveConnectExtension
KParts/ListingExtension
KParts/MainWindow
@ -518,7 +517,6 @@ install(
KParts/ReadOnlyPart
KParts/ReadWritePart
KParts/StatusBarExtension
KParts/TextExtension
KParts/WindowArgs
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/KDE/KParts
COMPONENT Devel

View file

@ -1 +0,0 @@
#include "../../kparts/historyprovider.h"

View file

@ -1 +0,0 @@
#include "../../kparts/textextension.h"

View file

@ -16,12 +16,10 @@ set(kparts_LIB_SRCS
event.cpp
browserextension.cpp
factory.cpp
historyprovider.cpp
browserinterface.cpp
browserrun.cpp
browseropenorsavequestion.cpp
statusbarextension.cpp
textextension.cpp
fileinfoextension.cpp
listingextension.cpp
)
@ -68,12 +66,10 @@ install(
event.h
browserextension.h
factory.h
historyprovider.h
browserinterface.h
browserrun.h
statusbarextension.h
browseropenorsavequestion.h
textextension.h
fileinfoextension.h
listingextension.h
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/kparts

View file

@ -1,98 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "historyprovider.h"
#include <QtCore/QSet>
#include <kapplication.h>
using namespace KParts;
class KParts::HistoryProviderPrivate
{
public:
HistoryProviderPrivate()
: q(0)
{
}
~HistoryProviderPrivate()
{
delete q;
}
QSet<QString> dict;
HistoryProvider *q;
};
K_GLOBAL_STATIC(HistoryProviderPrivate, historyProviderPrivate)
HistoryProvider * HistoryProvider::self()
{
if (!historyProviderPrivate->q) {
new HistoryProvider;
}
return historyProviderPrivate->q;
}
bool HistoryProvider::exists()
{
return historyProviderPrivate->q;
}
HistoryProvider::HistoryProvider( QObject *parent )
: QObject( parent ), d(historyProviderPrivate)
{
Q_ASSERT(!historyProviderPrivate->q);
historyProviderPrivate->q = this;
setObjectName("history provider");
}
HistoryProvider::~HistoryProvider()
{
if (!historyProviderPrivate.isDestroyed() &&
historyProviderPrivate->q == this)
historyProviderPrivate->q = 0;
}
bool HistoryProvider::contains( const QString& item ) const
{
return d->dict.contains( item );
}
void HistoryProvider::insert( const QString& item )
{
d->dict.insert( item );
emit inserted( item );
}
void HistoryProvider::remove( const QString& item )
{
d->dict.remove( item );
}
void HistoryProvider::clear()
{
d->dict.clear();
emit cleared();
}
#include "moc_historyprovider.cpp"

View file

@ -1,112 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KHISTORYPROVIDER_H
#define KHISTORYPROVIDER_H
#include <QtCore/QObject>
#include <kparts/kparts_export.h>
namespace KParts {
class HistoryProviderPrivate;
/**
* Basic class to manage a history of "items". This class is only meant
* for fast lookup, if an item is in the history or not.
*
* May be subclassed to implement a persistent history for example.
* For usage with khtml, just create your provider and call the
* HistoryProvider constructor _before_ you do any khtml stuff. That way,
* khtml, using the self()-method, will use your subclassed provider.
*
* @author Carsten Pfeiffer <pfeiffer@kde.org>
*/
class KPARTS_EXPORT HistoryProvider : public QObject
{
Q_OBJECT
friend class ::KParts::HistoryProviderPrivate;
public:
static HistoryProvider * self();
/**
* @returns true if a provider has already been created.
* @since 4.4
*/
static bool exists();
/**
* @returns true if @p item is present in the history.
*/
virtual bool contains( const QString& item ) const;
/**
* Inserts @p item into the history.
*/
virtual void insert( const QString& item );
/**
* Removes @p item from the history.
*/
virtual void remove( const QString& item );
/**
* Clears the history. The cleared() signal is emitted after clearing.
*/
virtual void clear();
Q_SIGNALS:
/**
* Emitted after the history has been cleared.
*/
void cleared();
/**
* This signal is never emitted from this class, it is only meant as an
* interface for subclasses. Emit this signal to notify others that the
* history has changed. Put those items that were added or removed from the
* history into @p items.
*/
void updated( const QStringList& items );
/**
* Emitted after the item has been inserted
*/
void inserted( const QString& item );
protected:
/**
* Creates a KHistoryProvider with an optional parent and name
*/
HistoryProvider(QObject *parent = 0);
/**
* Destroys the provider.
*/
virtual ~HistoryProvider();
private:
HistoryProviderPrivate* const d;
};
}
#endif // KHISTORYPROVIDER_H

View file

@ -1,71 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2010 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "textextension.h"
#include <kglobal.h>
#include "part.h"
KParts::TextExtension::TextExtension(KParts::ReadOnlyPart* parent)
: QObject(parent), d(0)
{
}
KParts::TextExtension::~TextExtension()
{
}
bool KParts::TextExtension::hasSelection() const
{
return false;
}
QString KParts::TextExtension::selectedText(Format) const
{
return QString();
}
QString KParts::TextExtension::completeText(Format) const
{
return QString();
}
KParts::TextExtension * KParts::TextExtension::childObject(QObject *obj)
{
return KGlobal::findDirectChild<KParts::TextExtension *>(obj);
}
int KParts::TextExtension::pageCount() const
{
return 0;
}
int KParts::TextExtension::currentPage() const
{
return 0;
}
QString KParts::TextExtension::pageText(Format) const
{
return QString();
}
bool KParts::TextExtension::findText(const QString&, KFind::SearchOptions) const
{
return false;
}

View file

@ -1,118 +0,0 @@
/* This file is part of the KDE project
Copyright (C) 2010 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPARTS_TEXTEXTENSION_H
#define KPARTS_TEXTEXTENSION_H
#include <QtCore/QObject>
#include <kparts/kparts_export.h>
#include <kfind.h>
namespace KParts
{
class ReadOnlyPart;
class TextExtensionPrivate;
/**
* @short an extension for KParts that allows to retrieve text from the part.
*
* For instance, the text-to-speech plugin uses this to speak the whole text
* from the part or the selected text. The translation plugin uses it for
* translating the selected text, and so on.
*
* @since 4.6
*/
class KPARTS_EXPORT TextExtension : public QObject
{
Q_OBJECT
public:
TextExtension(KParts::ReadOnlyPart* parent);
~TextExtension();
/**
* Queries @p obj for a child object which inherits from this
* TextExtension class.
*/
static TextExtension *childObject( QObject *obj );
enum Format { PlainText, HTML };
/**
* Returns true if the user selected text in the part.
*/
virtual bool hasSelection() const;
/**
* Returns the selected text, in the requested format.
* If the format is not supported, the part must return an empty string.
*/
virtual QString selectedText(Format format) const;
/**
* Returns the complete text shown in the part, in the requested format.
* If the format is not supported, the part must return an empty string.
*/
virtual QString completeText(Format format) const;
/**
* Returns the number of pages, for parts who support the concept of pages.
* Otherwise returns 0.
*/
virtual int pageCount() const;
/**
* Returns the current page (between 0 and pageCount()-1),
* for parts who support the concept of pages.
* Otherwise returns 0.
*/
virtual int currentPage() const;
/**
* Returns the text in a given page, in the requested format.
*/
virtual QString pageText(Format format) const;
/**
* Returns true if @p string is found using the given @p options.
*
* If any text matches @p string, then it will be selected/highlighted.
* To find the next matching text, simply call this function again with the
* same search text until it returns false.
*
* To clear a selection, just pass an empty string.
*
* Note that parts that implement this extension might not support all the
* options available in @ref KFind::SearchOptions.
*/
virtual bool findText(const QString& string, KFind::SearchOptions options) const;
// for future extensions can be made via slots
Q_SIGNALS:
/**
* This signal is emitted when the selection changes.
*/
void selectionChanged();
private:
// for future extensions
TextExtensionPrivate* const d;
};
}
#endif /* KPARTS_TEXTEXTENSION_H */