File indexing completed on 2024-05-12 15:59:15
0001 /* 0002 * SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 0007 #ifndef _KIS_META_DATA_MERGE_STRATEGY_H_ 0008 #define _KIS_META_DATA_MERGE_STRATEGY_H_ 0009 0010 #include <QList> 0011 0012 #include <kritametadata_export.h> 0013 0014 class QString; 0015 0016 namespace KisMetaData 0017 { 0018 class Store; 0019 /** 0020 * This is an interface which serves as a base class for meta data store merge 0021 * strategy. 0022 * This is used to decide which entries of a metadata store is kept, or how they 0023 * are modified when a list of meta data stores are merged together. 0024 */ 0025 class KRITAMETADATA_EXPORT MergeStrategy 0026 { 0027 public: 0028 virtual ~MergeStrategy(); 0029 /// @return the id of this merge strategy 0030 virtual QString id() const = 0; 0031 /// @return the name of this merge strategy 0032 virtual QString name() const = 0; 0033 /// @return a description of this merge strategy 0034 virtual QString description() const = 0; 0035 /** 0036 * Call this function to merge a list of meta data stores in one. 0037 * @param dst the destination store 0038 * @param srcs the list of source meta data store 0039 * @param scores a list of score which defines the importance of each store compared to the other 0040 * the sum of score is expected to be equal to 1.0. 0041 * One way to attribute a score is to compute the area of each layer and then 0042 * to give a higher score to the biggest layer. 0043 * srcs and scores list must have the same size. 0044 */ 0045 virtual void merge(Store* dst, QList<const Store*> srcs, QList<double> scores) const = 0; 0046 }; 0047 0048 } 0049 0050 #endif