File indexing completed on 2024-05-26 05:56:36

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2007, 2009 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 KASTEN_SEARCHDIALOG_HPP
0010 #define KASTEN_SEARCHDIALOG_HPP
0011 
0012 // lib
0013 #include <abstractfinddialog.hpp>
0014 // Okteta Kasten gui
0015 #include <Kasten/Okteta/ByteArrayComboBox>
0016 
0017 namespace Kasten {
0018 
0019 class SearchTool;
0020 
0021 class SearchDialog : public AbstractFindDialog
0022 {
0023     Q_OBJECT
0024 
0025 private:
0026     static inline constexpr char ConfigGroupId[] = "SearchTool";
0027 
0028     static inline constexpr char FromCursorConfigKey[] = "FromCursor";
0029     static inline constexpr char DirectionConfigKey[] = "Direction";
0030     static inline constexpr char InSelectionConfigKey[] = "InSelection";
0031     static inline constexpr char SearchDataCodingConfigKey[] = "SearchDataCoding";
0032 
0033     static inline constexpr bool DefaultFromCursor = false;
0034     static inline constexpr Kasten::FindDirection DefaultDirection = Kasten::FindForward;
0035     static inline constexpr bool DefaultInSelection = false;
0036     static inline constexpr Okteta::ByteArrayComboBox::Coding DefaultSearchDataCoding = Okteta::ByteArrayComboBox::HexadecimalCoding;
0037 
0038 public:
0039     explicit SearchDialog(SearchTool* tool, QWidget* parent = nullptr);
0040     ~SearchDialog() override;
0041 
0042 protected: // AbstractFindDialog API
0043     void onFindButtonClicked() override;
0044     void rememberCurrentSettings() override;
0045 
0046 protected: // QWidget API
0047     void showEvent(QShowEvent* showEvent) override;
0048 
0049 private:
0050     SearchTool* mTool;
0051 };
0052 
0053 }
0054 
0055 #endif