• Skip to content
  • Skip to link menu
KDE 4.2 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 #include <QtGui/QListWidget>
00026 
00027 #include <kpagedialog.h>
00028 #include <kassistantdialog.h>
00029 //#include <kfilewidget.h>
00030 
00031 namespace Kross {
00032 
00036     class FormListView : public QListWidget
00037     {
00038             Q_OBJECT
00039         public:
00040             explicit FormListView(QWidget* parent);
00041             virtual ~FormListView();
00042         public Q_SLOTS:
00043             void clear();
00044             void remove(int index);
00045             void addItem(const QString& text);
00046             int count();
00047             int current();
00048             void setCurrent(int row);
00049             QString text(int row);
00050     };
00051 
00055     class FormFileWidget : public QWidget
00056     {
00057             Q_OBJECT
00058             Q_ENUMS(Mode)
00059 
00060         public:
00061             FormFileWidget(QWidget* parent, const QString& startDirOrVariable);
00062             virtual ~FormFileWidget();
00063 
00067             enum Mode { Other = 0, Opening, Saving };
00068 
00069         public Q_SLOTS:
00070 
00075             void setMode(const QString& mode);
00076 
00080             QString currentFilter() const;
00081 
00085             void setFilter(const QString &filter);
00086 
00090             QString currentMimeFilter() const;
00091 
00095             void setMimeFilter(const QStringList& filter);
00096 
00100             QString selectedFile() const;
00101 
00102             //QStringList selectedFiles() const { return KFileDialog::selectedFiles(); }
00103             //QString selectedUrl() const { return KFileDialog::selectedUrl().toLocalFile(); }
00104 
00105         Q_SIGNALS:
00106 
00111             void fileSelected(const QString& file);
00112 
00116             void fileHighlighted(const QString&);
00117 
00121             void selectionChanged();
00122 
00127             void filterChanged(const QString& filter);
00128 
00129         private Q_SLOTS:
00130             void slotFileSelected(const QString&);
00131 
00132         private:
00134             class Private;
00136             Private* const d;
00137     };
00138 
00155     class FormProgressDialog : public KPageDialog
00156     {
00157             Q_OBJECT
00158         public:
00159             FormProgressDialog(const QString& caption, const QString& labelText);
00160             virtual ~FormProgressDialog();
00161             virtual void done(int r);
00162         public Q_SLOTS:
00166             void setValue(int progress);
00170             void setRange(int minimum, int maximum);
00174             void setText(const QString& text);
00178             void addText(const QString& text);
00187             int exec();
00193             int exec_loop() { return exec(); }
00197             bool isCanceled();
00198         Q_SIGNALS:
00202             void canceled();
00203         private:
00205             class Private;
00207             Private* const d;
00208     };
00209 
00236     class FormDialog: public KPageDialog
00237     {
00238             Q_OBJECT
00239 
00240         public:
00241             FormDialog(const QString& caption);
00242             virtual ~FormDialog();
00243 
00244         public Q_SLOTS:
00245 
00254             bool setButtons(const QString& buttons);
00255 
00272             bool setButtonText(const QString& button, const QString& text);
00273 
00280             bool setFaceType(const QString& facetype);
00281 
00286             QString currentPage() const;
00287 
00293             bool setCurrentPage(const QString& name);
00294 
00299             QWidget* page(const QString& name) const;
00300 
00313             QWidget* addPage(const QString& name, const QString& header = QString(), const QString& iconname = QString());
00314 
00319             void setMainWidget(QWidget *newMainWidget);
00320 
00329             int exec() { return KDialog::exec(); }
00330 
00336             int exec_loop() { return exec(); }
00337 
00341             QString result();
00342 
00343         private Q_SLOTS:
00344             virtual void slotButtonClicked(int button);
00345             void slotCurrentPageChanged(KPageWidgetItem* current);
00346 
00347         private:
00349             class Private;
00351             Private* const d;
00352     };
00353 
00354 
00391     class FormAssistant: public KAssistantDialog
00392     {
00393             Q_OBJECT
00394             Q_ENUMS(AssistantButtonCode)
00395         public:
00396             enum AssistantButtonCode
00397             {
00398                 None    = 0x00000000,
00399                 Help    = 0x00000001,
00400                 Default = 0x00000002,
00401                 Cancel  = 0x00000020,
00402                 Finish  = 0x00001000,
00403                 Next    = 0x00002000,
00404                 Back    = 0x00004000,
00405                 NoDefault = 0x00008000
00406             };
00407             Q_DECLARE_FLAGS(AssistantButtonCodes, AssistantButtonCode)
00408 
00409         public:
00410             FormAssistant(const QString& caption);
00411             virtual ~FormAssistant();
00412 
00413         public Q_SLOTS:
00414 
00415             void showHelpButton(bool);
00416 
00421             QString currentPage() const;
00422 
00428             bool setCurrentPage(const QString& name);
00429 
00434             QWidget* page(const QString& name) const;
00435 
00448             QWidget* addPage(const QString& name, const QString& header = QString(), const QString& iconname = QString());
00449 
00453             bool isAppropriate (const QString& name) const;
00457             void setAppropriate (const QString& name, bool appropriate);
00461             bool isValid (const QString& name) const;
00465             void setValid (const QString& name, bool enable);
00466 
00475             int exec() { return KDialog::exec(); }
00476 
00482             int exec_loop() { return exec(); }
00483 
00487             QString result();
00488 
00492             void back();
00496             void next();
00497 
00498         private Q_SLOTS:
00499             virtual void slotButtonClicked(int button);
00500             void slotCurrentPageChanged(KPageWidgetItem* current);
00501 
00502         signals:
00506             void nextClicked();
00507             void backClicked();
00508 
00509         private:
00511             class Private;
00513             Private* const d;
00514     };
00515 
00516 
00533     class FormModule: public QObject
00534     {
00535             Q_OBJECT
00536 
00537         public:
00538             explicit FormModule();
00539             virtual ~FormModule();
00540 
00541         public Q_SLOTS:
00542 
00547             QWidget* activeModalWidget();
00548 
00553             QWidget* activeWindow();
00554 
00555 
00559             QString tr(const QString& str);
00560 
00564             QString tr(const QString& str,const QString& comment);
00565 
00566 
00590             QString showMessageBox(const QString& dialogtype, const QString& caption, const QString& message, const QString& details = QString());
00591 
00600             QWidget* showProgressDialog(const QString& caption, const QString& labelText);
00601 
00607             QWidget* createDialog(const QString& caption);
00608 
00614             QWidget* createAssistant(const QString& caption);
00615 
00627             QObject* createLayout(QWidget* parent, const QString& layout);
00628 
00638             QWidget* createWidget(const QString& className);
00639 
00649             QWidget* createWidget(QWidget* parent, const QString& className, const QString& name = QString());
00650 
00658             QWidget* createWidgetFromUI(QWidget* parent, const QString& xml);
00659 
00667             QWidget* createWidgetFromUIFile(QWidget* parent, const QString& filename);
00668 
00677             QWidget* createFileWidget(QWidget* parent, const QString& startDirOrVariable = QString());
00678 
00686             QWidget* createListView(QWidget* parent);
00687 
00694             QObject* loadPart(QWidget* parent, const QString& name, const QUrl& url = QUrl());
00695 
00703             QAction* createAction(QObject* parent);
00704 
00705         private:
00707             class Private;
00709             Private* const d;
00710     };
00711 }
00712 
00713 #endif
00714 

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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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