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

Plasma

uiloader.cpp

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 Richard J. Moore <rich@kde.org>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #include "uiloader.h"
00021 
00022 #include <QGraphicsGridLayout>
00023 #include <QGraphicsLinearLayout>
00024 #include <QStringList>
00025 
00026 #include <Plasma/BusyWidget>
00027 #include <Plasma/CheckBox>
00028 #include <Plasma/ComboBox>
00029 #include <Plasma/FlashingLabel>
00030 #include <Plasma/Frame>
00031 #include <Plasma/GroupBox>
00032 #include <Plasma/IconWidget>
00033 #include <Plasma/Label>
00034 #include <Plasma/LineEdit>
00035 #include <Plasma/Meter>
00036 #include <Plasma/PushButton>
00037 #include <Plasma/RadioButton>
00038 #include <Plasma/ScrollBar>
00039 #include <Plasma/SignalPlotter>
00040 #include <Plasma/Slider>
00041 #include <Plasma/SpinBox>
00042 #include <Plasma/SvgWidget>
00043 #include <Plasma/TabBar>
00044 #include <Plasma/TextEdit>
00045 #include <Plasma/ToolButton>
00046 #include <Plasma/TreeView>
00047 #include <Plasma/WebView>
00048 
00049 QGraphicsWidget *createBusyWidget(QGraphicsWidget *parent) { return new Plasma::BusyWidget(parent); }
00050 QGraphicsWidget *createCheckBox(QGraphicsWidget *parent) { return new Plasma::CheckBox(parent); }
00051 QGraphicsWidget *createComboBox(QGraphicsWidget *parent) { return new Plasma::ComboBox(parent); }
00052 QGraphicsWidget *createFlashingLabel(QGraphicsWidget *parent) { return new Plasma::FlashingLabel(parent); }
00053 QGraphicsWidget *createFrame(QGraphicsWidget *parent) { return new Plasma::Frame(parent); }
00054 QGraphicsWidget *createGroupBox(QGraphicsWidget *parent) { return new Plasma::GroupBox(parent); }
00055 QGraphicsWidget *createIconWidget(QGraphicsWidget *parent) { return new Plasma::IconWidget(parent); }
00056 QGraphicsWidget *createLabel(QGraphicsWidget *parent) { return new Plasma::Label(parent); }
00057 QGraphicsWidget *createLineEdit(QGraphicsWidget *parent) { return new Plasma::LineEdit(parent); }
00058 QGraphicsWidget *createMeter(QGraphicsWidget *parent) { return new Plasma::Meter(parent); }
00059 QGraphicsWidget *createPushButton(QGraphicsWidget *parent) { return new Plasma::PushButton(parent); }
00060 QGraphicsWidget *createRadioButton(QGraphicsWidget *parent) { return new Plasma::RadioButton(parent); }
00061 QGraphicsWidget *createScrollBar(QGraphicsWidget *parent) { return new Plasma::ScrollBar(parent); }
00062 QGraphicsWidget *createSignalPlotter(QGraphicsWidget *parent) { return new Plasma::SignalPlotter(parent); }
00063 QGraphicsWidget *createSlider(QGraphicsWidget *parent) { return new Plasma::Slider(parent); }
00064 QGraphicsWidget *createSpinBox(QGraphicsWidget *parent) { return new Plasma::SpinBox(parent); }
00065 QGraphicsWidget *createSvgWidget(QGraphicsWidget *parent) { return new Plasma::SvgWidget(parent); }
00066 QGraphicsWidget *createTabBar(QGraphicsWidget *parent) { return new Plasma::TabBar(parent); }
00067 QGraphicsWidget *createTextEdit(QGraphicsWidget *parent) { return new Plasma::TextEdit(parent); }
00068 QGraphicsWidget *createToolButton(QGraphicsWidget *parent) { return new Plasma::ToolButton(parent); }
00069 QGraphicsWidget *createTreeView(QGraphicsWidget *parent) { return new Plasma::TreeView(parent); }
00070 
00071 UiLoader::UiLoader()
00072 {
00073     m_widgetCtors.insert("BusyWidget", createBusyWidget);
00074     m_widgetCtors.insert("CheckBox", createCheckBox);
00075     m_widgetCtors.insert("ComboBox", createComboBox);
00076     m_widgetCtors.insert("FlashingLabel", createFlashingLabel);
00077     m_widgetCtors.insert("Frame", createFrame);
00078     m_widgetCtors.insert("GroupBox", createGroupBox);
00079     m_widgetCtors.insert("IconWidget", createIconWidget);
00080     m_widgetCtors.insert("Label", createLabel);
00081     m_widgetCtors.insert("LineEdit", createLineEdit);
00082     m_widgetCtors.insert("Meter", createMeter);
00083     m_widgetCtors.insert("PushButton", createPushButton);
00084     m_widgetCtors.insert("RadioButton", createRadioButton);
00085     m_widgetCtors.insert("ScrollBar", createScrollBar);
00086     m_widgetCtors.insert("SignalPlotter", createSignalPlotter);
00087     m_widgetCtors.insert("Slider", createSlider);
00088     m_widgetCtors.insert("SpinBox", createSpinBox);
00089     m_widgetCtors.insert("SvgWidget", createSvgWidget);
00090     m_widgetCtors.insert("TabBar", createTabBar);
00091     m_widgetCtors.insert("TextEdit", createTextEdit);
00092     m_widgetCtors.insert("ToolButton", createToolButton);
00093     m_widgetCtors.insert("TreeView", createTreeView);
00094 }
00095 
00096 UiLoader::~UiLoader()
00097 {
00098     kDebug();
00099 }
00100 
00101 QStringList UiLoader::availableWidgets() const
00102 {
00103     return m_widgetCtors.keys();
00104 }
00105 
00106 QGraphicsWidget *UiLoader::createWidget(const QString &className, QGraphicsWidget *parent)
00107 {
00108     widgetCreator w = m_widgetCtors.value(className, 0);
00109     if (w) {
00110         return (w)(parent);
00111     }
00112 
00113     return 0;
00114 }
00115 
00116 

Plasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference 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