Kate
katevimodebar.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 * Copyright (C) 2008 Dmitry Suzdalev <dimsuz@gmail.com> 00003 * Copyright (C) 2008 Erlend Hamberg <ehamberg@gmail.com> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) version 3. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KATE_VI_MODE_BAR_H 00022 #define KATE_VI_MODE_BAR_H 00023 00024 #include "kateviewhelpers.h" 00025 #include "kateview.h" 00026 00027 class QLabel; 00028 class QTimer; 00029 class KateViNormalMode; 00030 class KateViInsertMode; 00031 class KateViVisualMode; 00032 00033 class KateViModeBar : public KateViewBarWidget 00034 { 00035 Q_OBJECT 00036 public: 00037 explicit KateViModeBar(KateView* view, QWidget* parent = 0); 00038 ~KateViModeBar(); 00039 00040 void updateViMode(ViMode mode); 00041 void updatePartialCommand(const QString &cmd); 00042 void showMessage(const QString &msg); 00043 void showErrorMessage(const QString &msg); 00044 void clearMessage(); 00045 00046 private Q_SLOTS: 00047 void _clearMessage(); 00048 00049 private: 00050 // move to some common place? seems it may be useful for others. 00051 QString modeToString(ViMode mode) const; 00052 00053 private: 00054 QLabel* m_labelStatus; 00055 QLabel* m_labelMessage; 00056 QLabel* m_labelCommand; 00057 QTimer* m_timer; 00058 }; 00059 00060 #endif