1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 ** Copyright (c) 2010 Denis Mingulov.
8 ** Contact: Nokia Corporation (qt-info@nokia.com)
10 ** No Commercial Usage
12 ** This file contains pre-release code and may not be distributed.
13 ** You may use this file in accordance with the terms and conditions
14 ** contained in the Technology Preview License Agreement accompanying
17 ** GNU Lesser General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 2.1 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.LGPL included in the
22 ** packaging of this file. Please review the following information to
23 ** ensure the GNU Lesser General Public License version 2.1 requirements
24 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26 ** In addition, as a special exception, Nokia gives you certain additional
27 ** rights. These rights are described in the Nokia Qt LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30 ** If you have questions regarding the use of this file, please contact
31 ** Nokia at qt-info@nokia.com.
33 **************************************************************************/
38 #include <coreplugin/editormanager/ieditor.h>
39 #include <coreplugin/ifile.h>
41 #include <QtCore/QScopedPointer>
42 #include <QtCore/QStringList>
44 QT_FORWARD_DECLARE_CLASS(QAbstractButton)
45 QT_FORWARD_DECLARE_CLASS(QAction)
47 namespace ImageViewer {
49 class ImageViewerFile;
51 class ImageViewer : public Core::IEditor
54 Q_DISABLE_COPY(ImageViewer)
56 explicit ImageViewer(QWidget *parent = 0);
59 Core::Context context() const;
62 bool createNew(const QString &contents = QString());
63 bool open(const QString &fileName = QString());
66 QString displayName() const;
67 void setDisplayName(const QString &title);
69 bool duplicateSupported() const;
70 IEditor *duplicate(QWidget *parent);
72 QByteArray saveState() const;
73 bool restoreState(const QByteArray &state);
75 int currentLine() const;
76 int currentColumn() const;
78 bool isTemporary() const;
83 void scaleFactorUpdate(qreal factor);
85 void switchViewBackground();
86 void switchViewOutline();
89 void resetToOriginalSize();
94 \brief Try to change button's icon to the one from the current theme.
95 \param button Button where an icon should be changed
96 \param name Icon name in the in the current icon theme
97 \return true if icon is updated, false otherwise
99 bool updateButtonIconByTheme(QAbstractButton *button, const QString &name);
102 QScopedPointer<struct ImageViewerPrivate> d_ptr;
105 } // namespace Internal
106 } // namespace ImageViewer
108 #endif // IMAGEVIEWER_H