|
|
/*
|
|
|
* 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 <tqmap.h>
|
|
|
#include <tqvariant.h>
|
|
|
|
|
|
class AStyleWidget;
|
|
|
class TQPopupMenu;
|
|
|
class Context;
|
|
|
class ConfigWidgetProxy;
|
|
|
|
|
|
class AStylePart : public KDevSourceFormatter
|
|
|
{
|
|
|
Q_OBJECT
|
|
|
TQ_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
AStylePart(TQObject *tqparent, const char *name, const TQStringList &);
|
|
|
~AStylePart();
|
|
|
|
|
|
TQString formatSource(const TQString text, AStyleWidget * widget, const TQMap<TQString, TQVariant>& options);
|
|
|
virtual TQString formatSource(const TQString text);
|
|
|
TQString indentString() const;
|
|
|
void saveGlobal();
|
|
|
void setExtensions(TQString ext, bool global);
|
|
|
TQString getProjectExtensions();
|
|
|
TQString getGlobalExtensions();
|
|
|
void restorePartialProjectSession(const TQDomElement * el);
|
|
|
void savePartialProjectSession(TQDomElement * el);
|
|
|
|
|
|
TQMap<TQString, TQVariant>& getProjectOptions(){return m_project;}
|
|
|
TQMap<TQString, TQVariant>& getGlobalOptions(){return m_global;}
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void activePartChanged(KParts::Part *part);
|
|
|
void beautifySource();
|
|
|
void formatFiles();
|
|
|
void formatFilesSelect();
|
|
|
void insertConfigWidget(const KDialogBase *dlg, TQWidget *page, unsigned int pageNo);
|
|
|
void contextMenu(TQPopupMenu *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.
|
|
|
TQMap<TQString, TQVariant> m_project;
|
|
|
TQMap<TQString, TQVariant> m_global;
|
|
|
TQStringList m_projectExtensions;
|
|
|
TQStringList m_globalExtensions;
|
|
|
TQMap<TQString, TQString> m_searchExtensions;
|
|
|
KURL::List m_urls;
|
|
|
};
|
|
|
|
|
|
|
|
|
#endif
|