1
// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*-
2
/* This file is part of the KDE project
3
Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk>
4
Copytight (C) by Andrew Stanley-Jones
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public
7
License as published by the Free Software Foundation; either
8
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
General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; see the file COPYING. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
20
#ifndef _KLIPPERPOPUP_H_
21
#define _KLIPPERPOPUP_H_
24
#include <Qt3Support/Q3PtrList>
36
* Default view of clipboard history.
39
class KlipperPopup : public KMenu
44
explicit KlipperPopup( History* history, QWidget* parent=0 );
46
void plugAction( QAction* action );
49
* Normally, the popupmenu is only rebuilt just before showing.
50
* If you need the pixel-size or similar of the this menu, call
55
History* history() { return m_history; }
56
const History* history() const { return m_history; }
59
void slotHistoryChanged() { m_dirty = true; }
60
void slotAboutToShow();
63
void rebuild( const QString& filter = QString() );
64
void buildFromScratch();
66
void insertSearchFilter();
67
void removeSearchFilter();
70
virtual void keyPressEvent( QKeyEvent* e );
73
bool m_dirty : 1; // true if menu contents needs to be rebuild.
76
* Contains the string shown if the menu is empty.
81
* Contains the string shown if the search string has no
82
* matches and the menu is not empty.
87
* The "document" (clipboard history)
97
* (unowned) actions to plug into the primary popup menu
99
Q3PtrList<QAction> m_actions;
102
* Proxy helper object used to track history items
104
PopupProxy* m_popupProxy;
107
* search filter widget
109
KLineEdit* m_filterWidget;
112
* id of search widget, for convenience
114
int m_filterWidgetId;
117
* The current number of history items in the clipboard