summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/tdefilereplacepart.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2015-01-27 18:44:50 +0900
committerMichele Calgaro <[email protected]>2015-01-27 18:44:50 +0900
commit08f2b5848ddd09e0da7e2d42a8743f0b40f1c717 (patch)
tree18bcb7a10dbea1184b4bc6f860e1a8e06ab1c819 /tdefilereplace/tdefilereplacepart.h
parent3c091bf671d1802dceabd5b820290b0828abf949 (diff)
downloadtdeutils-08f2b5848ddd09e0da7e2d42a8743f0b40f1c717.tar.gz
tdeutils-08f2b5848ddd09e0da7e2d42a8743f0b40f1c717.zip
Moved TDEFileReplace to tdeutils. This resolves bug 767.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdefilereplace/tdefilereplacepart.h')
-rw-r--r--tdefilereplace/tdefilereplacepart.h160
1 files changed, 160 insertions, 0 deletions
diff --git a/tdefilereplace/tdefilereplacepart.h b/tdefilereplace/tdefilereplacepart.h
new file mode 100644
index 0000000..0ca917e
--- /dev/null
+++ b/tdefilereplace/tdefilereplacepart.h
@@ -0,0 +1,160 @@
+//
+//
+// C++ Interface: tdefilereplacepart
+//
+// Description:
+//
+//
+// Author: Andras Mantia <[email protected]>, (C) 2003
+// Maintainer: Emiliano Gulmini <[email protected]>, (C) 2004
+//
+// Copyright: GPL v2. See COPYING file that comes with this distribution
+//
+//
+
+#ifndef TDEFILEREPLACEPART_H
+#define TDEFILEREPLACEPART_H
+
+// QT
+
+// KDE
+#include <tdeparts/part.h>
+class TDEAboutApplication;
+class TDEAboutData;
+class TDEConfig;
+
+// local
+#include "configurationclasses.h"
+class TDEFileReplaceView;
+
+#define KFR_VERSION "0.8.1"
+
+class TDEFileReplacePart: public KParts::ReadOnlyPart
+{
+ Q_OBJECT
+
+
+ private: //MEMBERS
+ TDEFileReplaceView* m_view;
+ TQWidget* m_parentWidget,
+ * m_w;
+ TDEConfig* m_config;
+ TDEAboutApplication* m_aboutDlg;
+ KeyValueMap m_replacementMap;
+ RCOptions* m_option;
+ bool m_stop,
+ m_searchingOperation;
+ int m_optionMask;
+
+ public://Constructors
+ TDEFileReplacePart(TQWidget *parentWidget,
+ const char *widgetName,
+ TQObject *parent,
+ const char *name,
+ const TQStringList &args);
+ ~TDEFileReplacePart();
+
+ //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 TDEAboutData* createAboutData();
+ TDEConfig *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 tdefilereplace during searching
+ */
+ void freezeActions();
+
+ /**
+ * These methods load the resources from tdefilereplacerc
+ */
+ void loadOptionsFromRC();
+ void loadOptions();
+ void loadFileSizeOptions();
+ void loadDateAccessOptions();
+ void loadOwnerOptions();
+ void loadLocationsList();
+ void loadFiltersList();
+ void loadBackupExtensionOptions();
+
+ /**
+ * These methods save the resources to tdefilereplacerc
+ */
+ void saveOptionsToRC();
+ void saveOptions();
+ void saveFileSizeOptions();
+ void saveDateAccessOptions();
+ void saveOwnerOptions();
+ void saveLocationsList();
+ void saveFiltersList();
+ void saveBackupExtensionOptions();
+
+ /**
+ * Replacing methods
+ */
+ void fileReplace();
+ void recursiveFileReplace(const TQString& dirName, int& filesNumber);
+ void replaceAndBackup(const TQString& currentDir, const TQString& oldFileName);
+ void replaceAndOverwrite(const TQString& currentDir, const TQString& oldFileName);
+ void replacingLoop(TQString& line, TDEListViewItem** item, bool& atLeastOneStringFound, int& occur, bool regularExpression, bool& askConfirmReplace);
+
+ /**
+ * Searching methods
+ */
+ void fileSearch(const TQString& dirName, const TQString& filters);
+ void recursiveFileSearch(const TQString& dirName, const TQString& filters, uint& filesNumber);
+ void search(const TQString& currentDir, const TQString& fileName);
+
+ /**
+ * Others methods
+ */
+ void loadViewContent();
+ void loadRulesFile(const TQString& fileName);
+ bool launchNewProjectDialog(const KURL& startURL);
+ void setOptionMask();
+ bool checkBeforeOperation();
+ bool dontAskAgain();
+ void whatsThis();
+};
+
+#endif// TDEFileReplacePart