Warning, file /sdk/cervisia/logmessageedit.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * Copyright (c) 2004 Jason Kivlighn <mizunoami44@users.sourceforge.net>
0003  * Copyright (c) 2005-2007 Christian Loose <christian.loose@kdemail.net>
0004  *
0005  * based on work by Jason Kivlighn (krecipes/src/widgets/kretextedit.h)
0006  *
0007  * This program is free software; you can redistribute it and/or modify
0008  * it under the terms of the GNU General Public License as published by
0009  * the Free Software Foundation; either version 2 of the License, or
0010  * (at your option) any later version.
0011  *
0012  * This program is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015  * GNU General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU General Public License
0018  * along with this program; if not, write to the Free Software
0019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0020  */
0021 
0022 #ifndef CERVISIA_LOGMESSAGEEDIT_H
0023 #define CERVISIA_LOGMESSAGEEDIT_H
0024 
0025 #include <KCompletionBase>
0026 #include <KTextEdit>
0027 
0028 namespace Cervisia
0029 {
0030 
0031 class LogMessageEdit : public KTextEdit, public KCompletionBase
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     explicit LogMessageEdit(QWidget *parent);
0037 
0038     void setCompletedText(const QString &match) override;
0039     void setCompletedItems(const QStringList &items, bool autoSuggest = true) override;
0040 
0041 protected:
0042     void keyPressEvent(QKeyEvent *event) override;
0043     void mousePressEvent(QMouseEvent *event) override;
0044 
0045 private slots:
0046     void stopCompletion();
0047 
0048 private:
0049     void tryCompletion();
0050     void rotateMatches(KeyBindingType type);
0051 
0052     bool m_completing;
0053     int m_completionStartPos;
0054     bool m_checkSpellingEnabledBeforeCompletion;
0055 };
0056 }
0057 
0058 #endif