1 /* This file is part of the KDE project
2 Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU 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.
23 #include <khistorycombobox.h>
31 // we use KHistoryCombo _only_ for the up/down keyboard handling, otherwise
32 // KComboBox would do fine.
33 class KonqCombo
: public KHistoryComboBox
38 explicit KonqCombo( QWidget
*parent
);
41 // initializes with the completion object and calls loadItems()
42 void init( KCompletion
* );
44 // determines internally if it's temporary or final
45 void setURL( const QString
& url
);
47 void setTemporary( const QString
& );
48 void setTemporary( const QString
&, const QPixmap
& );
49 void clearTemporary( bool makeCurrent
= true );
50 void removeURL( const QString
& url
);
52 void insertPermanent( const QString
& );
59 static void setConfig( KConfig
* );
63 void setPageSecurity( int );
65 void insertItem( const QString
&text
, int index
=-1, const QString
& title
=QString() );
66 void insertItem( const QPixmap
&pixmap
, const QString
&text
, int index
=-1, const QString
& title
=QString() );
69 virtual void keyPressEvent( QKeyEvent
* );
70 virtual bool eventFilter( QObject
*, QEvent
* );
71 virtual void mousePressEvent( QMouseEvent
* );
72 virtual void mouseMoveEvent( QMouseEvent
* );
73 void paintEvent( QPaintEvent
* );
74 void selectWord(QKeyEvent
*e
);
78 Specialized signal that emits the state of the modifier
79 keys along with the actual activated text.
81 void activated( const QString
&, Qt::KeyboardModifiers
);
84 User has clicked on the security lock in the combobar
86 void showPageSecurity();
90 void slotSetIcon( int index
);
91 void slotActivated( const QString
& text
);
94 void updateItem( const QPixmap
& pix
, const QString
&, int index
, const QString
& title
);
97 void applyPermanent();
98 QString
temporaryItem() const { return itemText( temporary
); }
99 void removeDuplicates( int index
);
100 bool hasSufficientContrast(const QColor
&c1
, const QColor
&c2
);
102 bool m_returnPressed
;
106 QString m_currentText
;
110 void getStyleOption(QStyleOptionComboBox
* combo
);
112 static KConfig
*s_config
;
113 static const int temporary
; // the index of our temporary item
116 #endif // KONQ_COMBO_H