summaryrefslogtreecommitdiffstats
path: root/part/kxe_viewelement.h
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2016-03-26 13:50:43 +0100
committerSlávek Banko <[email protected]>2016-03-26 13:50:43 +0100
commitd62c8c002c51fb7c36487839eeeb4ac89f044dee (patch)
treebb4d1f5c631ab1f22a3018ba39e6a806035f80fd /part/kxe_viewelement.h
downloadkxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.tar.gz
kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.zip
Initial import of kxmleditor 1.1.4
Diffstat (limited to 'part/kxe_viewelement.h')
-rw-r--r--part/kxe_viewelement.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/part/kxe_viewelement.h b/part/kxe_viewelement.h
new file mode 100644
index 0000000..bac7669
--- /dev/null
+++ b/part/kxe_viewelement.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ kxe_viewelement.h - description
+ -------------------
+ begin : Mon Oct 15 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXE_VIEWELEMENT_H
+#define KXE_VIEWELEMENT_H
+
+#include <qsplitter.h>
+
+#include <qdom.h>
+
+// forward declarations
+class KXE_ViewAttributes;
+class KTextEdit;
+class KConfig;
+class KXESyntaxHighlighter;
+
+
+/**
+ * This widget shows a table of XML elements attributes
+ * and plain XML text of this element and its children.
+ *
+ * @short Widget for XML elements.
+ */
+class KXE_ViewElement : public QSplitter
+{
+ Q_OBJECT
+
+ public:
+
+ KXE_ViewElement( QWidget * pParent, KConfig *pConfig, const char * pszName = 0 );
+ ~KXE_ViewElement();
+
+ /** Returns a pointer to the currently selected attribute or a null pointer. */
+ QDomAttr getSelectedAttribute() const;
+
+ /** Changes the behaviour of this view to readonly or readwrite. */
+ void setReadWrite( bool fReadWrite );
+
+ public slots:
+
+ /** Changes/Rebuilds the whole widget according to the given element. */
+ void slotChange( const QDomElement & );
+
+ /**
+ * Changes syntax highlighting colors.
+ */
+ void slotTextViewSettingsChanged();
+
+ protected:
+
+ /** table widget to display XML attributes */
+ KXE_ViewAttributes * m_pViewAttributes;
+ /** edit widget for plain XML */
+ KTextEdit * m_pViewPlainXML;
+
+ /** configuration used to store splitter sizes */
+ KConfig *m_pConfig;
+
+ /** Syntax highlighter for m_pViewPlainXML */
+ KXESyntaxHighlighter *m_pSyntaxHighlighter;
+
+ signals:
+
+ /** Emitted, when a context menu is requested (see @ref KXE_ViewAttributes::sigContextMenuRequested) */
+ void sigContextMenuRequested( const QString & szMenuName, const QPoint & pos );
+
+ /**
+ * Emitted, when an attributes name was renamed via inplace editing
+ * (see @ref KXE_ViewAttributes::sigAttributeChangedInplace).
+ */
+ void sigAttributeNameChangedInplace( const QDomAttr &, const QString );
+
+ /**
+ * Emitted, when an attributes value was renamed via inplace editing
+ * (see @ref KXE_ViewAttributes::sigAttributeChangedInplace).
+ */
+ void sigAttributeValueChangedInplace( const QDomAttr &, const QString );
+};
+
+#endif