summaryrefslogtreecommitdiffstats
path: root/krename/plugin.h
blob: d7ee3176d25f5f9075df9f8797ed3cc3cf284333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************
                          plugin.h  -  description
                             -------------------
    begin                : Sun Dec 30 2001
    copyright            : (C) 2001 by Dominik Seichter
    email                : domseichter@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PLUGIN_H
#define PLUGIN_H

#include "batchrenamer.h"

#include <tqobject.h>

class HelpDialogData;

class TQString;
class TQStringList;
class TQWidget;
class TQVBoxLayout;
class Plugin : public TQObject {
    Q_OBJECT
  
    public:
        Plugin();
        virtual ~Plugin();

        virtual const TQString getName() const = 0;
        virtual const TQString getAccelName() const = 0;
        virtual const TQString getPattern() const;
        virtual const int type() const = 0;
        virtual bool alwaysUsed() const;

        virtual bool checkError() = 0;
        virtual void drawInterface( TQWidget* w, TQVBoxLayout* l ) = 0;
        virtual void fillStructure() { }
        virtual TQString processFile( BatchRenamer* b, int i, TQString token, int mode ) = 0;
        virtual void finished() { }
        
        virtual void addHelp( HelpDialogData* data );
        virtual void removeHelp(  HelpDialogData* data );

        virtual void clearCache();
        
        virtual const TQPixmap getIcon() const;
        virtual const TQStringList getKeys() const;
        
     signals:
        void previewChanged( Plugin* plugin );
        
     protected slots:
        // call this method when your plugin settings changed 
        // in a way, that KRename should update its preview
        void updatePreview()
        {
            emit previewChanged( this );
        }

     protected:
        TQWidget* m_widget;
};

#endif