File indexing completed on 2024-04-28 16:26:36

0001 /***************************************************************************
0002     Begin : Sat 3-1 20:40:00 CEST 2004
0003     Copyright (C) 2004 by Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
0004                   2011 - 2017 by Michel Ludwig (michel.ludwig@kdemail.net)
0005  ***************************************************************************/
0006 
0007 /***************************************************************************
0008  *                                                                         *
0009  *   This program is free software; you can redistribute it and/or modify  *
0010  *   it under the terms of the GNU General Public License as published by  *
0011  *   the Free Software Foundation; either version 2 of the License, or     *
0012  *   (at your option) any later version.                                   *
0013  *                                                                         *
0014  ***************************************************************************/
0015 
0016 #ifndef TOOLCONFIGWIDGET_H
0017 #define TOOLCONFIGWIDGET_H
0018 
0019 #include <QStringList>
0020 #include <QWidget>
0021 
0022 #include "kiletool.h"
0023 
0024 namespace KileTool {
0025 class Manager;
0026 }
0027 class ToolConfigWidget;
0028 class ProcessToolConfigWidget;
0029 class LibraryToolConfigWidget;
0030 class QuickToolConfigWidget;
0031 class LaTeXToolConfigWidget;
0032 class ViewBibToolConfigWidget;
0033 
0034 namespace KileWidget
0035 {
0036 class ToolConfig : public QWidget
0037 {
0038     Q_OBJECT
0039 
0040     enum GeneralBasicStack { GBS_None = 1, GBS_Process, GBS_Sequence, GBS_Error };
0041     enum GeneralExtraStack { GES_None = 1, GES_LaTeX/*, GES_ViewBib*/ };
0042 
0043 public:
0044     ToolConfig(KileTool::Manager *mngr, QWidget *parent, const char * name = 0);
0045 
0046 public Q_SLOTS:
0047     void writeConfig();
0048 
0049 private:
0050     void setupAdvanced();
0051     void setupGeneral();
0052     int indexQuickBuild();
0053 
0054 private Q_SLOTS:
0055     void updateGeneral();
0056     void updateAdvanced();
0057     void switchTo(const QString & tool, bool save = true);
0058     void updateToollist();
0059     void updateConfiglist();
0060     void selectIcon();
0061     void setMenu(int index);
0062     void switchConfig(int index = -1);
0063     void switchConfig(const QString &);
0064 
0065     void newTool();
0066     void newConfig();
0067     void removeTool();
0068     void removeConfig();
0069     void writeStdConfig(const QString &, const QString &);
0070     void writeDefaults();
0071 
0072     void setCommand(const QString &);
0073     void setOptions();
0074     void setSequence(const QString &);
0075     void setClose(bool);
0076     void setTarget(const QString &);
0077     void setRelDir(const QString &);
0078     void setLaTeXCheckRoot(bool);
0079     void setLaTeXJump(bool);
0080     void setLaTeXAuto(bool);
0081     void setRunLyxServer(bool);
0082     void setFrom(const QString &);
0083     void setTo(const QString &);
0084     void setClass(const QString &);
0085     void switchClass(const QString &);
0086     void switchType(int);
0087 
0088 Q_SIGNALS:
0089     void changed();
0090 
0091 private:
0092     ToolConfigWidget    *m_configWidget;
0093     KileTool::Manager   *m_manager;
0094     KConfig         *m_config;
0095     KileTool::Config    m_map;
0096     QString         m_current, m_icon;
0097     QStringList     m_classes;
0098     QWidget         *m_tabGeneral, *m_tabAdvanced, *m_tabMenu;
0099     ProcessToolConfigWidget *m_ptcw;
0100     LibraryToolConfigWidget *m_ltcw;
0101     QuickToolConfigWidget   *m_qtcw;
0102     LaTeXToolConfigWidget   *m_LaTeXtcw;
0103 };
0104 }
0105 
0106 #endif