/usr/include/DebconfGui.h is in libdebconf-kde-dev 0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | // This license reflects the original Adept code:
// -*- C++ -*- (c) 2008 Petr Rockai <me@mornfall.net>
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// * Neither the name of [original copyright holder] nor the names of
// its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* All the modifications below are licensed under this license
* Copyright (C) 2010 Daniel Nicoletti <dantti12@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef DEBCONF_GUI_H
#define DEBCONF_GUI_H
#include <QtGui/QWidget>
#include <kdemacros.h>
namespace DebconfKde {
/**
* \class DebconfGui DebconfGui.h DebconfGui
* \author Daniel Nicoletti <dantti12@gmail.com>
*
* \brief Widget to present debconf elements
*
* This class provides a widget subclass that
* can present Debconf elements (questions), using
* a socket file.
*
* For this class to be useful the programs that are going
* to use debconf to present questions must have the environment
* variables DEBIAN_FRONTEND set to passthrough and DEBCONF_PIPE
* to the path set on the constructor (\p socketName). Then when
* a new connection arrives this class will take care of
* talking the debconf protocol and emit activated() so that
* this widget should be shown, and deactivated() when it should
* be hidden.
*
* \note It is possible to let this class work automatically by
* connecting the activated() signal on the QWidget::show() slot and
* deactivated() on the QWidget::hide() slot.
*
* \note This class must not be deleted after deactivated() signal
* is emitted, since new packages need to talk to the same socket.
* Only delete it after you are sure no more operations ended.
*/
class DebconfGuiPrivate;
class KDE_EXPORT DebconfGui : public QWidget
{
Q_OBJECT
public:
/**
* Constructor that takes a file path (\p socketName) to create
* a new socket.
* \warning Be adivised that this class will delete the path pointed
* by \p socketName. A good location would be /tmp/debconf-$PID.
*/
explicit DebconfGui(const QString &socketName, QWidget *parent = 0);
/**
* Constructor that prepares for communication with Debconf via FIFO pipes.
* Read (\p readfd) and write (\p writefd) file descriptors should be open
* and connected to Debconf which speaks Passthrough frontend protocol.
*/
explicit DebconfGui(int readfd, int writefd, QWidget *parent = 0);
~DebconfGui();
Q_SIGNALS:
/**
* This signal is emitted when a new debconf element (question)
* needs to be displayed.
*/
void activated();
/**
* This signal is emitted when there are no more debconf element
* (questions) to show. If FIFO pipes are used for communication, it means
* that pipes were closed and futher communication is no longer possible.
* If socket is used, more questions might still be shown in future so do
* not delete this class.
*/
void deactivated();
private Q_SLOTS:
void cmd_go(const QString &title, const QStringList &input);
void cmd_progress(const QString ¶m);
void on_nextPB_clicked();
void on_backPB_clicked();
void on_cancelPB_clicked();
protected:
/**
* Reimplemented function to cancel the question if the user closes
* the window.
*/
void closeEvent(QCloseEvent *event);
DebconfGuiPrivate * const d_ptr;
private:
Q_DECLARE_PRIVATE(DebconfGui)
/**
* This routine is called by all constructors to perform common
* initialization.
*/
void init();
};
}
#endif
|