~ubuntu-branches/ubuntu/maverick/datakiosk/maverick

« back to all changes in this revision

Viewing changes to src/datakiosk/src/kcompletiontable.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-06-27 22:48:06 UTC
  • Revision ID: james.westby@ubuntu.com-20050627224806-8farkci1dc2onhbs
Tags: upstream-0.7
ImportĀ upstreamĀ versionĀ 0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
*   Copyright (C) 2005 by Adam Treat                                      *
 
3
*   treat@kde.org                                                         *
 
4
*                                                                         *
 
5
*   This program is free software; you can redistribute it and/or modify  *
 
6
*   it under the terms of the GNU General Public License as published by  *
 
7
*   the Free Software Foundation; either version 2 of the License, or     *
 
8
*   (at your option) any later version.                                   *
 
9
*                                                                         *
 
10
***************************************************************************/
 
11
 
 
12
#ifndef KCOMPLETIONTABLE_H
 
13
#define KCOMPLETIONTABLE_H
 
14
 
 
15
#include <kcompletionbox.h>
 
16
 
 
17
class KCompletionTable : public KCompletionBox
 
18
{
 
19
    Q_OBJECT
 
20
public:
 
21
    KCompletionTable( QWidget *parent = 0, const char *name = 0 );
 
22
 
 
23
    virtual ~KCompletionTable();
 
24
 
 
25
    void calculateWidths( QStringList &list );
 
26
 
 
27
    QValueList<int> columnWidths() const;
 
28
    void setColumnWidths( QValueList<int> &colWidths );
 
29
    void clearWidths();
 
30
 
 
31
    virtual QSize sizeHint() const;
 
32
 
 
33
public slots:
 
34
    virtual void popup();
 
35
    virtual void show();
 
36
    virtual void resize ( int w, int h );
 
37
 
 
38
protected:
 
39
    virtual void paintCell( QPainter * p, int row, int col );
 
40
 
 
41
private:
 
42
    void setupPainter( QPainter *p, QListBoxItem *i );
 
43
    int columnPosition( uint column );
 
44
 
 
45
private:
 
46
    int m_boxWidth;
 
47
    int m_boxHeight;
 
48
    QMap<int, int> m_colWidths;
 
49
    uint m_countCache;
 
50
};
 
51
 
 
52
#endif