From 3a75bdfe83b71ef1dbc2fbf52f2d18b8174e22e5 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 15 Dec 2020 11:30:44 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro --- kmailcvt/filters.h | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 kmailcvt/filters.h (limited to 'kmailcvt/filters.h') diff --git a/kmailcvt/filters.h b/kmailcvt/filters.h new file mode 100644 index 00000000..f9261bcb --- /dev/null +++ b/kmailcvt/filters.h @@ -0,0 +1,145 @@ +/*************************************************************************** + filters.h - description + ------------------- + begin : Fri Jun 30 2000 + copyright : (C) 2000 by Hans Dijkema + email : kmailcvt@hum.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 FILTERS_H +#define FILTERS_H + +#ifndef MAX_LINE +#define MAX_LINE 4096 +#endif + +#include +#include +#include +#include +#include + +#include "kimportpagedlg.h" + +class FilterInfo +{ + public: + FilterInfo(KImportPageDlg *dlg, TQWidget *parent, bool _removeDupMsg); + ~FilterInfo(); + + void setStatusMsg( const TQString& status ); + void setFrom( const TQString& from ); + void setTo( const TQString& to ); + void setCurrent( const TQString& current ); + void setCurrent( int percent = 0 ); + void setOverall( int percent = 0 ); + void addLog( const TQString& log ); + void clear(); + void alert( const TQString& message ); + static void terminateASAP(); + bool shouldTerminate(); + + TQWidget *parent() { return m_parent; } + bool removeDupMsg; + + private: + KImportPageDlg *m_dlg; + TQWidget *m_parent; + static bool s_terminateASAP; +}; + +class Filter +{ + public: + Filter( const TQString& name, const TQString& author, + const TQString& info = TQString() ); + virtual ~Filter() {} + virtual void import( FilterInfo* ) = 0; + TQString author() const { return m_author; } + TQString name() const { return m_name; } + TQString info() const { return m_info; } + + virtual bool needsSecondPage(); + + int count_duplicates; //to count all duplicate messages + + protected: + void showKMailImportArchiveDialog( FilterInfo* info ); + bool addMessage( FilterInfo* info, + const TQString& folder, + const TQString& msgFile, + const TQString& msgStatusFlags = TQString()); + bool addMessage_fastImport( FilterInfo* info, + const TQString& folder, + const TQString& msgFile, + const TQString& msgStatusFlags = TQString()); + private: + TQString m_name; + TQString m_author; + TQString m_info; +}; + + + +/** +* Glorified TQString[N] for (a) understandability (b) older gcc compatibility. +*/ +template class FolderStructureBase +{ +public: + typedef TQString NString[size]; + /** Constructor. Need a default constructor for TQValueList. */ + FolderStructureBase() {} ; + + /** Constructor. Turn N TQStrings into a folder structure + * description. + */ + FolderStructureBase(const NString &s) + { + for(unsigned int i=0; i