~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to kdevdesigner/designer/sourceeditor.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
** Copyright (C) 2000 Trolltech AS.  All rights reserved.
 
3
**
 
4
** This file is part of Qt Designer.
 
5
**
 
6
** This file may be distributed and/or modified under the terms of the
 
7
** GNU General Public License version 2 as published by the Free Software
 
8
** Foundation and appearing in the file LICENSE.GPL included in the
 
9
** packaging of this file.
 
10
**
 
11
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
 
12
** licenses may use this file in accordance with the Qt Commercial License
 
13
** Agreement provided with the Software.
 
14
**
 
15
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
16
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
17
**
 
18
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
19
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
20
**   information about Qt Commercial License Agreements.
 
21
**
 
22
** Contact info@trolltech.com if any conditions of this licensing are
 
23
** not clear to you.
 
24
**
 
25
**********************************************************************/
 
26
 
 
27
#ifndef SOURCEEDITOR_H
 
28
#define SOURCEEDITOR_H
 
29
 
 
30
#include "../interfaces/editorinterface.h"
 
31
#include <qvbox.h>
 
32
#include <qguardedptr.h>
 
33
 
 
34
class FormWindow;
 
35
class QCloseEvent;
 
36
struct LanguageInterface;
 
37
class Project;
 
38
class SourceFile;
 
39
 
 
40
class SourceEditor : public QVBox
 
41
{
 
42
    Q_OBJECT
 
43
 
 
44
public:
 
45
    SourceEditor( QWidget *parent, EditorInterface *iface, LanguageInterface *liface );
 
46
    ~SourceEditor();
 
47
 
 
48
    void setObject( QObject *fw, Project *p );
 
49
    QObject *object() const { return obj; }
 
50
    Project *project() const { return pro; }
 
51
    void setFunction( const QString &func, const QString &clss = QString::null );
 
52
    void setClass( const QString &clss );
 
53
    void save();
 
54
    bool saveAs();
 
55
    void setModified( bool b );
 
56
    bool isModified() const;
 
57
 
 
58
    static QString sourceOfObject( QObject *fw, const QString &lang, EditorInterface *iface, LanguageInterface *lIface );
 
59
 
 
60
    QString language() const;
 
61
    void setLanguage( const QString &l );
 
62
 
 
63
    void editCut();
 
64
    void editCopy();
 
65
    void editPaste();
 
66
    bool editIsUndoAvailable();
 
67
    bool editIsRedoAvailable();
 
68
    void editUndo();
 
69
    void editRedo();
 
70
    void editSelectAll();
 
71
 
 
72
    void configChanged();
 
73
    void refresh( bool allowSave );
 
74
    void resetContext();
 
75
 
 
76
    EditorInterface *editorInterface() const { return iFace; }
 
77
 
 
78
    void setFocus();
 
79
    int numLines() const;
 
80
    void saveBreakPoints();
 
81
    void clearStep();
 
82
    void clearStackFrame();
 
83
    void resetBreakPoints();
 
84
 
 
85
    QString text() const;
 
86
 
 
87
    void checkTimeStamp();
 
88
 
 
89
    SourceFile *sourceFile() const;
 
90
    FormWindow *formWindow() const;
 
91
 
 
92
protected:
 
93
    void closeEvent( QCloseEvent *e );
 
94
 
 
95
 
 
96
private:
 
97
    EditorInterface *iFace;
 
98
    LanguageInterface *lIface;
 
99
    QGuardedPtr<QObject> obj;
 
100
    Project *pro;
 
101
    QString lang;
 
102
    QGuardedPtr<QWidget> editor;
 
103
 
 
104
};
 
105
 
 
106
#endif