qmlprojectfile.h 2.21 KB
Newer Older
Tobias Hunger's avatar
Tobias Hunger committed
1
2
3
4
/**************************************************************************
**
** This file is part of Qt Creator
**
con's avatar
con committed
5
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
Tobias Hunger's avatar
Tobias Hunger committed
6
**
hjk's avatar
hjk committed
7
** Contact: Nokia Corporation (info@qt.nokia.com)
Tobias Hunger's avatar
Tobias Hunger committed
8
9
10
11
**
**
** GNU Lesser General Public License Usage
**
hjk's avatar
hjk committed
12
13
14
15
16
17
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
Tobias Hunger's avatar
Tobias Hunger committed
18
**
con's avatar
con committed
19
** In addition, as a special exception, Nokia gives you certain additional
hjk's avatar
hjk committed
20
** rights. These rights are described in the Nokia Qt LGPL Exception
con's avatar
con committed
21
22
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
23
24
25
26
27
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
con's avatar
con committed
28
29
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
Tobias Hunger's avatar
Tobias Hunger committed
30
31
32
**
**************************************************************************/

Kai Koehne's avatar
Kai Koehne committed
33
34
#ifndef QMLPROJECTFILE_H
#define QMLPROJECTFILE_H
Tobias Hunger's avatar
Tobias Hunger committed
35

Kai Koehne's avatar
Kai Koehne committed
36
#include <coreplugin/ifile.h>
Tobias Hunger's avatar
Tobias Hunger committed
37
38

namespace QmlProjectManager {
Kai Koehne's avatar
Kai Koehne committed
39

Tobias Hunger's avatar
Tobias Hunger committed
40
41
42
43
class QmlProject;

namespace Internal {

Kai Koehne's avatar
Kai Koehne committed
44
class QmlProjectFile : public Core::IFile
Tobias Hunger's avatar
Tobias Hunger committed
45
46
47
48
{
    Q_OBJECT

public:
Kai Koehne's avatar
Kai Koehne committed
49
50
    QmlProjectFile(QmlProject *parent, QString fileName);
    virtual ~QmlProjectFile();
Tobias Hunger's avatar
Tobias Hunger committed
51

Kai Koehne's avatar
Kai Koehne committed
52
53
    virtual bool save(const QString &fileName = QString());
    virtual QString fileName() const;
dt's avatar
dt committed
54
    virtual void rename(const QString &newName);
Tobias Hunger's avatar
Tobias Hunger committed
55

Kai Koehne's avatar
Kai Koehne committed
56
57
58
    virtual QString defaultPath() const;
    virtual QString suggestedFileName() const;
    virtual QString mimeType() const;
Tobias Hunger's avatar
Tobias Hunger committed
59

Kai Koehne's avatar
Kai Koehne committed
60
61
62
    virtual bool isModified() const;
    virtual bool isReadOnly() const;
    virtual bool isSaveAsAllowed() const;
Tobias Hunger's avatar
Tobias Hunger committed
63

64
65
    ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
    void reload(ReloadFlag flag, ChangeType type);
Tobias Hunger's avatar
Tobias Hunger committed
66

Kai Koehne's avatar
Kai Koehne committed
67
68
69
private:
    QmlProject *m_project;
    QString m_fileName;
Tobias Hunger's avatar
Tobias Hunger committed
70
71
72
73
74
};

} // namespace Internal
} // namespace QmlProjectManager

Kai Koehne's avatar
Kai Koehne committed
75
#endif // QMLPROJECTFILE_H