digiKam
itemsortcollator.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2020-10-11
7  * Description : item sort based on QCollator
8  *
9  * Copyright (C) 2020 by Maik Qualmann <metzpinguin at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_ITEM_SORT_COLLATOR_H
25 #define DIGIKAM_ITEM_SORT_COLLATOR_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QString>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 namespace Digikam
37 {
38 
39 class DIGIKAM_DATABASE_EXPORT ItemSortCollator : public QObject
40 {
41  Q_OBJECT
42 
43 public:
44 
49  static ItemSortCollator* instance();
50 
51  int itemCompare(const QString& a, const QString& b,
52  Qt::CaseSensitivity caseSensitive, bool natural) const;
53 
54  int albumCompare(const QString& a, const QString& b,
55  Qt::CaseSensitivity caseSensitive, bool natural) const;
56 
57 private:
58 
59  // Disable
61  explicit ItemSortCollator(QObject*) = delete;
62  ~ItemSortCollator() override;
63 
64 private:
65 
66  class Private;
67  Private* const d;
68 
69  friend class ItemSortCollatorCreator;
70 };
71 
72 } // namespace Digikam
73 
74 #endif // DIGIKAM_ITEM_SORT_COLLATOR_H
Definition: itemsortcollator.h:40
Definition: datefolderview.cpp:43