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

Applets

historycombobox.cpp

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2008 Aaron Seigo <aseigo@kde.org>
00003  *   Copyright (C) 2008 Marco Martin <notmart@gmail.com>
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU Library General Public License as
00007  *   published by the Free Software Foundation; either version 2, or
00008  *   (at your option) any later version.
00009  *
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
00013  *   GNU General Public License for more details
00014  *
00015  *   You should have received a copy of the GNU Library General Public
00016  *   License along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.,
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #include "historycombobox.h"
00022 
00023 #include <KHistoryComboBox>
00024 
00025 
00026 namespace Plasma
00027 {
00028 
00029 class HistoryComboBox::Private
00030 {
00031 public:
00032     Private()
00033     {
00034     }
00035 
00036     ~Private()
00037     {
00038         historyCombo = 0;
00039     }
00040 
00041     KHistoryComboBox *historyCombo;
00042 };
00043 
00044 HistoryComboBox::HistoryComboBox(QGraphicsWidget *parent)
00045     : QGraphicsProxyWidget(parent),
00046       d(new Private)
00047 {
00048     KHistoryComboBox* native = new KHistoryComboBox;
00049 
00050     connect(native, SIGNAL(cleared()), this, SIGNAL(cleared()));
00051     connect(native, SIGNAL(returnPressed(const QString &)), this, SIGNAL(returnPressed(const QString &)));
00052     connect(native, SIGNAL(textChanged(const QString &)), this, SIGNAL(textChanged(const QString &)));
00053     connect(native, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()));
00054     connect(native, SIGNAL(activated(int)), this, SIGNAL(activated(int)));
00055     setWidget(native);
00056 
00057     native->setAttribute(Qt::WA_NoSystemBackground);
00058     native->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
00059     setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
00060 
00061     d->historyCombo = native;
00062 }
00063 
00064 HistoryComboBox::~HistoryComboBox()
00065 {
00066     delete d;
00067 }
00068 
00069 
00070 void HistoryComboBox::setStylesheet(const QString &stylesheet)
00071 {
00072     d->historyCombo->setStyleSheet(stylesheet);
00073 }
00074 
00075 QString HistoryComboBox::stylesheet()
00076 {
00077     return d->historyCombo->styleSheet();
00078 }
00079 
00080 KHistoryComboBox* HistoryComboBox::nativeWidget() const
00081 {
00082     return static_cast<KHistoryComboBox*>(d->historyCombo);
00083 }
00084 
00085 void HistoryComboBox::resizeEvent(QGraphicsSceneResizeEvent *event)
00086 {
00087     QGraphicsProxyWidget::resizeEvent(event);
00088 }
00089 
00090 QStringList HistoryComboBox::historyItems() const
00091 {
00092     return d->historyCombo->historyItems();
00093 }
00094 
00095 bool HistoryComboBox::removeFromHistory(const QString &item)
00096 {
00097     return d->historyCombo->removeFromHistory(item);
00098 }
00099 
00100 void HistoryComboBox::reset()
00101 {
00102     d->historyCombo->reset();
00103 }
00104 
00105 void HistoryComboBox::setHistoryItems(const QStringList &items)
00106 {
00107     d->historyCombo->setHistoryItems(items);
00108 }
00109 
00110 QString HistoryComboBox::currentText() const
00111 {
00112     return d->historyCombo->currentText();
00113 }
00114 
00115 void HistoryComboBox::insertUrl(int index, const KUrl &url)
00116 {
00117     d->historyCombo->insertUrl(index, url);
00118 }
00119 
00120 void HistoryComboBox::setDuplicatesEnabled(bool enabled)
00121 {
00122     d->historyCombo->setDuplicatesEnabled(enabled);
00123 }
00124 
00125 void HistoryComboBox::addToHistory(const QString &item)
00126 {
00127     d->historyCombo->addToHistory(item);
00128 }
00129 
00130 }// namespace Plasma
00131 
00132 #include <historycombobox.moc>
00133 

Applets

Skip menu "Applets"
  • 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