summaryrefslogtreecommitdiffstats
path: root/tdefile-plugins/torrent/tdefile_torrent.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:58 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:58 -0600
commitb10a61b1fd2fe561ba61a384d4a344bae2a4aa29 (patch)
tree99dc6b2584265b2df91f7dbc1dcbf7a54efd205e /tdefile-plugins/torrent/tdefile_torrent.h
parent64c3be47ff36e40035ead93f913aeeb1e4f85e4b (diff)
downloadtdenetwork-b10a61b1fd2fe561ba61a384d4a344bae2a4aa29.tar.gz
tdenetwork-b10a61b1fd2fe561ba61a384d4a344bae2a4aa29.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'tdefile-plugins/torrent/tdefile_torrent.h')
-rw-r--r--tdefile-plugins/torrent/tdefile_torrent.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/tdefile-plugins/torrent/tdefile_torrent.h b/tdefile-plugins/torrent/tdefile_torrent.h
new file mode 100644
index 00000000..c954a814
--- /dev/null
+++ b/tdefile-plugins/torrent/tdefile_torrent.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2003, 2004 Michael Pyne <michael.pyne@kdemail.net>
+ *
+ * This software 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 software 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 library; see the file COPYING.
+ * If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#ifndef _KFILE_TORRENT_H
+#define _KFILE_TORRENT_H
+
+#include <tdefilemetainfo.h>
+
+#include "bdict.h"
+
+class TQStringList;
+
+/**
+ * Class to provide meta info for BitTorrent files within Konqueror.
+ * Handles the mime type application/x-bittorrent, files typically
+ * have the extension .torrent
+ *
+ * @author Michael Pyne <mpyne@grammarian.homelinux.net>
+ * @todo Handle editing the meta info as well
+ * @bug The comment meta info should be Multi Line, but that only
+ * works when the comment can also be edited.
+ */
+class KTorrentPlugin : public KFilePlugin
+{
+ Q_OBJECT
+
+
+ public:
+ /**
+ * Constructs the class, and prepares for reading info on a torrent.
+ *
+ * @param parent the parent of this object
+ * @param name the name of this object (not user-readable)
+ * @param args unused by this class
+ */
+ KTorrentPlugin (TQObject *parent, const char *name, const TQStringList &args);
+
+ /**
+ * Destructor that closes the dictionary holding the torrent information.
+ */
+ ~KTorrentPlugin () { delete m_dict; }
+
+ /**
+ * Reads information on a torrent file given by @p info.
+ *
+ * @param info information on the file to decode
+ * @return true if the meta info was successfully detected and added,
+ * false otherwise.
+ */
+ virtual bool readInfo (KFileMetaInfo& info, unsigned int);
+
+ /**
+ * Writes information on a torrent file given by @p info.
+ * BitTorrent are practically nothing but meta information.
+ * Therefore, the entire file might be changed.
+ *
+ * @param info information on the file to encode
+ * @return true if the meta info was successfully updated,
+ * false otherwise
+ */
+ virtual bool writeInfo (const KFileMetaInfo& info) const;
+
+ private:
+ bool m_failed;
+ BDict *m_dict;
+};
+
+#endif /* _KFILE_TORRENT_H */
+
+// vim: set et ts=4 sw=4: