File indexing completed on 2025-01-19 03:53:40
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2007-03-22 0007 * Description : database SQL queries helper class 0008 * 0009 * SPDX-FileCopyrightText: 2007-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> 0010 * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_ITEM_QUERY_POST_HOOKS_H 0017 #define DIGIKAM_ITEM_QUERY_POST_HOOKS_H 0018 0019 // Qt includes 0020 0021 #include <QList> 0022 0023 // Local includes 0024 0025 #include "digikam_export.h" 0026 0027 namespace Digikam 0028 { 0029 0030 class Q_DECL_HIDDEN ItemQueryPostHook 0031 { 0032 public: 0033 0034 /// This is the single hook, ItemQueryPostHookS is the container 0035 ItemQueryPostHook() = default; 0036 virtual ~ItemQueryPostHook() = default; 0037 0038 virtual bool checkPosition(double /*latitudeNumber*/, double /*longitudeNumber*/) 0039 { 0040 return true; 0041 }; 0042 0043 private: 0044 0045 Q_DISABLE_COPY(ItemQueryPostHook) 0046 }; 0047 0048 // -------------------------------------------------------------------- 0049 0050 class DIGIKAM_DATABASE_EXPORT ItemQueryPostHooks 0051 { 0052 public: 0053 0054 explicit ItemQueryPostHooks(); 0055 ~ItemQueryPostHooks(); 0056 0057 /** 0058 * Call this method after passing the object to buildQuery 0059 * and executing the statement. Returns true if the search is matched. 0060 */ 0061 bool checkPosition(double latitudeNumber, double longitudeNumber); 0062 0063 /** 0064 * Called by ItemQueryBuilder. Ownership of the object is passed. 0065 */ 0066 void addHook(ItemQueryPostHook* const hook); 0067 0068 protected: 0069 0070 QList<ItemQueryPostHook*> m_postHooks; 0071 }; 0072 0073 } // namespace Digikam 0074 0075 #endif // DIGIKAM_ITEM_QUERY_POST_HOOKS_H