• 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
  • kerfuffle
queries.h
Go to the documentation of this file.
1 /*
2  * ark -- archiver for the KDE project
3  *
4  * Copyright (C) 2008 Harald Hvaal <haraldhv@stud.ntnu.no>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef QUERIES_H
29 #define QUERIES_H
30 
31 #include "kerfuffle_export.h"
32 
33 #include <QString>
34 #include <QHash>
35 #include <QWaitCondition>
36 #include <QMutex>
37 #include <QVariant>
38 
39 namespace Kerfuffle
40 {
41 
42 typedef QHash<QString, QVariant> QueryData;
43 
44 class KERFUFFLE_EXPORT Query
45 {
46 public:
52  virtual void execute() = 0;
53 
57  void waitForResponse();
58 
59  QVariant response();
60 
61 protected:
65  Query();
66  virtual ~Query() {}
67 
68  void setResponse(QVariant response);
69 
70  QueryData m_data;
71 
72 private:
73  QWaitCondition m_responseCondition;
74  QMutex m_responseMutex;
75 };
76 
77 class KERFUFFLE_EXPORT OverwriteQuery : public Query
78 {
79 public:
80  explicit OverwriteQuery(const QString& filename);
81  void execute();
82  bool responseCancelled();
83  bool responseOverwriteAll();
84  bool responseOverwrite();
85  bool responseRename();
86  bool responseSkip();
87  bool responseAutoSkip();
88  QString newFilename();
89 
90  void setNoRenameMode(bool enableNoRenameMode);
91  bool noRenameMode();
92  void setMultiMode(bool enableMultiMode);
93  bool multiMode();
94 private:
95  bool m_noRenameMode;
96  bool m_multiMode;
97 };
98 
99 class KERFUFFLE_EXPORT PasswordNeededQuery : public Query
100 {
101 public:
102  explicit PasswordNeededQuery(const QString& archiveFilename, bool incorrectTryAgain = false);
103  void execute();
104 
105  bool responseCancelled();
106  QString password();
107 };
108 
109 }
110 
111 #endif /* ifndef QUERIES_H */
QMutex
Kerfuffle::Query
Definition: queries.h:44
Kerfuffle::Query::~Query
virtual ~Query()
Definition: queries.h:66
kerfuffle_export.h
Kerfuffle::Query::m_data
QueryData m_data
Definition: queries.h:70
QHash< QString, QVariant >
QString
KERFUFFLE_EXPORT
#define KERFUFFLE_EXPORT
Definition: kerfuffle_export.h:41
Kerfuffle::QueryData
QHash< QString, QVariant > QueryData
Definition: queries.h:42
Kerfuffle::PasswordNeededQuery
Definition: queries.h:99
Kerfuffle::OverwriteQuery
Definition: queries.h:77
QWaitCondition
QVariant
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