File indexing completed on 2022-10-04 17:30:24

0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 // SPDX-FileCopyrightText: 2010 Dominik Seichter <domseichter@web.de>
0003 
0004 #ifndef TOKEN_SORT_MODE_DIALOG_H
0005 #define TOKEN_SORT_MODE_DIALOG_H
0006 
0007 #include <QDialog>
0008 
0009 #include "ui_tokensortmodedialog.h"
0010 #include "krenametokensorter.h"
0011 
0012 /**
0013  * This is a dialog to define custom sorting.
0014  */
0015 class TokenSortModeDialog : public QDialog
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit TokenSortModeDialog(KRenameTokenSorter::ESimpleSortMode eSortMode, QWidget *parent = nullptr);
0020 
0021     /**
0022      * Get the currently selected sort mode.
0023      * @returns the sort mode
0024      */
0025     KRenameTokenSorter::ESimpleSortMode getSortMode() const;
0026 
0027     /**
0028      * Get the token selected by the user.
0029      * @returns the token
0030      */
0031     QString getToken() const;
0032 
0033 private:
0034     /**
0035      * Load all available tokens.
0036      */
0037     void initTokens();
0038 
0039 private Q_SLOTS:
0040 
0041     void slotEnableControls();
0042 
0043 private:
0044     Ui::TokenSortModeDialog m_dialog;
0045 };
0046 
0047 #endif // TOKEN_SORT_MODE_DIALOG_H