Warning, file /office/calligra/libs/pigment/KoUniqueNumberForIdServer.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (c) 2008 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Lesser General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2.1 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Lesser General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Lesser General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef _KO_UNIQUE_NUMBER_FOR_ID_SERVER_H_ 0021 #define _KO_UNIQUE_NUMBER_FOR_ID_SERVER_H_ 0022 0023 #include <QtGlobal> 0024 #include "pigment_export.h" 0025 0026 class QString; 0027 0028 /** 0029 * This class is used to provide an unique number for a given \ref QString . 0030 * This is useful for fast comparison of Ids, but the number *should* remains private 0031 * especially considering that it changes from one running instance to an other. 0032 */ 0033 class PIGMENTCMS_EXPORT KoUniqueNumberForIdServer 0034 { 0035 public: 0036 KoUniqueNumberForIdServer(); 0037 ~KoUniqueNumberForIdServer(); 0038 0039 static KoUniqueNumberForIdServer* instance(); 0040 /** 0041 * @return an unique number for the given \p _id , for two different call to this function 0042 * with the same \p id the function will always return the same value. 0043 * 0044 * @code 0045 * KoUniqueNumberForIdServer::instance()->numberForId( "rgb" ) == KoUniqueNumberForIdServer::instance()->numberForId( "rgb" ); 0046 * KoUniqueNumberForIdServer::instance()->numberForId( "rgb" ) != KoUniqueNumberForIdServer::instance()->numberForId( "cmyk" ); 0047 * @endcode 0048 */ 0049 quint32 numberForId(const QString&); 0050 private: 0051 struct Private; 0052 Private* const d; 0053 0054 }; 0055 0056 #endif