diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kexi/widget/kexieditor.h | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/widget/kexieditor.h')
-rw-r--r-- | kexi/widget/kexieditor.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/kexi/widget/kexieditor.h b/kexi/widget/kexieditor.h new file mode 100644 index 00000000..fce5f45b --- /dev/null +++ b/kexi/widget/kexieditor.h @@ -0,0 +1,120 @@ +/* This file is part of the KDE project + Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at> + Copyright (C) 2004-2005 Jaroslaw Staniek <js@iidea.pl> + Copyright (C) 2005 Cedric Pasteur <cedric.pasteur@free.fr> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#ifndef KEXIEDITOR_H +#define KEXIEDITOR_H + +#include <qwidget.h> +#include "kexiviewbase.h" + +class KTextEdit; +class KexiEditorPrivate; + +namespace KTextEditor +{ + class Document; + class View; +} + +//! An text editor view that uses both KTextEditor and KTextEdit +/*! It is used for SQL and script editor. */ +class KEXIEXTWIDGETS_EXPORT KexiEditor : public KexiViewBase +{ + Q_OBJECT + + public: + + /** + * Constructor. + * + * \param mainWin The \a KexiMainWindow instance this KexiEditor + * belongs too. + * \param parent The parent \a QWidget this KexiEditor is child + * of. You don't need to free the KexiEditor cause Qt + * will handle that for us. + * \param name The name this KexiEditor has. Used only for debugging. + */ + KexiEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0); + + /** + * Destructor. + */ + virtual ~KexiEditor(); + + /** + * \return true if internally the KTextEditor::EditorChooser got + * used else, if a simple KTextEdit is used, false is returned. + */ + static bool isAdvancedEditor(); + + /** + * \return the text displayed in the editor-widget. + */ + QString text(); + + /** + * Set the highlight-mode to \p highlightmodename . If + * \a isAdvancedEditor returns false (KTextEdit is used + * rather then KTextEditor), then the method just does + * nothing. The \p highlightmodename could be any kind + * of string like e.g. "python", "kjs" or "sql" + * KTextEditor supports. + */ + void setHighlightMode(const QString& highlightmodename); + + /** + * Find row and column for this \p character and jump to the + * position. + */ + void jump(int character); + + /** + * Set the cursor position to \p line and \p col . + */ + void setCursorPosition(int line, int col); + + /** + * Clear all remembered undo/redo-actions. Only + * avaiable if \a isAdvancedEditor returns true. + */ + void clearUndoRedo(); + + public slots: + /*! Sets editor's text to \a text. 'Dirty' flag remains unchanged. + Undo/redo buffer is cleared.*/ + void setText(const QString &text); + /*! Display the configuration-dialog. Only avaiable if isAdvancedEditor() returns true. */ + void slotConfigureEditor(); + + protected: + /*! Update the actions. This call is redirected to \a KexiViewBase::updateActions */ + virtual void updateActions(bool activated); + + signals: + /*! Emitted if the text displayed in the editor changed. */ + void textChanged(); + + private: + /*! Private d-pointer class. */ + KexiEditorPrivate *d; +}; + +#endif |