File indexing completed on 2024-04-28 05:52:37

0001 /*
0002     This file is part of the Okteta Gui library, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2004, 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef OKTETA_TABCONTROLLER_HPP
0010 #define OKTETA_TABCONTROLLER_HPP
0011 
0012 // lib
0013 #include "abstractcontroller.hpp"
0014 
0015 namespace Okteta {
0016 class AbstractByteArrayView;
0017 
0018 class TabController : public AbstractController
0019 {
0020 public:
0021     TabController(AbstractByteArrayView* view, AbstractController* parent);
0022 
0023 public: // AbstractController API
0024     bool handleKeyPress(QKeyEvent* keyEvent) override;
0025 
0026 public:
0027     bool tabChangesFocus() const;
0028     /// default is true
0029     void setTabChangesFocus(bool tabChangesFocus);
0030 
0031 private:
0032     AbstractByteArrayView* mView;
0033     /** flag if tab key should be ignored */
0034     bool mTabChangesFocus : 1;
0035 };
0036 
0037 inline bool TabController::tabChangesFocus()    const { return mTabChangesFocus; }
0038 inline void TabController::setTabChangesFocus(bool tabChangesFocus) { mTabChangesFocus = tabChangesFocus; }
0039 
0040 }
0041 
0042 #endif