~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/designer/formwindowfile.h

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#ifndef FORMWINDOWFILE_H
31
31
#define FORMWINDOWFILE_H
32
32
 
33
 
#include <coreplugin/textdocument.h>
 
33
#include <texteditor/basetextdocument.h>
34
34
 
35
35
#include <QPointer>
36
36
 
42
42
namespace Designer {
43
43
namespace Internal {
44
44
 
45
 
class FormWindowFile : public Core::TextDocument
 
45
class FormWindowFile : public TextEditor::BaseTextDocument
46
46
{
47
47
    Q_OBJECT
48
48
 
49
49
public:
50
50
    explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0);
 
51
    ~FormWindowFile() { }
51
52
 
52
53
    // IDocument
53
 
    virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
54
 
    virtual QString fileName() const;
55
 
    virtual bool shouldAutoSave() const;
56
 
    virtual bool isModified() const;
57
 
    virtual bool isSaveAsAllowed() const;
 
54
    bool save(QString *errorString, const QString &fileName, bool autoSave);
 
55
    bool setContents(const QByteArray &contents);
 
56
    bool shouldAutoSave() const;
 
57
    bool isModified() const;
 
58
    bool isSaveAsAllowed() const;
58
59
    bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
59
 
    virtual QString defaultPath() const;
60
 
    virtual QString suggestedFileName() const;
61
 
    virtual QString mimeType() const;
62
 
    virtual void rename(const QString &newName);
 
60
    QString defaultPath() const;
 
61
    QString suggestedFileName() const;
 
62
    QString mimeType() const;
63
63
 
64
64
    // Internal
65
65
    void setSuggestedFileName(const QString &fileName);
67
67
    bool writeFile(const QString &fileName, QString *errorString) const;
68
68
 
69
69
    QDesignerFormWindowInterface *formWindow() const;
 
70
    void syncXmlFromFormWindow();
 
71
    QString formWindowContents() const;
70
72
 
71
73
signals:
72
74
    // Internal
73
 
    void saved();
74
 
    void reload(QString *errorString, const QString &);
75
 
    void setDisplayName(const QString &);
 
75
    void reloadRequested(QString *errorString, const QString &);
76
76
 
77
77
public slots:
78
 
    void setFileName(const QString &);
 
78
    void setFilePath(const QString &);
79
79
    void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; }
 
80
    void updateIsModified();
80
81
 
81
82
private slots:
82
83
    void slotFormWindowRemoved(QDesignerFormWindowInterface *w);
84
85
private:
85
86
    const QString m_mimeType;
86
87
 
87
 
    QString m_fileName;
88
88
    QString m_suggestedName;
89
89
    bool m_shouldAutoSave;
90
90
    // Might actually go out of scope before the IEditor due
91
91
    // to deleting the WidgetHost which owns it.
92
92
    QPointer<QDesignerFormWindowInterface> m_formWindow;
 
93
    bool m_isModified;
93
94
};
94
95
 
95
96
} // namespace Internal