Commit 1170457c authored by Dominik Haumann's avatar Dominik Haumann

astyle: format code

parent a23814ba
/***************************************************************************
pluginKatexmltools.cpp
copyright : (C) 2001-2002 by Daniel Naber
email : daniel.naber@t-online.de
***************************************************************************/
/***************************************************************************
pluginKatexmltools.cpp
copyright : (C) 2001-2002 by Daniel Naber
email : daniel.naber@t-online.de
***************************************************************************/
/***************************************************************************
This program is free software; you can redistribute it and/or
......@@ -43,78 +43,78 @@
class PluginKateXMLTools : public KTextEditor::Plugin
{
Q_OBJECT
Q_OBJECT
public:
explicit PluginKateXMLTools( QObject* parent = 0, const QVariantList& = QVariantList() );
public:
explicit PluginKateXMLTools(QObject *parent = 0, const QVariantList& = QVariantList());
~PluginKateXMLTools();
virtual QObject *createView(KTextEditor::MainWindow *mainWindow);
};
class PluginKateXMLToolsCompletionModel
: public KTextEditor::CodeCompletionModel
, public KTextEditor::CodeCompletionModelControllerInterface
: public KTextEditor::CodeCompletionModel
, public KTextEditor::CodeCompletionModelControllerInterface
{
Q_OBJECT
Q_INTERFACES(KTextEditor::CodeCompletionModelControllerInterface)
Q_OBJECT
Q_INTERFACES(KTextEditor::CodeCompletionModelControllerInterface)
public:
PluginKateXMLToolsCompletionModel( QObject *parent );
public:
PluginKateXMLToolsCompletionModel(QObject *parent);
virtual ~PluginKateXMLToolsCompletionModel();
//
// KTextEditor::CodeCompletionModel
//
public:
virtual int columnCount(const QModelIndex&) const;
//
// KTextEditor::CodeCompletionModel
//
public:
virtual int columnCount(const QModelIndex &) const;
virtual int rowCount(const QModelIndex &parent) const;
virtual QModelIndex parent(const QModelIndex& index) const;
virtual QModelIndex index(int row, int column, const QModelIndex& parent) const;
virtual QModelIndex parent(const QModelIndex &index) const;
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const;
virtual QVariant data(const QModelIndex &idx, int role) const;
virtual void executeCompletionItem(KTextEditor::View *view,
const KTextEditor::Range &word,
const QModelIndex &index) const;
//
// KTextEditor::CodeCompletionModelControllerInterface
//
public:
//
// KTextEditor::CodeCompletionModelControllerInterface
//
public:
virtual bool shouldStartCompletion(KTextEditor::View *view,
const QString &insertedText,
bool userInsertion,
const KTextEditor::Cursor &position);
public Q_SLOTS:
public Q_SLOTS:
void getDTD();
void slotInsertElement();
void slotCloseElement();
void slotFinished( KJob *job );
void slotData( KIO::Job *, const QByteArray &data );
void slotFinished(KJob *job);
void slotData(KIO::Job *, const QByteArray &data);
void completionInvoked( KTextEditor::View *kv, const KTextEditor::Range &range, InvocationType invocationType );
void completionInvoked(KTextEditor::View *kv, const KTextEditor::Range &range, InvocationType invocationType);
/// Connected to the document manager, to manage the dtd collection.
void slotDocumentDeleted( KTextEditor::Document *doc );
void slotDocumentDeleted(KTextEditor::Document *doc);
protected:
protected:
QString currentModeToString() const;
static QStringList sortQStringList( QStringList list );
static QStringList sortQStringList(QStringList list);
//bool eventFilter( QObject *object, QEvent *event );
QString insideTag( KTextEditor::View &kv );
QString insideAttribute( KTextEditor::View &kv );
QString insideTag(KTextEditor::View &kv);
QString insideAttribute(KTextEditor::View &kv);
static bool isOpeningTag( const QString& tag );
static bool isClosingTag( const QString& tag );
static bool isEmptyTag( const QString& tag );
static bool isQuote( const QString& ch );
static bool isOpeningTag(const QString &tag);
static bool isClosingTag(const QString &tag);
static bool isEmptyTag(const QString &tag);
static bool isQuote(const QString &ch);
QString getParentElement( KTextEditor::View &view, int skipCharacters );
QString getParentElement(KTextEditor::View &view, int skipCharacters);
enum Mode {none, entities, attributevalues, attributes, elements, closingtag};
enum PopupMode {noPopup, tagname, attributename, attributevalue, entityname};
......@@ -137,7 +137,7 @@ class PluginKateXMLToolsCompletionModel
int m_correctPos;
// code completion stuff:
KTextEditor::CodeCompletionInterface* m_codeInterface;
KTextEditor::CodeCompletionInterface *m_codeInterface;
/// maps KTE::Document -> DTD
QHash<KTextEditor::Document *, PseudoDTD *> m_docDtds;
......@@ -148,14 +148,14 @@ class PluginKateXMLToolsCompletionModel
class PluginKateXMLToolsView : public QObject, public KXMLGUIClient
{
Q_OBJECT
Q_OBJECT
public:
public:
explicit PluginKateXMLToolsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin);
virtual ~PluginKateXMLToolsView();
protected:
protected:
KTextEditor::MainWindow *m_mainWindow;
PluginKateXMLToolsCompletionModel m_model;
};
......@@ -163,17 +163,17 @@ class PluginKateXMLToolsView : public QObject, public KXMLGUIClient
class InsertElement : public KDialog
{
Q_OBJECT
Q_OBJECT
public:
InsertElement( QWidget *parent, const char *name );
public:
InsertElement(QWidget *parent, const char *name);
~InsertElement();
QString showDialog( QStringList &completions );
private Q_SLOTS:
void slotHistoryTextChanged( const QString& );
QString showDialog(QStringList &completions);
private Q_SLOTS:
void slotHistoryTextChanged(const QString &);
};
#endif // PLUGIN_KATEXMLTOOLS_H
// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
// kate: space-indent on; indent-width 4; replace-tabs on; mixed-indent off;
This diff is collapsed.
/***************************************************************************
pseudoDtd.cpp
copyright : (C) 2001-2002 by Daniel Naber
email : daniel.naber@t-online.de
***************************************************************************/
/***************************************************************************
pseudoDtd.cpp
copyright : (C) 2001-2002 by Daniel Naber
email : daniel.naber@t-online.de
***************************************************************************/
/***************************************************************************
This program is free software; you can redistribute it and/or
......@@ -33,7 +33,7 @@
*/
class ElementAttributes
{
public:
public:
QStringList optionalAttributes;
QStringList requiredAttributes;
};
......@@ -41,38 +41,38 @@ class ElementAttributes
class PseudoDTD
{
public:
public:
PseudoDTD();
~PseudoDTD();
void analyzeDTD( QString &metaDtdUrl, QString &metaDtd );
void analyzeDTD(QString &metaDtdUrl, QString &metaDtd);
QStringList allowedElements( QString parentElement );
QStringList allowedAttributes( QString parentElement );
QStringList attributeValues( QString element, QString attribute );
QStringList entities( QString start );
QStringList requiredAttributes( const QString &parentElement ) const;
QStringList allowedElements(QString parentElement);
QStringList allowedAttributes(QString parentElement);
QStringList attributeValues(QString element, QString attribute);
QStringList entities(QString start);
QStringList requiredAttributes(const QString &parentElement) const;
protected:
protected:
bool parseElements( QDomDocument *doc, QProgressDialog *progress );
bool parseAttributes( QDomDocument *doc, QProgressDialog *progress );
bool parseAttributeValues( QDomDocument *doc, QProgressDialog *progress );
bool parseEntities( QDomDocument *doc, QProgressDialog *progress );
bool parseElements(QDomDocument *doc, QProgressDialog *progress);
bool parseAttributes(QDomDocument *doc, QProgressDialog *progress);
bool parseAttributeValues(QDomDocument *doc, QProgressDialog *progress);
bool parseEntities(QDomDocument *doc, QProgressDialog *progress);
bool m_sgmlSupport;
// Entities, e.g. <"nbsp", "160">
QMap<QString,QString> m_entityList;
QMap<QString, QString> m_entityList;
// Elements, e.g. <"a", ( "b", "i", "em", "strong" )>
QMap<QString,QStringList> m_elementsList;
QMap<QString, QStringList> m_elementsList;
// Attributes e.g. <"a", ( "href", "lang", "title" )>
QMap<QString,ElementAttributes> m_attributesList;
QMap<QString, ElementAttributes> m_attributesList;
// Attribute values e.g. <"td", <"align", ( "left", "right", "justify" )>>
QMap< QString,QMap<QString,QStringList> > m_attributevaluesList;
QMap< QString, QMap<QString, QStringList> > m_attributevaluesList;
};
#endif // PSEUDO_DTD_H
// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
// kate: space-indent on; indent-width 4; replace-tabs on; mixed-indent off;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment