• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kross

form.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * form.h
00003  * This file is part of the KDE project
00004  * copyright (C)2006-2007 by Sebastian Sauer (mail@dipe.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KROSS_FORM_H
00021 #define KROSS_FORM_H
00022 
00023 #include <QtGui/QWidget>
00024 #include <QtCore/QUrl>
00025 
00026 #include <kpagedialog.h>
00027 //#include <kfilewidget.h>
00028 
00029 namespace Kross {
00030 
00034     class FormFileWidget : public QWidget
00035     {
00036             Q_OBJECT
00037             Q_ENUMS(Mode)
00038 
00039         public:
00040             FormFileWidget(QWidget* parent, const QString& startDirOrVariable);
00041             virtual ~FormFileWidget();
00042 
00046             enum Mode { Other = 0, Opening, Saving };
00047 
00048         public Q_SLOTS:
00049 
00054             void setMode(const QString& mode);
00055 
00059             QString currentFilter() const;
00060 
00064             void setFilter(const QString &filter);
00065 
00069             QString currentMimeFilter() const;
00070 
00074             void setMimeFilter(const QStringList& filter);
00075 
00079             QString selectedFile() const;
00080 
00081             //QStringList selectedFiles() const { return KFileDialog::selectedFiles(); }
00082             //QString selectedUrl() const { return KFileDialog::selectedUrl().toLocalFile(); }
00083 
00084         Q_SIGNALS:
00085 
00090             void fileSelected(const QString& file);
00091 
00095             void fileHighlighted(const QString&);
00096 
00100             void selectionChanged();
00101 
00106             void filterChanged(const QString& filter);
00107 
00108         private:
00110             class Private;
00112             Private* const d;
00113     };
00114 
00131     class FormProgressDialog : public KPageDialog
00132     {
00133             Q_OBJECT
00134         public:
00135             FormProgressDialog(const QString& caption, const QString& labelText);
00136             virtual ~FormProgressDialog();
00137             virtual void done(int r);
00138         public Q_SLOTS:
00142             void setValue(int progress);
00146             void setRange(int minimum, int maximum);
00150             void setText(const QString& text);
00154             void addText(const QString& text);
00163             int exec();
00169             int exec_loop() { return exec(); }
00173             bool isCanceled();
00174         Q_SIGNALS:
00178             void canceled();
00179         private:
00181             class Private;
00183             Private* const d;
00184     };
00185 
00204     class FormDialog : public KPageDialog
00205     {
00206             Q_OBJECT
00207 
00208         public:
00209             FormDialog(const QString& caption);
00210             virtual ~FormDialog();
00211 
00212         public Q_SLOTS:
00213 
00222             bool setButtons(const QString& buttons);
00223 
00240             bool setButtonText(const QString& button, const QString& text);
00241 
00248             bool setFaceType(const QString& facetype);
00249 
00254             QString currentPage() const;
00255 
00261             bool setCurrentPage(const QString& name);
00262 
00267             QWidget* page(const QString& name) const;
00268 
00281             QWidget* addPage(const QString& name, const QString& header = QString(), const QString& iconname = QString());
00282 
00287             void setMainWidget(QWidget *newMainWidget);
00288 
00297             int exec() { return KDialog::exec(); }
00298 
00304             int exec_loop() { return exec(); }
00305 
00309             QString result();
00310 
00311         private Q_SLOTS:
00312             virtual void slotButtonClicked(int button);
00313             void slotCurrentPageChanged(KPageWidgetItem* current);
00314 
00315         private:
00317             class Private;
00319             Private* const d;
00320     };
00321 
00338     class FormModule : public QObject
00339     {
00340             Q_OBJECT
00341 
00342         public:
00343             explicit FormModule();
00344             virtual ~FormModule();
00345 
00346         public Q_SLOTS:
00347 
00352             QWidget* activeModalWidget();
00353 
00358             QWidget* activeWindow();
00359 
00383             QString showMessageBox(const QString& dialogtype, const QString& caption, const QString& message, const QString& details = QString());
00384 
00393             QWidget* showProgressDialog(const QString& caption, const QString& labelText);
00394 
00400             QWidget* createDialog(const QString& caption);
00401 
00413             QObject* createLayout(QWidget* parent, const QString& layout);
00414 
00424             QWidget* createWidget(const QString& className);
00425 
00435             QWidget* createWidget(QWidget* parent, const QString& className, const QString& name = QString());
00436 
00444             QWidget* createWidgetFromUI(QWidget* parent, const QString& xml);
00445 
00453             QWidget* createWidgetFromUIFile(QWidget* parent, const QString& filename);
00454 
00463             QWidget* createFileWidget(QWidget* parent, const QString& startDirOrVariable = QString());
00464 
00471             QObject* loadPart(QWidget* parent, const QString& name, const QUrl& url = QUrl());
00472 
00473         private:
00475             class Private;
00477             Private* const d;
00478     };
00479 }
00480 
00481 #endif
00482 

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal