summaryrefslogtreecommitdiffstats
path: root/kfilereplace/kfilereplacepart.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite9ae80694875f869892f13f4fcaf1170a00dea41 (patch)
treeaa2f8d8a217e2d376224c8d46b7397b68d35de2d /kfilereplace/kfilereplacepart.h
downloadtdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz
tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfilereplace/kfilereplacepart.h')
-rw-r--r--kfilereplace/kfilereplacepart.h159
1 files changed, 159 insertions, 0 deletions
diff --git a/kfilereplace/kfilereplacepart.h b/kfilereplace/kfilereplacepart.h
new file mode 100644
index 00000000..1c133cb5
--- /dev/null
+++ b/kfilereplace/kfilereplacepart.h
@@ -0,0 +1,159 @@
+//
+//
+// 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
+
+// QT
+
+// KDE
+#include <kparts/part.h>
+class KAboutApplication;
+class KAboutData;
+class KConfig;
+
+// local
+#include "configurationclasses.h"
+class KFileReplaceView;
+
+#define KFR_VERSION "0.8.1"
+
+class KFileReplacePart: public KParts::ReadOnlyPart
+{
+ Q_OBJECT
+
+ private: //MEMBERS
+ KFileReplaceView* m_view;
+ QWidget* m_parentWidget,
+ * m_w;
+ KConfig* m_config;
+ KAboutApplication* m_aboutDlg;
+ KeyValueMap m_replacementMap;
+ RCOptions* m_option;
+ bool m_stop,
+ m_searchingOperation;
+ int m_optionMask;
+
+ public://Constructors
+ KFileReplacePart(QWidget *parentWidget,
+ const char *widgetName,
+ QObject *parent,
+ const char *name,
+ const QStringList &args);
+ ~KFileReplacePart();
+
+ //SLOTS
+ private slots:
+ void slotSetNewParameters();
+ void slotSearchingOperation();
+ void slotReplacingOperation();
+ void slotSimulatingOperation();
+ void slotStop();
+ void slotCreateReport();
+ void slotStringsAdd();
+ void slotQuickStringsAdd();
+ void slotStringsDeleteItem();
+ void slotStringsEmpty();
+ void slotStringsEdit();
+ void slotStringsSave();
+ void slotStringsLoad();
+ void slotStringsInvertCur();
+ void slotStringsInvertAll();
+ void slotOpenRecentStringFile(const KURL& urlFile);
+ void slotOptionRecursive();
+ void slotOptionBackup();
+ void slotOptionCaseSensitive();
+ void slotOptionVariables();
+ void slotOptionRegularExpressions();
+ void slotOptionPreferences();
+ void showAboutApplication(void);
+ void appHelpActivated();
+ void reportBug();
+ void resetActions();
+ void slotSearchMode(bool b){ m_option->m_searchingOnlyMode = b; }
+
+ //METHODS
+ public:
+ static KAboutData* createAboutData();
+ KConfig *config(){ return m_config; }
+
+ protected:
+ virtual bool openFile() { return false; }
+ virtual bool openURL (const KURL &url);
+
+ private:
+ /**
+ * Initialization methods
+ */
+ void initGUI();
+ void initView();
+
+ /**
+ * This method freezes the GUI of kfilereplace during searching
+ */
+ void freezeActions();
+
+ /**
+ * These methods load the resources from kfilereplacerc
+ */
+ void loadOptionsFromRC();
+ void loadOptions();
+ void loadFileSizeOptions();
+ void loadDateAccessOptions();
+ void loadOwnerOptions();
+ void loadLocationsList();
+ void loadFiltersList();
+ void loadBackupExtensionOptions();
+
+ /**
+ * These methods save the resources to kfilereplacerc
+ */
+ void saveOptionsToRC();
+ void saveOptions();
+ void saveFileSizeOptions();
+ void saveDateAccessOptions();
+ void saveOwnerOptions();
+ void saveLocationsList();
+ void saveFiltersList();
+ void saveBackupExtensionOptions();
+
+ /**
+ * Replacing methods
+ */
+ void fileReplace();
+ void recursiveFileReplace(const QString& dirName, int& filesNumber);
+ void replaceAndBackup(const QString& currentDir, const QString& oldFileName);
+ void replaceAndOverwrite(const QString& currentDir, const QString& oldFileName);
+ void replacingLoop(QString& line, KListViewItem** item, bool& atLeastOneStringFound, int& occur, bool regularExpression, bool& askConfirmReplace);
+
+ /**
+ * Searching methods
+ */
+ void fileSearch(const QString& dirName, const QString& filters);
+ void recursiveFileSearch(const QString& dirName, const QString& filters, uint& filesNumber);
+ void search(const QString& currentDir, const QString& fileName);
+
+ /**
+ * Others methods
+ */
+ void loadViewContent();
+ void loadRulesFile(const QString& fileName);
+ bool launchNewProjectDialog(const KURL& startURL);
+ void setOptionMask();
+ bool checkBeforeOperation();
+ bool dontAskAgain();
+ void whatsThis();
+};
+
+#endif// KFileReplacePart