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

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 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 KASTEN_CREATESTATISTICJOB_HPP
0010 #define KASTEN_CREATESTATISTICJOB_HPP
0011 
0012 // Okteta core
0013 #include <Okteta/AddressRange>
0014 // Qt
0015 #include <QObject>
0016 
0017 namespace Okteta {
0018 class AbstractByteArrayModel;
0019 }
0020 
0021 namespace Kasten {
0022 
0023 class CreateStatisticJob : public QObject // not yet: KJob
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     CreateStatisticJob(const Okteta::AbstractByteArrayModel* model, const Okteta::AddressRange& selection,
0029                        int* byteCount);
0030 
0031 public:
0032     // return size of selected byte array
0033     int exec();
0034 
0035 private:
0036     const Okteta::AbstractByteArrayModel* mByteArrayModel;
0037     const Okteta::AddressRange mSelection;
0038 
0039     int* const mByteCount;
0040 };
0041 
0042 inline CreateStatisticJob::CreateStatisticJob(const Okteta::AbstractByteArrayModel* model,
0043                                               const Okteta::AddressRange& selection,
0044                                               int* byteCount)
0045     : mByteArrayModel(model)
0046     , mSelection(selection)
0047     , mByteCount(byteCount)
0048 {}
0049 
0050 }
0051 
0052 #endif