fileplugin.h (krename-4.0.9) | : | fileplugin.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 _FILE_PLUGIN_H_ | #ifndef FILE_PLUGIN_H | |||
#define _FILE_PLUGIN_H_ | #define FILE_PLUGIN_H | |||
#include "plugin.h" | #include "plugin.h" | |||
class KService; | class KService; | |||
class FilePlugin : public Plugin { | class FilePlugin : public Plugin | |||
public: | { | |||
public: | ||||
/** Create a new FilePlugin from a KService | /** Create a new FilePlugin from a KService | |||
* | * | |||
* @param service pointer to a KService | * @param service pointer to a KService | |||
*/ | */ | |||
FilePlugin( PluginLoader* loader, KService* service ); | FilePlugin(PluginLoader *loader, KService *service); | |||
virtual ~FilePlugin(); | virtual ~FilePlugin(); | |||
/** | /** | |||
* @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. | |||
*/ | */ | |||
inline virtual const QString name() const; | inline virtual const QString name() const; | |||
/** | /** | |||
skipping to change at line 86 | skipping to change at line 87 | |||
* 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 ) = 0; | virtual QString processFile(BatchRenamer *b, int index, const QString &filen ameOrToken, EPluginType eCurrentType) = 0; | |||
/** 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. | * @returns a list of all supported tokens. | |||
*/ | */ | |||
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 | |||
* | * | |||
* This is implemented here for all FilePlugin based classed | * This is implemented here for all FilePlugin based classed | |||
*/ | */ | |||
void createUI( QWidget* parent ) const; | void createUI(QWidget *parent) const; | |||
protected: | protected: | |||
FilePlugin( PluginLoader* loader ); | FilePlugin(PluginLoader *loader); | |||
/** | /** | |||
* Checks if a token is supported by this plugin. | * Checks if a token is supported by this plugin. | |||
* | * | |||
* @param token a token | * @param token a token | |||
* @returns true if the token is supported | * @returns true if the token is supported | |||
* | * | |||
* @see addSupportedToken | * @see addSupportedToken | |||
*/ | */ | |||
bool supports( const QString & token ); | bool supports(const QString &token); | |||
/** | /** | |||
* Adds a token to the list of supported tokens | * Adds a token to the list of supported tokens | |||
* | * | |||
* @param token will be a supported token from now on | * @param token will be a supported token from now on | |||
* | * | |||
* @see supports | * @see supports | |||
*/ | */ | |||
inline void addSupportedToken( const QString & token ) { | inline void addSupportedToken(const QString &token) | |||
m_keys.append( token ); | { | |||
m_keys.append(token); | ||||
} | } | |||
protected: | protected: | |||
QString m_name; | QString m_name; | |||
QString m_comment; | QString m_comment; | |||
QString m_icon; | QString m_icon; | |||
private: | private: | |||
QStringList m_keys; | QStringList m_keys; | |||
}; | }; | |||
inline const QString FilePlugin::name() const | inline const QString FilePlugin::name() const | |||
{ | { | |||
return m_name; | return m_name; | |||
} | } | |||
inline bool FilePlugin::alwaysEnabled() const | inline bool FilePlugin::alwaysEnabled() const | |||
{ | { | |||
return true; | return true; | |||
} | } | |||
inline int FilePlugin::type() const | inline int FilePlugin::type() const | |||
{ | { | |||
return ePluginType_Token; | return ePluginType_Token; | |||
} | } | |||
inline const QStringList & FilePlugin::supportedTokens() const | inline const QStringList &FilePlugin::supportedTokens() const | |||
{ | { | |||
return m_keys; | return m_keys; | |||
} | } | |||
inline const QStringList & FilePlugin::help() const | inline const QStringList &FilePlugin::help() const | |||
{ | { | |||
return m_keys; | return m_keys; | |||
} | } | |||
#endif // _FILE_PLUGIN_H_ | #endif // FILE_PLUGIN_H | |||
End of changes. 15 change blocks. | ||||
18 lines changed or deleted | 20 lines changed or added |