File: kfilereplacepart.h

package info (click to toggle)
kdewebdev 1%3A3.3.2-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,200 kB
  • ctags: 13,047
  • sloc: cpp: 165,029; sh: 9,033; perl: 3,315; makefile: 1,618; xml: 497; ansic: 83
file content (112 lines) | stat: -rw-r--r-- 2,573 bytes parent folder | download
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
//
// C++ Interface: kfilereplacepart
//
// Description:
//
//
// Author: Andras Mantia <amantia@kde.org>, (C) 2003
// Maintainer: Emiliano Gulmini <emi_barbarossa@yahoo.it>, (C) 2004
//
// Copyright: GPL v2. See COPYING file that comes with this distribution
//
//

#ifndef KFILEREPLACEPART_H
#define KFILEREPLACEPART_H

//kde includes
#include <kparts/part.h>

//app includes
#include "apistruct.h"

class QStringList;
class QDateTime;

class KAboutData;
class KConfig;

class KAboutKFileReplace;
class KFileReplaceDoc;
class KFileReplaceView;

// Global Thread data
extern bool g_bThreadRunning;
extern bool g_bThreadMustStop;
extern int g_nFilesRep;
extern RepDirArg g_argu;
extern QString g_szErrMsg;
extern int g_nStringsRep;
extern int g_nOperation;

class KFileReplacePart: public KParts::ReadOnlyPart
{
  Q_OBJECT

public:
  KFileReplacePart(QWidget *parentWidget, const char *widgetName,
                   QObject *parent, const char *name, const QStringList &args);
  virtual ~KFileReplacePart();

  static KAboutData* createAboutData();
  KFileReplaceDoc* document() const;
  KConfig *config();
  
public slots:
  void slotFileNew();
  void slotFileSearch();
  void slotFileReplace();
  void slotFileSimulate();
  void slotFileStop();
  void slotFileSave();
  void slotStringsAdd();
  void slotStringsDel();
  void slotStringsEmpty();
  void slotStringsEdit();
  void slotStringsSave();
  void slotStringsLoad();
  void slotStringsInvertCur();
  void slotStringsInvertAll();
  void slotOpenRecentStringFile(const KURL& urlFile);
  void slotOptionsRecursive();
  void slotOptionsBackup();
  void slotOptionsCaseSensitive();
  void slotOptionsWildcards();
  void slotOptionsVariables();
  void slotOptionsPreferences();
  void showAboutApplication(void);
  void appHelpActivated();
  void reportBug();



protected:
  virtual bool openFile() {return false;}
  virtual bool openURL (const KURL &url);

  void initDocument();
  void initView();
  void initGUI();
  void loadStringFile(const QString& strFilename);
  void readOptions();
  void saveOptions();
  void updateCommands();
  int  checkBeforeOperation(int nTypeOfOperation);
  void setWhatsThis();
private:

  KFileReplaceView* m_view;
  KFileReplaceDoc* m_doc;
  QWidget* m_parentWidget;
  /** the configuration object of the application */
  KConfig* m_config;
  Settings m_settings;
  QStringList m_recentStringFileList; // a list of recently accessed files
  KAboutKFileReplace* m_dlgAbout;
  
private:
  void convertOldToNewKFRFormat(const QString& strFilename,KFileReplaceView* view);
};

#endif