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

0001 /**************************************************************************
0002 *   Copyright (C) 2006-2022 by Michel Ludwig (michel.ludwig@kdemail.net   *
0003 ***************************************************************************/
0004 
0005 /**************************************************************************
0006 *                                                                         *
0007 *   This program is free software; you can redistribute it and/or modify  *
0008 *   it under the terms of the GNU General Public License as published by  *
0009 *   the Free Software Foundation; either version 2 of the License, or     *
0010 *   (at your option) any later version.                                   *
0011 *                                                                         *
0012 ***************************************************************************/
0013 
0014 #ifndef SCRIPTSMANAGEMENTWIDGET_H
0015 #define SCRIPTSMANAGEMENTWIDGET_H
0016 
0017 #include <QTreeWidget>
0018 #include <QWidget>
0019 
0020 #include <QAction>
0021 #include <KToolBar>
0022 
0023 class KileInfo;
0024 
0025 namespace KileScript {
0026 class Manager;
0027 class Script;
0028 }
0029 
0030 namespace KileWidget {
0031 
0032 /**
0033  * This widget is used to control Kile's scripting features.
0034  **/
0035 class ScriptsManagement : public QWidget {
0036     Q_OBJECT
0037 public:
0038     explicit ScriptsManagement(KileInfo *kileInfo, QWidget *parent = 0, const char *name = 0, Qt::WindowFlags f = Qt::WindowFlags());
0039     ~ScriptsManagement();
0040 
0041 public:
0042     int scriptNameColumnWidth();
0043     void setScriptNameColumnWidth(int width);
0044 
0045 public Q_SLOTS:
0046     /**
0047      * Rebuilds the view.
0048      **/
0049     void update();
0050 
0051 protected Q_SLOTS:
0052     /**
0053      * Opens the currently selected script in Kile's editing area.
0054      **/
0055     void openSelectedScript();
0056 
0057     /**
0058      * Executes the currently selected script.
0059      **/
0060     void executeSelectedScript();
0061 
0062     void configureSelectedKeySequence();
0063 
0064     void removeSelectedKeySequence();
0065 
0066     void updateButtonPanel();
0067 
0068 protected:
0069     KileInfo *m_kileInfo;
0070     QTreeWidget *m_treeWidget;
0071 
0072 private:
0073     QAction *m_runAction, *m_scriptOpenAction, *m_configureKeySequenceAction, *m_removeKeySequenceAction;
0074     KToolBar *m_toolBar;
0075 };
0076 
0077 }
0078 #endif
0079