Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 85237506 authored by R. Harish Navnit's avatar R. Harish Navnit Committed by Pali Rohár

Port kopete's accessibility to Qt5

parent 1bf4d17b
......@@ -31,6 +31,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/contactlist
########### next target ###############
# Contact List
set(KF5_VERSION "5.11.0")
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS NotifyConfig TextEditor)
set(kopete_SRCS
......
......@@ -20,17 +20,15 @@
#include <khtmlview.h>
#include <dom/html_document.h>
/** FIXME:
#if QT_VERSION >= 0x40800
QString Q_GUI_EXPORT qTextAfterOffsetFromString( int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text );
QString Q_GUI_EXPORT qTextBeforeOffsetFromString( int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text );
QString Q_GUI_EXPORT qTextAtOffsetFromString( int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text );
QString Q_GUI_EXPORT qTextAfterOffset( int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset);
QString Q_GUI_EXPORT qTextBeforeOffset( int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset);
QString Q_GUI_EXPORT qTextAtOffset( int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset);
#endif
*/
AccessibleChatMessagePart::AccessibleChatMessagePart( KHTMLView* widget ):
QAccessibleWidgetEx( widget, QAccessible::Document )
QAccessibleWidget( widget, QAccessible::Document )
{
m_part = widget->part();
}
......@@ -40,14 +38,15 @@ int AccessibleChatMessagePart::childCount() const
return 0;
}
int AccessibleChatMessagePart::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface** target) const
// DEPRECATED: QAccessibleInterface::navigate() is replaced by child() and parent()
/*int AccessibleChatMessagePart::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface** target) const
{
if (rel == QAccessible::Child) {
*target = 0;
return -1;
}
return QAccessibleWidgetEx::navigate(rel, entry, target);
}
}*/
int AccessibleChatMessagePart::characterCount()
{
......@@ -111,12 +110,12 @@ void AccessibleChatMessagePart::selection( int selectionIndex, int* startOffset,
*endOffset = -1;
}
QRect AccessibleChatMessagePart::characterRect( int offset, QAccessible2::CoordinateType coordType )
QRect AccessibleChatMessagePart::characterRect( int offset)
{
return QRect();
}
int AccessibleChatMessagePart::offsetAtPoint( const QPoint& point, QAccessible2::CoordinateType coordType )
int AccessibleChatMessagePart::offsetAtPoint( const QPoint& point)
{
return 0;
}
......@@ -130,29 +129,32 @@ void AccessibleChatMessagePart::scrollToSubstring( int startIndex, int endIndex
{
}
QString AccessibleChatMessagePart::textAfterOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset )
/**
* FIXME:
QString AccessibleChatMessagePart::textAfterOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset )
{
#if QT_VERSION >= 0x40800
return qTextAfterOffsetFromString( offset, boundaryType, startOffset, endOffset, plainText() );
return QAccessibleTextInterface::textAfterOffset( offset, boundaryType, startOffset, endOffset );
#else
return QString();
#endif
}
QString AccessibleChatMessagePart::textBeforeOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset )
QString AccessibleChatMessagePart::textBeforeOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset )
{
#if QT_VERSION >= 0x40800
return qTextBeforeOffsetFromString( offset, boundaryType, startOffset, endOffset, plainText() );
return QAccessibleTextInterface::textBeforeOffset( offset, boundaryType, startOffset, endOffset );
#else
return QString();
#endif
}
QString AccessibleChatMessagePart::textAtOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset )
QString AccessibleChatMessagePart::textAtOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset )
{
#if QT_VERSION >= 0x40800
return qTextAtOffsetFromString( offset, boundaryType, startOffset, endOffset, plainText() );
return QAccessibleTextInterface::textAtOffset( offset, boundaryType, startOffset, endOffset );
#else
return QString();
#endif
}
*/
\ No newline at end of file
......@@ -18,8 +18,9 @@
#ifndef ACCESSIBLECHATMESSAGEPART_H
#define ACCESSIBLECHATMESSAGEPART_H
#include <QAccessibleTextInterface>
#include <QAccessible>
#include <QAccessibleWidget>
#include <QAccessibleTextInterface>
class KHTMLPart;
class KHTMLView;
......@@ -28,10 +29,8 @@ namespace MessageViewer {
class MailWebView;
}
class AccessibleChatMessagePart: public QAccessibleWidgetEx,
public QAccessibleTextInterface
class AccessibleChatMessagePart:public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
AccessibleChatMessagePart( KHTMLView* widget );
......@@ -48,16 +47,16 @@ public:
virtual QString attributes( int offset, int* startOffset, int* endOffset );
virtual int childCount() const;
virtual int navigate(RelationFlag rel, int entry, QAccessibleInterface** target) const;
//DEPRECATED: virtual int navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface** target) const;
virtual void selection( int selectionIndex, int* startOffset, int* endOffset );
virtual QRect characterRect( int offset, QAccessible2::CoordinateType coordType );
virtual int offsetAtPoint( const QPoint& point, QAccessible2::CoordinateType coordType );
virtual QRect characterRect( int offset);
virtual int offsetAtPoint( const QPoint& point);
virtual int cursorPosition();
virtual void scrollToSubstring( int startIndex, int endIndex );
virtual QString textAfterOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset );
virtual QString textBeforeOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset );
virtual QString textAtOffset( int offset, QAccessible2::BoundaryType boundaryType, int* startOffset, int* endOffset );
//virtual QString textAfterOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset );
//virtual QString textBeforeOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset );
//virtual QString textAtOffset( int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset );
private:
QString plainText() const;
KHTMLPart *m_part;
......
......@@ -20,7 +20,7 @@
#include <qplugin.h>
#include "accessiblechatmessagepart.h"
Q_EXPORT_PLUGIN(ChatWindowAccessibleWidgetFactory)
Q_PLUGIN_METADATA(ChatWindowAccessibleWidgetFactory)
QAccessibleInterface *ChatWindowAccessibleWidgetFactory::create( const QString &key, QObject *object )
{
......
......@@ -2,7 +2,7 @@ ClassName=KopeteChatWindowSettings
File=kopetechatwindowsettings.kcfg
GlobalEnums=false
Inherits=KConfigSkeleton
ItemAccessors=true
#ItemAccessors=true
MemberVariables=private
Mutators=true
SetUserTexts=false
......
......@@ -28,8 +28,9 @@
#include <KUrl>
#include <KDebug>
#include <KMessageBox>
#include <kmessagebox_queued.h>
#include <KEmoticonsTheme>
#include <KLocalizedString>
#include <kmessagebox_queued.h>
#include "kopeteaccount.h"
#include "kopetepicture.h"
......
......@@ -26,6 +26,7 @@
#include <QIcon>
#include <QMenu>
#include <QDrag>
#include <QWidget>
#include <QHeaderView>
#include <QScrollBar>
......
......@@ -25,7 +25,7 @@
#define KOPETE_CONTACTLISTVIEW_H
#include <QTreeView>
#include <QMimeData>
#include <QPixmap>
#include <QList>
#include <QStringList>
......
......@@ -42,6 +42,7 @@
#include <KIconLoader>
#include <KGlobal>
#include <KLocale>
#include <KUrl>
#include <KUrlRequester>
#include <KStandardDirs>
#include <KMessageBox>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment