[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:40 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=1d6f1df

The following commit has been merged in the master branch:
commit 1d6f1df3c8e7f70f1dbabac207f44aec0dc2b604
Author: Dominik Schmidt <dev at dominik-schmidt.de>
Date:   Thu Feb 3 21:36:59 2011 +0100

    Refactor the app to make it more flexible and more clearly structured.
---
 app/CMakeLists.txt      |   5 +-
 app/chatwindow.cpp      | 127 ++++++++++++++++++++++++++++++++++++++++++++
 app/chatwindow.h        |  51 ++++++++++++++++++
 app/chatwindow.rc       |  14 +++++
 app/main.cpp            |  49 ++++++++---------
 app/mainwindow.cpp      | 137 ------------------------------------------------
 app/mainwindow.h        |  59 ---------------------
 app/telepathychatui.cpp |  86 ++++++++++++++++++++++++++++++
 app/telepathychatui.h   |  49 +++++++++++++++++
 9 files changed, 354 insertions(+), 223 deletions(-)

diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 86bea23..738a3b6 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -4,7 +4,8 @@ include_directories(../lib/)
 
 set(telepathy_chat_handler_SRCS
         main.cpp
-        mainwindow.cpp
+        telepathychatui.cpp
+        chatwindow.cpp
 )
 
 kde4_add_executable(telepathy-chat-handler ${telepathy_chat_handler_SRCS})
@@ -18,3 +19,5 @@ install(TARGETS telepathy-chat-handler ${INSTALL_TARGETS_DEFAULT_ARGS})
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.KDEChatHandler.service
         DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
 install(FILES KDEChatHandler.client DESTINATION ${SHARE_INSTALL_PREFIX}/telepathy/clients/)
+install(FILES chatwindow.rc
+        DESTINATION  ${DATA_INSTALL_DIR}/telepathy-chat-handler/)
diff --git a/app/chatwindow.cpp b/app/chatwindow.cpp
new file mode 100644
index 0000000..fe4f67e
--- /dev/null
+++ b/app/chatwindow.cpp
@@ -0,0 +1,127 @@
+/*
+    Copyright (C) 2010  David Edmundson <kde at davidedmundson.co.uk>
+    Copyright (C) 2011  Dominik Schmidt <dev at dominik-schmidt.de>
+
+    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 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "chatwindow.h"
+#include "chatwidget.h"
+
+#include <KStandardAction>
+#include <KIcon>
+#include <KLocale>
+#include <KApplication>
+#include <KAction>
+#include <KActionCollection>
+#include <KDebug>
+#include <KIcon>
+#include <KColorScheme>
+
+ChatWindow::ChatWindow()
+{
+    //setup actions
+    KStandardAction::quit(KApplication::instance(), SLOT(quit()),
+                        actionCollection());
+
+    // set up m_tabWidget
+    m_tabWidget = new KTabWidget(this);
+    m_tabWidget->setTabReorderingEnabled(true);
+    m_tabWidget->setDocumentMode(true);
+    m_tabWidget->setCloseButtonEnabled(true);
+    m_tabWidget->setHoverCloseButtonDelayed(true);
+    connect(m_tabWidget, SIGNAL(closeRequest(QWidget*)), m_tabWidget, SLOT(removePage(QWidget*)));
+    connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
+
+    setCentralWidget(m_tabWidget);
+
+    setupGUI(Default, "chatwindow.rc");
+}
+
+ChatWindow::~ChatWindow()
+{
+}
+
+void ChatWindow::addTab(ChatWidget* chatWidget)
+{
+    connect(chatWidget, SIGNAL(titleChanged(QString)), this, SLOT(updateTabText(QString)));
+    connect(chatWidget, SIGNAL(iconChanged(KIcon)), this, SLOT(updateTabIcon(KIcon)));
+    connect(chatWidget, SIGNAL(userTypingChanged(bool)), this, SLOT(onUserTypingChanged(bool)));
+
+    m_tabWidget->addTab(chatWidget, chatWidget->icon(), chatWidget->title());
+
+    onCurrentIndexChanged(m_tabWidget->indexOf(chatWidget));
+}
+
+void ChatWindow::removeTab(ChatWidget* chatWidget)
+{
+    m_tabWidget->removeTab(m_tabWidget->indexOf(chatWidget));
+}
+
+void ChatWindow::updateTabText(const QString & newTitle)
+{
+    //find out which widget made the call, and update the correct tab.
+    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
+    if (sender) {
+        int tabIndexToChange = m_tabWidget->indexOf(sender);
+        m_tabWidget->setTabText(tabIndexToChange, newTitle);
+
+        if (tabIndexToChange == m_tabWidget->currentIndex()) {
+            onCurrentIndexChanged(tabIndexToChange);
+        }
+    }
+}
+
+void ChatWindow::updateTabIcon(const KIcon & newIcon)
+{
+    //find out which widget made the call, and update the correct tab.
+    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
+    if (sender) {
+        int tabIndexToChange = m_tabWidget->indexOf(sender);
+        m_tabWidget->setTabIcon(tabIndexToChange, newIcon);
+    }
+}
+
+
+void ChatWindow::onCurrentIndexChanged(int index)
+{
+    kDebug() << index;
+
+    if(index == -1) {
+        close();
+        return;
+    }
+
+    ChatWidget* currentChatWidget = qobject_cast<ChatWidget*>(m_tabWidget->widget(index));
+    setWindowTitle(currentChatWidget->title());
+    setWindowIcon(currentChatWidget->icon());
+}
+
+void ChatWindow::onUserTypingChanged(bool isTyping)
+{
+    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
+    if (sender) {
+        KColorScheme scheme(QPalette::Active, KColorScheme::Window);
+        int tabIndex = m_tabWidget->indexOf(sender);
+        if (isTyping) {
+            m_tabWidget->setTabTextColor(tabIndex, scheme.foreground(KColorScheme::PositiveText).color());
+        } else {
+            m_tabWidget->setTabTextColor(tabIndex, scheme.foreground(KColorScheme::NormalText).color());
+        }
+    }
+}
+
+
+#include "chatwindow.moc"
\ No newline at end of file
diff --git a/app/chatwindow.h b/app/chatwindow.h
new file mode 100644
index 0000000..0e424e3
--- /dev/null
+++ b/app/chatwindow.h
@@ -0,0 +1,51 @@
+/*
+    Copyright (C) 2010  David Edmundson <kde at davidedmundson.co.uk>
+    Copyright (C) 2011  Dominik Schmidt <dev at dominik-schmidt.de>
+
+    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 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef CHATWINDOW_H
+#define CHATWINDOW_H
+
+#include "chatwidget.h"
+
+#include <KXmlGuiWindow>
+#include <KTabWidget>
+
+class KIcon;
+
+class ChatWindow : public KXmlGuiWindow
+{
+Q_OBJECT
+
+public:
+    ChatWindow();
+    virtual ~ChatWindow();
+
+    void addTab(ChatWidget *chatWidget);
+    void removeTab(ChatWidget *chatWidget);
+
+public slots:
+    void onCurrentIndexChanged(int index);
+    void updateTabText(const QString &newTitle);
+    void updateTabIcon(const KIcon &newIcon);
+    void onUserTypingChanged(bool isTyping);
+
+private:
+    KTabWidget *m_tabWidget;
+};
+
+#endif // CHATWINDOW_H
diff --git a/app/chatwindow.rc b/app/chatwindow.rc
new file mode 100644
index 0000000..24656bd
--- /dev/null
+++ b/app/chatwindow.rc
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gui name="telepathy-chat-handler"
+     version="1"
+     xmlns="http://www.kde.org/standards/kxmlgui/1.0"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
+                         http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
+
+  <MenuBar>
+    <Menu name="file" >
+    </Menu>
+  </MenuBar>
+
+</gui>
\ No newline at end of file
diff --git a/app/main.cpp b/app/main.cpp
index 9ef06f9..3b4af48 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -1,23 +1,23 @@
-/***************************************************************************
- *   Copyright (C) 2010 by David Edmundson <kde at davidedmundson.co.uk>      *
- *                                                                         *
- *   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.                                   *
- *                                                                         *
- *   This program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
-
-#include "mainwindow.h"
+/*
+    Copyright (C) 2010  David Edmundson <kde at davidedmundson.co.uk>
+    Copyright (C) 2011  Dominik Schmidt <dev at dominik-schmidt.de>
+
+    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.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "chatwindow.h"
+#include "telepathychatui.h"
 
 #include <TelepathyQt4/ClientRegistrar>
 #include <TelepathyQt4/AccountFactory>
@@ -38,7 +38,6 @@ int main(int argc, char *argv[])
                          "0.1");
 
     KCmdLineArgs::init(argc, argv, &aboutData);
-    KApplication app;
 
     Tp::registerTypes();
 
@@ -71,12 +70,10 @@ int main(int argc, char *argv[])
 
     Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(accountFactory, connectionFactory,
                                                                    channelFactory, contactFactory);
-    MainWindow* mainWindow = new MainWindow();
 
-    Tp::AbstractClientPtr handler = Tp::AbstractClientPtr(mainWindow);
+    Tp::SharedPtr<TelepathyChatUi> app = Tp::SharedPtr<TelepathyChatUi>(new TelepathyChatUi);
+    Tp::AbstractClientPtr handler = Tp::AbstractClientPtr(app);
     registrar->registerClient(handler, QLatin1String("KDEChatHandler"));
 
-    mainWindow->show();
-
-    return app.exec();
+    return app->exec();
 }
diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
deleted file mode 100644
index 5209d03..0000000
--- a/app/mainwindow.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by David Edmundson <kde at davidedmundson.co.uk>      *
- *                                                                         *
- *   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.                                   *
- *                                                                         *
- *   This program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
-
-#include "mainwindow.h"
-#include "chatwidget.h"
-
-#include <KColorScheme>
-#include <KDebug>
-
-#include <TelepathyQt4/ChannelClassSpecList>
-#include <TelepathyQt4/TextChannel>
-
-
-inline Tp::ChannelClassSpecList channelClassList()
-{
-    return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChat()
-                                      << Tp::ChannelClassSpec::unnamedTextChat()
-                                      << Tp::ChannelClassSpec::textChatroom();
-}
-
-
-MainWindow::MainWindow()
-    : KTabWidget(),
-      AbstractClientHandler(channelClassList())
-{
-    setTabReorderingEnabled(true);
-    setDocumentMode(true);
-
-    setCloseButtonEnabled(true);
-    setHoverCloseButtonDelayed(true);
-    connect(this, SIGNAL(closeRequest(QWidget*)), SLOT(removePage(QWidget*)));
-
-    connect(this, SIGNAL(currentChanged(int)), SLOT(onCurrentIndexChanged(int)));
-}
-
-void MainWindow::handleChannels(const Tp::MethodInvocationContextPtr<> & context,
-        const Tp::AccountPtr & account,
-        const Tp::ConnectionPtr & connection,
-        const QList<Tp::ChannelPtr> & channels,
-        const QList<Tp::ChannelRequestPtr> & requestsSatisfied,
-        const QDateTime & userActionTime,
-        const Tp::AbstractClientHandler::HandlerInfo & handlerInfo)
-{
-    Q_UNUSED(account);
-    Q_UNUSED(connection);
-    Q_UNUSED(requestsSatisfied);
-    Q_UNUSED(userActionTime);
-    Q_UNUSED(handlerInfo);
-
-    Tp::TextChannelPtr textChannel;
-    foreach(const Tp::ChannelPtr & channel, channels) {
-        textChannel = Tp::TextChannelPtr::dynamicCast(channel);
-        if (textChannel) {
-            break;
-        }
-    }
-    Q_ASSERT(textChannel);
-
-    ChatWidget* newWindow = new ChatWidget(textChannel, this);
-
-    addTab(newWindow, newWindow->icon(), newWindow->title());
-
-    connect(newWindow, SIGNAL(titleChanged(QString)), SLOT(updateTabText(QString)));
-    connect(newWindow,SIGNAL(iconChanged(KIcon)), SLOT(updateTabIcon(KIcon)));
-    connect(newWindow, SIGNAL(userTypingChanged(bool)), SLOT(onUserTypingChanged(bool)));
-
-    resize(newWindow->sizeHint() - QSize(50, 50));// FUDGE
-
-    context->setFinished();
-}
-
-void MainWindow::updateTabText(const QString & newTitle)
-{
-    //find out which widget made the call, and update the correct tab.
-    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
-    if (sender) {
-        int tabIndexToChange = indexOf(sender);
-        setTabText(tabIndexToChange, newTitle);
-
-        if (tabIndexToChange == currentIndex()) {
-            onCurrentIndexChanged(tabIndexToChange);
-        }
-    }
-}
-
-void MainWindow::updateTabIcon(const KIcon & newIcon)
-{
-    //find out which widget made the call, and update the correct tab.
-    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
-    if (sender) {
-        int tabIndexToChange = indexOf(sender);
-        setTabIcon(tabIndexToChange, newIcon);
-    }
-}
-
-
-void MainWindow::onCurrentIndexChanged(int index)
-{
-    kDebug() << index;
-
-    if(index == -1) {
-        return;
-    }
-
-    ChatWidget* chat = qobject_cast<ChatWidget*>(widget(index));
-    setWindowTitle(chat->title());
-}
-
-void MainWindow::onUserTypingChanged(bool isTyping)
-{
-    QWidget* sender = qobject_cast<QWidget*>(QObject::sender());
-    if (sender) {
-        KColorScheme scheme(QPalette::Active, KColorScheme::Window);
-        int tabIndex = indexOf(sender);
-        if (isTyping) {
-            setTabTextColor(tabIndex, scheme.foreground(KColorScheme::PositiveText).color());
-        } else {
-            setTabTextColor(tabIndex, scheme.foreground(KColorScheme::NormalText).color());
-        }
-    }
-}
diff --git a/app/mainwindow.h b/app/mainwindow.h
deleted file mode 100644
index badff27..0000000
--- a/app/mainwindow.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by David Edmundson <kde at davidedmundson.co.uk>      *
- *                                                                         *
- *   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.                                   *
- *                                                                         *
- *   This program 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 General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <KTabWidget>
-#include <KIcon>
-
-#include <TelepathyQt4/AbstractClientHandler>
-
-//In the future I want to have a (potential) list of tab widgets.
-//Like Kopete presently. This may need a bit of a rewrite.
-
-class MainWindow : public KTabWidget, public Tp::AbstractClientHandler
-{
-    Q_OBJECT
-public:
-    MainWindow();
-
-    virtual void handleChannels(const Tp::MethodInvocationContextPtr<> & context,
-            const Tp::AccountPtr & account,
-            const Tp::ConnectionPtr & connection,
-            const QList<Tp::ChannelPtr> & channels,
-            const QList<Tp::ChannelRequestPtr> & requestsSatisfied,
-            const QDateTime & userActionTime,
-            const Tp::AbstractClientHandler::HandlerInfo & handlerInfo);
-
-    virtual bool bypassApproval() const {
-        return false;
-    }
-
-private slots:
-    void updateTabText(const QString & newTitle);
-    void updateTabIcon(const KIcon & newIcon);
-
-    /** keep the main window title in line with active tab */
-    void onCurrentIndexChanged(int index);
-
-    void onUserTypingChanged(bool isTyping);
-};
-
-#endif // MAINWINDOW_H
diff --git a/app/telepathychatui.cpp b/app/telepathychatui.cpp
new file mode 100644
index 0000000..4415c82
--- /dev/null
+++ b/app/telepathychatui.cpp
@@ -0,0 +1,86 @@
+/*
+    Copyright (C) 2010  David Edmundson <kde at davidedmundson.co.uk>
+    Copyright (C) 2011  Dominik Schmidt <dev at dominik-schmidt.de>
+
+    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 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "telepathychatui.h"
+#include "chatwidget.h"
+#include "chatwindow.h"
+
+#include <KDebug>
+#include <TelepathyQt4/ChannelClassSpec>
+#include <TelepathyQt4/TextChannel>
+
+inline Tp::ChannelClassSpecList channelClassList()
+{
+    return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::textChat()
+                                      << Tp::ChannelClassSpec::unnamedTextChat()
+                                      << Tp::ChannelClassSpec::textChatroom();
+}
+
+
+TelepathyChatUi::TelepathyChatUi()
+    : KApplication(), AbstractClientHandler(channelClassList())
+{
+    kDebug();
+
+    m_chatWindow = new ChatWindow();
+}
+
+TelepathyChatUi::~TelepathyChatUi()
+{
+    kDebug();
+}
+
+void TelepathyChatUi::handleChannels(const Tp::MethodInvocationContextPtr<> & context,
+        const Tp::AccountPtr & account,
+        const Tp::ConnectionPtr & connection,
+        const QList<Tp::ChannelPtr> & channels,
+        const QList<Tp::ChannelRequestPtr> & requestsSatisfied,
+        const QDateTime & userActionTime,
+        const Tp::AbstractClientHandler::HandlerInfo & handlerInfo)
+{
+    kDebug();
+
+    Q_UNUSED(account);
+    Q_UNUSED(connection);
+    Q_UNUSED(requestsSatisfied);
+    Q_UNUSED(userActionTime);
+    Q_UNUSED(handlerInfo);
+
+    Tp::TextChannelPtr textChannel;
+    foreach(const Tp::ChannelPtr & channel, channels) {
+        textChannel = Tp::TextChannelPtr::dynamicCast(channel);
+        if (textChannel) {
+            break;
+        }
+    }
+    Q_ASSERT(textChannel);
+
+    ChatWidget* newChatWidget = new ChatWidget(textChannel, m_chatWindow);
+
+    m_chatWindow->addTab(newChatWidget);
+
+    m_chatWindow->show();
+
+    context->setFinished();
+}
+
+bool TelepathyChatUi::bypassApproval() const
+{
+    return false;
+}
+
diff --git a/app/telepathychatui.h b/app/telepathychatui.h
new file mode 100644
index 0000000..1cfe76c
--- /dev/null
+++ b/app/telepathychatui.h
@@ -0,0 +1,49 @@
+/*
+    Copyright (C) 2010  David Edmundson <kde at davidedmundson.co.uk>
+    Copyright (C) 2011  Dominik Schmidt <dev at dominik-schmidt.de>
+
+    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 3 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef TELEPATHYCHATUI_H
+#define TELEPATHYCHATUI_H
+
+#include "chatwindow.h"
+
+#include <TelepathyQt4/AbstractClientHandler>
+#include <KApplication>
+
+
+class TelepathyChatUi : public KApplication, public Tp::AbstractClientHandler
+{
+public:
+    TelepathyChatUi();
+    ~TelepathyChatUi();
+
+    virtual void handleChannels(const Tp::MethodInvocationContextPtr<> & context,
+            const Tp::AccountPtr & account,
+            const Tp::ConnectionPtr & connection,
+            const QList<Tp::ChannelPtr> & channels,
+            const QList<Tp::ChannelRequestPtr> & requestsSatisfied,
+            const QDateTime & userActionTime,
+            const Tp::AbstractClientHandler::HandlerInfo & handlerInfo);
+
+    virtual bool bypassApproval() const;
+
+private:
+    ChatWindow *m_chatWindow;
+};
+
+#endif // TELEPATHYCHATUI_H

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list