<commit_before>/*
 * Copyright (C) 2004, <NAME> (<EMAIL>)
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef MK_KIO_PROTO_H
#define MK_KIO_PROTO_H

/**
 * @file
 *
 * KIO can handle multiple protocols. But some protocols have their own
 * manipulations of KUrl or MetaData , and some protocols could do more then other
 * protocols. So, this file defines a generic class for specifying the specific
 * properties of a kio protocol.
 *
 * @author <NAME> <<EMAIL>>
 */

class QString;
#include <kurl.h>
#include <kio/global.h>
#include <klocale.h>
#include <QStringList>
#include "protocol.h"

#include "kio.h"

/**
 * This class is the base protocol for all Protocol implementations using kio.
 * It defines some kio-specific settings which are used while fetching emails.
 */
class KIO_Protocol : public Protocol
{
public:
	/**
	 * Constuctor; empty
	 */
	KIO_Protocol() {}

	/**
	 * Destructor; empty too
	 */
	virtual ~KIO_Protocol() {}

	/**
	 * Public enumeration of the delete type.
	 * A file can be deleted using two methods: KIO::del and KIO::get.
	 * The enumeration tells which method should be used.
	 *
	 * @param get KIO::get should be used if a file needs to be deleted
	 * @param del KIO::del should be used if a file needs to be deleted
	 */
	enum DeleteTypeEnum { get, del };

	/**
	 * This is an implementation of Protocol::createMaildrop().
	 * Because all kio-protocols uses this maildrop, this is defined in this class.
	 */
	virtual KMailDrop* createMaildrop( AccountSettings* settings ) const { return new KKioDrop( settings ); }

	/**
	 * This is an implementation of Protocol::createConfig().
	 * It reads the configuration out the configuration file and appends the value to a configuration mapping.
	 *
	 * @param group the configuration group containing the settings
	 * @param password the password of the box (can come from a Wallet)
	 * @return a mapping containing the configuration of a kio-account.
	 */
	virtual QMap< QString, QString >* createConfig( AccountSettings *settings ) const;

	/**
	 * This function defines a default for the protocolname.
	 * The full description of this function is descripted in Protocol::protocol().
	 *
	 * If this function isn't reimplemented in a subclass, the "file"-kioslave is used.
	 *
	 * @param ssl if true, the ssl-version of the protocol (if any) should be returned
	 * @return the kioslave which should be used
	 */
	virtual QString protocol( bool ) const { return "file"; }

	/**
	 * Some protocols use conncetions (such as pop3, imap); other don't (such as file).
	 * This function should return true if the protocol is connection based.
	 *
	 * By default, it returns false.
	 *
	 * @return true if the protocol is connection based; false otherwise
	 */
	virtual bool connectionBased() const { return false; }

	/**
	 * This function should return true if this protocol is able to read the subjects messages.
	 *
	 * Because there will never exist an instance of this class, a can override this method.
	 * The default is false.<commit_msg>typo fix.<commit_after>/*
 * Copyright (C) 2004, <NAME> (<EMAIL>)
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef MK_KIO_PROTO_H
#define MK_KIO_PROTO_H

/**
 * @file
 *
 * KIO can handle multiple protocols. But some protocols have their own
 * manipulations of KUrl or MetaData , and some protocols could do more then other
 * protocols. So, this file defines a generic class for specifying the specific
 * properties of a kio protocol.
 *
 * @author <NAME> <<EMAIL>>
 */

class QString;
#include <kurl.h>
#include <kio/global.h>
#include <klocale.h>
#include <QStringList>
#include "protocol.h"

#include "kio.h"

/**
 * This class is the base protocol for all Protocol implementations using kio.
 * It defines some kio-specific settings which are used while fetching emails.
 */
class KIO_Protocol : public Protocol
{
public:
	/**
	 * Constuctor; empty
	 */
	KIO_Protocol() {}

	/**
	 * Destructor; empty too
	 */
	virtual ~KIO_Protocol() {}

	/**
	 * Public enumeration of the delete type.
	 * A file can be deleted using two methods: KIO::del and KIO::get.
	 * The enumeration tells which method should be used.
	 *
	 * @param get KIO::get should be used if a file needs to be deleted
	 * @param del KIO::del should be used if a file needs to be deleted
	 */
	enum DeleteTypeEnum { get, del };

	/**
	 * This is an implementation of Protocol::createMaildrop().
	 * Because all kio-protocols uses this maildrop, this is defined in this class.
	 */
	virtual KMailDrop* createMaildrop( AccountSettings* settings ) const { return new KKioDrop( settings ); }

	/**
	 * This is an implementation of Protocol::createConfig().
	 * It reads the configuration out the configuration file and appends the value to a configuration mapping.
	 *
	 * @param group the configuration group containing the settings
	 * @param password the password of the box (can come from a Wallet)
	 * @return a mapping containing the configuration of a kio-account.
	 */
	virtual QMap< QString, QString >* createConfig( AccountSettings *settings ) const;

	/**
	 * This function defines a default for the protocolname.
	 * The full description of this function is descripted in Protocol::protocol().
	 *
	 * If this function isn't reimplemented in a subclass, the "file"-kioslave is used.
	 *
	 * @param ssl if true, the ssl-version of the protocol (if any) should be returned
	 * @return the kioslave which should be used
	 */
	virtual QString protocol( bool ) const { return "file"; }

	/**
	 * Some protocols use connections (such as pop3, imap); other don't (such as file).
	 * This function should return true if the protocol is connection based.
	 *
	 * By default, it returns false.
	 *
	 * @return true if the protocol is connection based; false otherwise
	 */
	virtual bool connectionBased() const { return false; }

	/**
	 * This function should return true if this protocol is able to read the subjects messages.
	 *
	 * Because there will never exist an instance of this class, a can override this method.
	 * The default is false.
{'fraction_non_alphanumeric': 0.08169052119902781, 'fraction_numerical': 0.004590872265730489, 'mean_word_length': 3.679090334807328, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3464247', 'n_tokens_mistral': 2095, 'n_tokens_neox': 1938, 'n_words': 994}