~ubuntu-branches/ubuntu/quantal/kde-baseapps/quantal

« back to all changes in this revision

Viewing changes to dolphin/src/kitemviews/private/kitemlistroleeditor.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-05-25 17:26:17 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120525172617-xr9bzhlugldbflvq
Tags: 4:4.8.80a-0ubuntu1
* Merge with debian git, remainging changes:
  - keep breaks/replaces
  - keep symbol files
  - keep kubuntu patches
  - dolphin suggests and not recommends ruby
  - add kfind, konsole and kompare to dolphin suggests
* konq-plugins breaks/replaces kde-baseapps-data << 4:4.8.80

* Drop squence numbers from kubuntu patches 

* New upstream beta release
  - refresh kubuntu_fix_systemsettings_about_me.diff
  - add new doc images to {konqueror,dolphin}.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com>             *
 
3
 *                                                                         *
 
4
 *   This program is free software; you can redistribute it and/or modify  *
 
5
 *   it under the terms of the GNU General Public License as published by  *
 
6
 *   the Free Software Foundation; either version 2 of the License, or     *
 
7
 *   (at your option) any later version.                                   *
 
8
 *                                                                         *
 
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         *
 
12
 *   GNU General Public License for more details.                          *
 
13
 *                                                                         *
 
14
 *   You should have received a copy of the GNU General Public License     *
 
15
 *   along with this program; if not, write to the                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef KITEMLISTROLEEDITOR_H
 
21
#define KITEMLISTROLEEDITOR_H
 
22
 
 
23
#include "libdolphin_export.h"
 
24
 
 
25
#include <KTextEdit>
 
26
 
 
27
/**
 
28
 * @brief Editor for renaming roles of a KItemListWidget.
 
29
 *
 
30
 * Provides signals when the editing got cancelled (e.g. by
 
31
 * pressing Escape or when losing the focus) or when the editing
 
32
 * got finished (e.g. by pressing Enter or Return).
 
33
 *
 
34
 * The size automatically gets increased if the text does not fit.
 
35
 */
 
36
class LIBDOLPHINPRIVATE_EXPORT KItemListRoleEditor : public KTextEdit
 
37
{
 
38
    Q_OBJECT
 
39
 
 
40
public:
 
41
    explicit KItemListRoleEditor(QWidget* parent);
 
42
    virtual ~KItemListRoleEditor();
 
43
 
 
44
    void setIndex(int index);
 
45
    int index() const;
 
46
 
 
47
    void setRole(const QByteArray& role);
 
48
    QByteArray role() const;
 
49
 
 
50
    virtual bool eventFilter(QObject* watched, QEvent* event);
 
51
 
 
52
signals:
 
53
    void roleEditingFinished(int index, const QByteArray& role, const QVariant& value);
 
54
    void roleEditingCanceled(int index, const QByteArray& role, const QVariant& value);
 
55
 
 
56
protected:
 
57
    virtual bool event(QEvent* event);
 
58
    virtual void keyPressEvent(QKeyEvent* event);
 
59
 
 
60
private slots:
 
61
    /**
 
62
     * Increases the size of the editor in case if there is not
 
63
     * enough room for the text.
 
64
     */
 
65
    void autoAdjustSize();
 
66
 
 
67
private:
 
68
    int m_index;
 
69
    QByteArray m_role;
 
70
 
 
71
};
 
72
 
 
73
#endif