/* Klat - A LaTeX editor for KDE Copyright (C) 2002-2004 Jori Liesenborgs (jori@lumumba.luc.ac.be) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "klat.h" #include "klattooltab.h" #include "klattooltab.moc" #include "klathtmlwidget.h" #include "klatedittab.h" #include #include KlatToolTab::KlatToolTab(QWidget *parent) : QTabWidget(parent) { sectioning = new KlatHTMLWidget(this); sectioning->openAppDataURL("sectioning.html"); addTab(sectioning->widget(),"Sectioning"); environments = new KlatHTMLWidget(this); environments->openAppDataURL("environments.html"); addTab(environments->widget(),"Environments"); greek = new KlatHTMLWidget(this); greek->openAppDataURL("greek/greek.html"); addTab(greek->widget(),"Greek"); mathsymbols = new KlatHTMLWidget(this); mathsymbols->openAppDataURL("symbols_from_kile/mathsymbols.html"); addTab(mathsymbols->widget(),"Math"); } KlatToolTab::~KlatToolTab() { } void KlatToolTab::connectToEditTab(KlatEditTab *e) { connect(greek,SIGNAL(signalSymbolCodeSelected(const QString &,int)),e,SLOT(slotInsertString(const QString &,int))); connect(mathsymbols,SIGNAL(signalSymbolCodeSelected(const QString &,int)),e,SLOT(slotInsertString(const QString &,int))); connect(sectioning,SIGNAL(signalSymbolCodeSelected(const QString &,int)),e,SLOT(slotInsertString(const QString &,int))); connect(environments,SIGNAL(signalSymbolCodeSelected(const QString &,int)),e,SLOT(slotInsertString(const QString &,int))); sectioning->widget()->setFocusProxy(e); mathsymbols->widget()->setFocusProxy(e); greek->widget()->setFocusProxy(e); environments->widget()->setFocusProxy(e); } void KlatToolTab::connectToKlatWidget(Klat *k) { connect(greek,SIGNAL(onURLcode(const QString &)),k,SLOT(slotLaTeXCodeChanged(const QString &))); connect(mathsymbols,SIGNAL(onURLcode(const QString &)),k,SLOT(slotLaTeXCodeChanged(const QString &))); connect(sectioning,SIGNAL(onURLcode(const QString &)),k,SLOT(slotLaTeXCodeChanged(const QString &))); connect(environments,SIGNAL(onURLcode(const QString &)),k,SLOT(slotLaTeXCodeChanged(const QString &))); connect(this,SIGNAL(signalLeaveEvent()),k,SLOT(slotLaTeXCodeClear())); } void KlatToolTab::leaveEvent(QEvent* event) { emit signalLeaveEvent(); };