Warning, file /office/calligra/libs/main/KoPartAdaptor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 Copyright (C) 2000 David Faure <faure@kde.org> 0003 Copyright (C) 2006 Fredrik Edemar <f_edemar@linux.se> 0004 0005 This library is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU Library General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License. 0009 0010 This library is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 Library General Public License for more details. 0014 0015 You should have received a copy of the GNU Library General Public License 0016 along with this library; see the file COPYING.LIB. If not, write to 0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef KOPARTADAPTOR_H 0022 #define KOPARTADAPTOR_H 0023 0024 #ifndef QT_NO_DBUS 0025 0026 #include <QMap> 0027 0028 #include <QObject> 0029 #include <QDBusAbstractAdaptor> 0030 #include <QList> 0031 #include "komain_export.h" 0032 class KoPart; 0033 0034 /** 0035 * DBUS interface for any Calligra document 0036 * Use KoApplicationIface to get hold of an existing document's interface, 0037 * or to create a document. 0038 */ 0039 class KOMAIN_EXPORT KoPartAdaptor : public QDBusAbstractAdaptor 0040 { 0041 Q_OBJECT 0042 Q_CLASSINFO("D-Bus Interface", "org.kde.calligra.document") 0043 public: 0044 0045 explicit KoPartAdaptor(KoPart* doc); 0046 ~KoPartAdaptor() override; 0047 0048 public Q_SLOTS: // METHODS 0049 /** 0050 * Returns the URL for this document (empty, real URL, or internal one) 0051 */ 0052 Q_SCRIPTABLE QString url(); 0053 0054 /** 0055 * Opens a document stored in @p url 0056 * Warning: this is asynchronous. The document might not be loaded yet when 0057 * this call returns. See isLoading. 0058 */ 0059 Q_SCRIPTABLE void openUrl(const QString & url); 0060 0061 /** 0062 * @return TRUE is the document is still loading 0063 */ 0064 Q_SCRIPTABLE bool isLoading(); 0065 0066 /** 0067 * @return TRUE is the document has been modified 0068 */ 0069 Q_SCRIPTABLE bool isModified(); 0070 0071 /** 0072 * @return the number of views this document is displayed in 0073 */ 0074 Q_SCRIPTABLE int viewCount(); 0075 0076 /** 0077 * @return a representing the view with index @p idx 0078 */ 0079 Q_SCRIPTABLE QString view(int idx); 0080 0081 /** 0082 * Saves the document under its existing filename 0083 */ 0084 Q_SCRIPTABLE void save(); 0085 0086 /** 0087 * Saves the document under a new name 0088 */ 0089 Q_SCRIPTABLE void saveAs(const QString & url); 0090 0091 Q_SCRIPTABLE void setOutputMimeType(const QByteArray & mimetype); 0092 0093 Q_SCRIPTABLE QString documentInfoAuthorName() const; 0094 Q_SCRIPTABLE QString documentInfoEmail() const; 0095 Q_SCRIPTABLE QString documentInfoCompanyName() const; 0096 Q_SCRIPTABLE QString documentInfoTitle() const; 0097 Q_SCRIPTABLE QString documentInfoAbstract() const; 0098 Q_SCRIPTABLE QString documentInfoKeywords() const; 0099 Q_SCRIPTABLE QString documentInfoSubject() const; 0100 Q_SCRIPTABLE QString documentInfoTelephone() const; 0101 Q_SCRIPTABLE QString documentInfoTelephoneWork() const; 0102 Q_SCRIPTABLE QString documentInfoTelephoneHome() const; 0103 Q_SCRIPTABLE QString documentInfoFax() const; 0104 Q_SCRIPTABLE QString documentInfoCountry() const; 0105 Q_SCRIPTABLE QString documentInfoPostalCode() const; 0106 Q_SCRIPTABLE QString documentInfoCity() const; 0107 Q_SCRIPTABLE QString documentInfoStreet() const; 0108 Q_SCRIPTABLE QString documentInfoInitial() const; 0109 Q_SCRIPTABLE QString documentInfoAuthorPosition() const; 0110 Q_SCRIPTABLE void setDocumentInfoAuthorName(const QString & text); 0111 Q_SCRIPTABLE void setDocumentInfoEmail(const QString &text); 0112 Q_SCRIPTABLE void setDocumentInfoCompanyName(const QString &text); 0113 Q_SCRIPTABLE void setDocumentInfoTelephone(const QString &text); 0114 Q_SCRIPTABLE void setDocumentInfoTelephoneWork(const QString &text); 0115 Q_SCRIPTABLE void setDocumentInfoTelephoneHome(const QString &text); 0116 Q_SCRIPTABLE void setDocumentInfoFax(const QString &text); 0117 Q_SCRIPTABLE void setDocumentInfoCountry(const QString &text); 0118 Q_SCRIPTABLE void setDocumentInfoTitle(const QString & text); 0119 Q_SCRIPTABLE void setDocumentInfoPostalCode(const QString &text); 0120 Q_SCRIPTABLE void setDocumentInfoCity(const QString & text); 0121 Q_SCRIPTABLE void setDocumentInfoStreet(const QString &text); 0122 Q_SCRIPTABLE void setDocumentInfoAbstract(const QString &text); 0123 Q_SCRIPTABLE void setDocumentInfoInitial(const QString & text); 0124 Q_SCRIPTABLE void setDocumentInfoKeywords(const QString & text); 0125 Q_SCRIPTABLE void setDocumentInfoSubject(const QString & text); 0126 Q_SCRIPTABLE void setDocumentInfoAuthorPosition(const QString & text); 0127 0128 Q_SIGNALS: 0129 0130 0131 public: 0132 0133 protected: 0134 KoPart* m_pDoc; 0135 }; 0136 0137 #endif // QT_NO_DBUS 0138 0139 #endif 0140