• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

ark

  • sources
  • kde-4.14
  • kdeutils
  • ark
  • part
part.h
Go to the documentation of this file.
1 /*
2  * ark -- archiver for the KDE project
3  *
4  * Copyright (C) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
5  * Copyright (C) 2008-2009 Harald Hvaal <haraldhv@stud.ntnu.no>
6  * Copyright (C) 2009 Raphael Kubo da Costa <rakuco@FreeBSD.org>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  */
23 #ifndef PART_H
24 #define PART_H
25 
26 #include "interface.h"
27 
28 #include <KParts/Part>
29 #include <KParts/StatusBarExtension>
30 #include <KTempDir>
31 
32 #include <QModelIndex>
33 
34 class ArchiveModel;
35 class InfoPanel;
36 
37 class KAbstractWidgetJobTracker;
38 class KAboutData;
39 class KAction;
40 class KJob;
41 
42 class QAction;
43 class QSplitter;
44 class QTreeView;
45 
46 namespace Ark
47 {
48 
49 class Part: public KParts::ReadWritePart, public Interface
50 {
51  Q_OBJECT
52  Q_INTERFACES(Interface)
53 public:
54  Part(QWidget *parentWidget, QObject *parent, const QVariantList &);
55  ~Part();
56  static KAboutData* createAboutData();
57 
58  virtual bool openFile();
59  virtual bool saveFile();
60 
61  bool isBusy() const;
62 
63 public slots:
64  void extractSelectedFilesTo(const QString& localPath);
65 
66 private slots:
67  void slotLoadingStarted();
68  void slotLoadingFinished(KJob *job);
69  void slotPreview();
70  void slotPreview(const QModelIndex & index);
71  void slotPreviewExtracted(KJob*);
72  void slotError(const QString& errorMessage, const QString& details);
73  void slotExtractFiles();
74  void slotExtractionDone(KJob*);
75  void slotQuickExtractFiles(QAction*);
76  void slotAddFiles();
77  void slotAddFiles(const QStringList& files, const QString& path = QString());
78  void slotAddDir();
79  void slotAddFilesDone(KJob*);
80  void slotDeleteFiles();
81  void slotDeleteFilesDone(KJob*);
82  void saveSplitterSizes();
83  void slotToggleInfoPanel(bool);
84  void slotSaveAs();
85  void updateActions();
86  void selectionChanged();
87  void adjustColumns();
88  void setBusyGui();
89  void setReadyGui();
90  void setFileNameFromArchive();
91 
92 signals:
93  void busy();
94  void ready();
95  void quit();
96 
97 private:
98  void setupView();
99  void setupActions();
100  bool isSingleFolderArchive() const;
101  QString detectSubfolder() const;
102  bool isPreviewable(const QModelIndex& index) const;
103  QList<QVariant> selectedFiles();
104  QList<QVariant> selectedFilesWithChildren();
105  void registerJob(KJob *job);
106 
107  ArchiveModel *m_model;
108  QTreeView *m_view;
109  KAction *m_previewAction;
110  KAction *m_extractFilesAction;
111  KAction *m_addFilesAction;
112  KAction *m_addDirAction;
113  KAction *m_deleteFilesAction;
114  KAction *m_saveAsAction;
115  InfoPanel *m_infoPanel;
116  QSplitter *m_splitter;
117  KTempDir m_previewDir;
118  bool m_busy;
119 
120  KAbstractWidgetJobTracker *m_jobTracker;
121  KParts::StatusBarExtension *m_statusBarExtension;
122 };
123 
124 } // namespace Ark
125 
126 #endif // PART_H
QModelIndex
QWidget
Ark::Part::isBusy
bool isBusy() const
Definition: part.cpp:473
KAbstractWidgetJobTracker
ArchiveModel
Definition: archivemodel.h:41
Ark::Part::extractSelectedFilesTo
void extractSelectedFilesTo(const QString &localPath)
Definition: part.cpp:161
Ark::Part::quit
void quit()
Ark::Part::createAboutData
static KAboutData * createAboutData()
Definition: part.cpp:371
interface.h
QObject
QString
QList
InfoPanel
Definition: infopanel.h:31
Ark::Part::ready
void ready()
QStringList
Interface
Definition: interface.h:27
Ark::Part::saveFile
virtual bool saveFile()
Definition: part.cpp:468
QSplitter
QTreeView
Ark::Part::openFile
virtual bool openFile()
Definition: part.cpp:376
QAction
Ark::Part::Part
Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
Definition: part.cpp:80
Ark::Part
Definition: part.h:49
Ark::Part::busy
void busy()
Ark::Part::~Part
~Part()
Definition: part.cpp:138
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ark

Skip menu "ark"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal