increasecounterplugin.h (krename-4.0.9) | : | increasecounterplugin.h (krename-4.90.90) | ||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
/*************************************************************************** | /*************************************************************************** | |||
* * | * * | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
***************************************************************************/ | ***************************************************************************/ | |||
#ifndef _INCREASE_COUNTER_PLUGIN_H_ | #ifndef INCREASE_COUNTER_PLUGIN_H | |||
#define _INCREASE_COUNTER_PLUGIN_H_ | #define INCREASE_COUNTER_PLUGIN_H | |||
#include <plugin.h> | #include <plugin.h> | |||
namespace Ui { | namespace Ui | |||
class IncreaseCounterPluginWidget; | { | |||
class IncreaseCounterPluginWidget; | ||||
}; | }; | |||
/** This is the abstract interface that has to be implemented | /** This is the abstract interface that has to be implemented | |||
* by all KRename plugins. | * by all KRename plugins. | |||
*/ | */ | |||
class IncreaseCounterPlugin : public QObject, public Plugin { | class IncreaseCounterPlugin : public QObject, public Plugin | |||
{ | ||||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
IncreaseCounterPlugin( PluginLoader* loader ); | explicit IncreaseCounterPlugin(PluginLoader *loader); | |||
virtual ~IncreaseCounterPlugin(); | virtual ~IncreaseCounterPlugin(); | |||
/** | /** | |||
* @returns a name of the plugin that can be displayed | * @returns a name of the plugin that can be displayed | |||
* to the user. This name should be internationalized. | * to the user. This name should be internationalized. | |||
*/ | */ | |||
virtual const QString name() const; | virtual const QString name() const; | |||
/** | /** | |||
* Determines the type of the plugin. | * Determines the type of the plugin. | |||
skipping to change at line 92 | skipping to change at line 94 | |||
* in brackets. If your plugin supports the token [ex ample], | * in brackets. If your plugin supports the token [ex ample], | |||
* KRename will pass the strign "example" to your met hod. | * KRename will pass the strign "example" to your met hod. | |||
* @param eCurrentType the current type of plugin that is requested (for plu gins that support more than one type) | * @param eCurrentType the current type of plugin that is requested (for plu gins that support more than one type) | |||
* | * | |||
* @returns the result of the function, depending on type(). | * @returns the result of the function, depending on type(). | |||
* @returns QString::null if this plugin has nothing to do. | * @returns QString::null if this plugin has nothing to do. | |||
* @returns A new filename if type is ePluginType_Filename | * @returns A new filename if type is ePluginType_Filename | |||
* @returns the value of the token if type is ePluginType_Token | * @returns the value of the token if type is ePluginType_Token | |||
* @returns an error message or QString::null if type is ePluginType_File | * @returns an error message or QString::null if type is ePluginType_File | |||
*/ | */ | |||
virtual QString processFile( BatchRenamer* b, int index, const QString & fil enameOrToken, EPluginType eCurrentType ); | virtual QString processFile(BatchRenamer *b, int index, const QString &filen ameOrToken, EPluginType eCurrentType); | |||
/** Get a list of all tokens supported by this plugin. | /** Get a list of all tokens supported by this plugin. | |||
* | * | |||
* If the token type != ePluginType_Token you have to return an empty list | * If the token type != ePluginType_Token you have to return an empty list | |||
* | * | |||
* @returns a list of all supported tokens. The returned strings will be tr eated | * @returns a list of all supported tokens. The returned strings will be tr eated | |||
* as regular expressions to find a plugin which supports a token. | * as regular expressions to find a plugin which supports a token. | |||
*/ | */ | |||
inline virtual const QStringList & supportedTokens() const; | inline virtual const QStringList &supportedTokens() const; | |||
/** Returns help descriptions for the supported tokens | /** Returns help descriptions for the supported tokens | |||
* | * | |||
* The returned stringlist contains strings that are the tokens | * The returned stringlist contains strings that are the tokens | |||
* and the description separated by ;; | * and the description separated by ;; | |||
* | * | |||
* @returns a stringlist containing help on the supported tokens | * @returns a stringlist containing help on the supported tokens | |||
*/ | */ | |||
inline virtual const QStringList & help() const; | inline virtual const QStringList &help() const; | |||
/** Create a user interface for this plugin | /** Create a user interface for this plugin | |||
* | * | |||
* @param parent the parent widget of this plugin | * @param parent the parent widget of this plugin | |||
*/ | */ | |||
virtual void createUI( QWidget* parent ) const; | virtual void createUI(QWidget *parent) const; | |||
private slots: | private Q_SLOTS: | |||
/** | /** | |||
* Called when the user changes the offset through the UI | * Called when the user changes the offset through the UI | |||
* | * | |||
* @param offset the new offset | * @param offset the new offset | |||
*/ | */ | |||
void slotOffsetChanged( int offset ); | void slotOffsetChanged(int offset); | |||
private: | private: | |||
Ui::IncreaseCounterPluginWidget* m_widget; | Ui::IncreaseCounterPluginWidget *m_widget; | |||
int m_offset; ///< Increase counter by this offset | int m_offset; ///< Increase counter by this offset | |||
QStringList m_tmp; ///< Dummy empty list so that we can return a referenc e for supported tokens and help | QStringList m_tmp; ///< Dummy empty list so that we can return a referenc e for supported tokens and help | |||
QStringList m_users; ///< List of all usernames on the system | QStringList m_users; ///< List of all usernames on the system | |||
QStringList m_groups; ///< List of all groups on the system | QStringList m_groups; ///< List of all groups on the system | |||
}; | }; | |||
inline int IncreaseCounterPlugin::type() const | inline int IncreaseCounterPlugin::type() const | |||
{ | { | |||
return ePluginType_Filename; | return ePluginType_Filename; | |||
} | } | |||
inline bool IncreaseCounterPlugin::alwaysEnabled() const | inline bool IncreaseCounterPlugin::alwaysEnabled() const | |||
{ | { | |||
return false; | return false; | |||
} | } | |||
inline const QStringList & IncreaseCounterPlugin::supportedTokens() const | inline const QStringList &IncreaseCounterPlugin::supportedTokens() const | |||
{ | { | |||
return m_tmp; | return m_tmp; | |||
} | } | |||
inline const QStringList & IncreaseCounterPlugin::help() const | inline const QStringList &IncreaseCounterPlugin::help() const | |||
{ | { | |||
return m_tmp; | return m_tmp; | |||
} | } | |||
#endif // _INCREASE_COUNTER_PLUGIN_H_ | #endif // INCREASE_COUNTER_PLUGIN_H | |||
End of changes. 15 change blocks. | ||||
18 lines changed or deleted | 20 lines changed or added |