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

kleopatra

  • sources
  • kde-4.12
  • kdepim
  • kleopatra
  • utils
output.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  utils/output.h
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2007 Klarälvdalens Datakonsult AB
6 
7  Kleopatra is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  Kleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #ifndef __KLEOPATRA_UTILS_OUTPUT_H__
34 #define __KLEOPATRA_UTILS_OUTPUT_H__
35 
36 #include <kleo-assuan.h> // for assuan_fd_t
37 
38 #include <utils/pimpl_ptr.h>
39 
40 #include <boost/shared_ptr.hpp>
41 
42 class QIODevice;
43 class QString;
44 class QStringList;
45 class QDir;
46 class QWidget;
47 
48 namespace Kleo {
49 
50  class OverwritePolicy {
51  public:
52  enum Policy {
53  Allow,
54  Deny,
55  Ask
56  };
57 
58  explicit OverwritePolicy( QWidget * parent, Policy initialPolicy=Ask );
59  ~OverwritePolicy();
60 
61  Policy policy() const;
62  void setPolicy( Policy );
63 
64  QWidget * parentWidget() const;
65 
66  private:
67  class Private;
68  kdtools::pimpl_ptr<Private> d;
69  };
70 
71  class Output {
72  public:
73  virtual ~Output();
74 
75  virtual void setLabel( const QString & label ) = 0;
76  virtual QString label() const = 0;
77  virtual boost::shared_ptr<QIODevice> ioDevice() const = 0;
78  virtual QString errorString() const = 0;
79  virtual bool isFinalized() const = 0;
80  virtual void finalize() = 0;
81  virtual void cancel() = 0;
82  virtual bool binaryOpt() const = 0;
83  virtual void setBinaryOpt( bool value ) = 0;
84 
85  static boost::shared_ptr<Output> createFromFile( const QString & fileName, const boost::shared_ptr<OverwritePolicy> & );
86  static boost::shared_ptr<Output> createFromFile( const QString & fileName, bool forceOverwrite );
87  static boost::shared_ptr<Output> createFromPipeDevice( assuan_fd_t fd, const QString & label );
88  static boost::shared_ptr<Output> createFromProcessStdIn( const QString & command );
89  static boost::shared_ptr<Output> createFromProcessStdIn( const QString & command, const QStringList & args );
90  static boost::shared_ptr<Output> createFromProcessStdIn( const QString & command, const QStringList & args, const QDir & workingDirectory );
91 #ifndef QT_NO_CLIPBOARD
92  static boost::shared_ptr<Output> createFromClipboard();
93 #endif
94  };
95 }
96 
97 #endif /* __KLEOPATRA_UTILS_OUTPUT_H__ */
98 
Kleo::Output::isFinalized
virtual bool isFinalized() const =0
kdtools::pimpl_ptr< Private >
Kleo::OverwritePolicy::Policy
Policy
Definition: output.h:52
pimpl_ptr.h
Kleo::Output::finalize
virtual void finalize()=0
kleo-assuan.h
Kleo::Output::errorString
virtual QString errorString() const =0
QWidget
Kleo::Policy
Policy
Definition: types.h:58
Kleo::OverwritePolicy
Definition: output.h:50
Kleo::Output::createFromClipboard
static boost::shared_ptr< Output > createFromClipboard()
Definition: output.cpp:483
boost::shared_ptr< QIODevice >
d
#define d
Definition: adduseridcommand.cpp:90
Kleo::Output::createFromPipeDevice
static boost::shared_ptr< Output > createFromPipeDevice(assuan_fd_t fd, const QString &label)
Definition: output.cpp:321
Kleo::Output::cancel
virtual void cancel()=0
Kleo::Output
Definition: output.h:71
Kleo::Output::~Output
virtual ~Output()
Definition: output.cpp:523
Kleo::Output::setLabel
virtual void setLabel(const QString &label)=0
Kleo::OverwritePolicy::OverwritePolicy
OverwritePolicy(QWidget *parent, Policy initialPolicy=Ask)
Definition: output.cpp:81
Kleo::OverwritePolicy::setPolicy
void setPolicy(Policy)
Definition: output.cpp:90
Kleo::OverwritePolicy::~OverwritePolicy
~OverwritePolicy()
Definition: output.cpp:84
Kleo::Output::createFromFile
static boost::shared_ptr< Output > createFromFile(const QString &fileName, const boost::shared_ptr< OverwritePolicy > &)
Definition: output.cpp:343
Kleo::Output::label
virtual QString label() const =0
Kleo::Output::setBinaryOpt
virtual void setBinaryOpt(bool value)=0
Kleo::OverwritePolicy::policy
Policy policy() const
Definition: output.cpp:86
Kleo::Output::ioDevice
virtual boost::shared_ptr< QIODevice > ioDevice() const =0
Kleo::OverwritePolicy::Deny
Definition: output.h:54
Kleo::Output::createFromProcessStdIn
static boost::shared_ptr< Output > createFromProcessStdIn(const QString &command)
Definition: output.cpp:430
Kleo::OverwritePolicy::Ask
Definition: output.h:55
Kleo::Output::binaryOpt
virtual bool binaryOpt() const =0
Kleo::OverwritePolicy::parentWidget
QWidget * parentWidget() const
Definition: output.cpp:94
Kleo::OverwritePolicy::Allow
Definition: output.h:53
assuan_fd_t
int assuan_fd_t
Definition: kleo-assuan.h:72
QIODevice
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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