summaryrefslogtreecommitdiffstats
path: root/parts/astyle/astyle_part.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /parts/astyle/astyle_part.h
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/astyle/astyle_part.h')
-rw-r--r--parts/astyle/astyle_part.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/parts/astyle/astyle_part.h b/parts/astyle/astyle_part.h
new file mode 100644
index 00000000..bf572dcc
--- /dev/null
+++ b/parts/astyle/astyle_part.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2001 Matthias H�zer-Klpfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_ASTYLE_H__
+#define __KDEVPART_ASTYLE_H__
+
+class KDialogBase;
+#include <kdevsourceformatter.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdevplugin.h>
+#include <kdebug.h>
+#include <qmap.h>
+#include <qvariant.h>
+
+class AStyleWidget;
+class QPopupMenu;
+class Context;
+class ConfigWidgetProxy;
+
+class AStylePart : public KDevSourceFormatter
+{
+ Q_OBJECT
+
+public:
+
+ AStylePart(QObject *parent, const char *name, const QStringList &);
+ ~AStylePart();
+
+ QString formatSource(const QString text, AStyleWidget * widget, const QMap<QString, QVariant>& options);
+ virtual QString formatSource(const QString text);
+ QString indentString() const;
+ void saveGlobal();
+ void setExtensions(QString ext, bool global);
+ QString getProjectExtensions();
+ QString getGlobalExtensions();
+ void restorePartialProjectSession(const QDomElement * el);
+ void savePartialProjectSession(QDomElement * el);
+
+ QMap<QString, QVariant>& getProjectOptions(){return m_project;}
+ QMap<QString, QVariant>& getGlobalOptions(){return m_global;}
+
+
+private slots:
+
+ void activePartChanged(KParts::Part *part);
+ void beautifySource();
+ void formatFiles();
+ void formatFilesSelect();
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+private:
+
+ void cursorPos( KParts::Part *part, uint * col, uint * line );
+ void setCursorPos( KParts::Part *part, uint col, uint line );
+
+ void loadGlobal();
+
+ ConfigWidgetProxy *m_configProxy;
+ KAction *formatTextAction;
+ KAction *formatFileAction;
+
+ // the configurable options.
+ QMap<QString, QVariant> m_project;
+ QMap<QString, QVariant> m_global;
+ QStringList m_projectExtensions;
+ QStringList m_globalExtensions;
+ QMap<QString, QString> m_searchExtensions;
+ KURL::List m_urls;
+};
+
+
+#endif