• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

Kross

  • kross
  • modules
form.h
Go to the documentation of this file.
1 /***************************************************************************
2  * form.h
3  * This file is part of the KDE project
4  * copyright (C)2006-2007 by Sebastian Sauer (mail@dipe.org)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  * You should have received a copy of the GNU Library General Public License
15  * along with this program; see the file COPYING. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  ***************************************************************************/
19 
20 #ifndef KROSS_FORM_H
21 #define KROSS_FORM_H
22 
23 #include <QtGui/QWidget>
24 #include <QtCore/QUrl>
25 #include <QtGui/QListWidget>
26 
27 #include <kpagedialog.h>
28 #include <kassistantdialog.h>
29 //#include <kfilewidget.h>
30 
31 namespace Kross {
32 
36  class FormListView : public QListWidget
37  {
38  Q_OBJECT
39  public:
40  explicit FormListView(QWidget* parent);
41  virtual ~FormListView();
42  public Q_SLOTS:
43  void clear();
44  void remove(int index);
45  void addItem(const QString& text);
46  int count();
47  int current();
48  void setCurrent(int row);
49  QString text(int row);
50  };
51 
55  class FormFileWidget : public QWidget
56  {
57  Q_OBJECT
58  Q_ENUMS(Mode)
59 
60  public:
61  FormFileWidget(QWidget* parent, const QString& startDirOrVariable);
62  virtual ~FormFileWidget();
63 
67  enum Mode { Other = 0, Opening, Saving };
68 
69  public Q_SLOTS:
70 
75  void setMode(const QString& mode);
76 
80  QString currentFilter() const;
81 
85  void setFilter(const QString &filter);
86 
90  QString currentMimeFilter() const;
91 
95  void setMimeFilter(const QStringList& filter);
96 
100  QString selectedFile() const;
101 
102  //QStringList selectedFiles() const { return KFileDialog::selectedFiles(); }
103  //QString selectedUrl() const { return KFileDialog::selectedUrl().toLocalFile(); }
104 
105  Q_SIGNALS:
106 
111  void fileSelected(const QString& file);
112 
116  void fileHighlighted(const QString&);
117 
121  void selectionChanged();
122 
127  void filterChanged(const QString& filter);
128 
129  private Q_SLOTS:
130  void slotFileSelected(const QString&);
131 
132  private:
134  class Private;
136  Private* const d;
137  };
138 
155  class FormProgressDialog : public KPageDialog
156  {
157  Q_OBJECT
158  public:
159  FormProgressDialog(const QString& caption, const QString& labelText);
160  virtual ~FormProgressDialog();
161  virtual void done(int r);
162  public Q_SLOTS:
166  void setValue(int progress);
170  void setRange(int minimum, int maximum);
174  void setText(const QString& text);
178  void addText(const QString& text);
187  int exec();
193  int exec_loop() { return exec(); }
197  bool isCanceled();
198  Q_SIGNALS:
202  void canceled();
203  private:
205  class Private;
207  Private* const d;
208  };
209 
232  class FormDialog: public KPageDialog
233  {
234  Q_OBJECT
235 
236  public:
237  FormDialog(const QString& caption);
238  virtual ~FormDialog();
239 
240  public Q_SLOTS:
241 
250  bool setButtons(const QString& buttons);
251 
268  bool setButtonText(const QString& button, const QString& text);
269 
276  bool setFaceType(const QString& facetype);
277 
282  QString currentPage() const;
283 
289  bool setCurrentPage(const QString& name);
290 
295  QWidget* page(const QString& name) const;
296 
309  QWidget* addPage(const QString& name, const QString& header = QString(), const QString& iconname = QString());
310 
315  void setMainWidget(QWidget *newMainWidget);
316 
325  int exec() { return KDialog::exec(); }
326 
332  int exec_loop() { return exec(); }
333 
337  QString result();
338 
339  private Q_SLOTS:
340  virtual void slotButtonClicked(int button);
341  void slotCurrentPageChanged(KPageWidgetItem* current);
342 
343  private:
345  class Private;
347  Private* const d;
348  };
349 
350 
383  class FormAssistant: public KAssistantDialog
384  {
385  Q_OBJECT
386  Q_ENUMS(AssistantButtonCode)
387  public:
388  enum AssistantButtonCode
389  {
390  None = 0x00000000,
391  Help = 0x00000001,
392  Default = 0x00000002,
393  Cancel = 0x00000020,
394  Finish = 0x00001000,
395  Next = 0x00002000,
396  Back = 0x00004000,
397  NoDefault = 0x00008000
398  };
399  Q_DECLARE_FLAGS(AssistantButtonCodes, AssistantButtonCode)
400 
401  public:
402  FormAssistant(const QString& caption);
403  virtual ~FormAssistant();
404 
405  public Q_SLOTS:
406 
407  void showHelpButton(bool);
408 
413  QString currentPage() const;
414 
420  bool setCurrentPage(const QString& name);
421 
426  QWidget* page(const QString& name) const;
427 
440  QWidget* addPage(const QString& name, const QString& header = QString(), const QString& iconname = QString());
441 
445  bool isAppropriate (const QString& name) const;
449  void setAppropriate (const QString& name, bool appropriate);
453  bool isValid (const QString& name) const;
457  void setValid (const QString& name, bool enable);
458 
467  int exec() { return KDialog::exec(); }
468 
474  int exec_loop() { return exec(); }
475 
479  QString result();
480 
484  void back();
488  void next();
489 
490  private Q_SLOTS:
491  virtual void slotButtonClicked(int button);
492  void slotCurrentPageChanged(KPageWidgetItem* current);
493 
494  signals:
498  void nextClicked();
499  void backClicked();
500 
501  private:
503  class Private;
505  Private* const d;
506  };
507 
508 
525  class FormModule: public QObject
526  {
527  Q_OBJECT
528 
529  public:
530  explicit FormModule();
531  virtual ~FormModule();
532 
533  public Q_SLOTS:
534 
539  QWidget* activeModalWidget();
540 
545  QWidget* activeWindow();
546 
547 
551  QString tr(const QString& str);
552 
556  QString tr(const QString& str,const QString& comment);
557 
558 
582  QString showMessageBox(const QString& dialogtype, const QString& caption, const QString& message, const QString& details = QString());
583 
592  QWidget* showProgressDialog(const QString& caption, const QString& labelText);
593 
599  QWidget* createDialog(const QString& caption);
600 
606  QWidget* createAssistant(const QString& caption);
607 
619  QObject* createLayout(QWidget* parent, const QString& layout);
620 
630  QWidget* createWidget(const QString& className);
631 
641  QWidget* createWidget(QWidget* parent, const QString& className, const QString& name = QString());
642 
650  QWidget* createWidgetFromUI(QWidget* parent, const QString& xml);
651 
659  QWidget* createWidgetFromUIFile(QWidget* parent, const QString& filename);
660 
669  QWidget* createFileWidget(QWidget* parent, const QString& startDirOrVariable = QString());
670 
678  QWidget* createListView(QWidget* parent);
679 
686  QObject* loadPart(QWidget* parent, const QString& name, const QUrl& url = QUrl());
687 
695  QAction* createAction(QObject* parent);
696 
697  private:
699  class Private;
701  Private* const d;
702  };
703 }
704 
705 #endif
706 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Mon Jul 15 2013 13:05:54 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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