diff --git a/src/collectionpage/collectionexpirypage.h b/src/collectionpage/collectionexpirypage.h index 673207b..6a48033 100644 --- a/src/collectionpage/collectionexpirypage.h +++ b/src/collectionpage/collectionexpirypage.h @@ -1,78 +1,81 @@ /* Copyright (c) 2009-2019 Montel Laurent Copyright (c) 2013 Jonathan Marten This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_COLLECTIONEXPIRYPAGE_H #define MAILCOMMON_COLLECTIONEXPIRYPAGE_H #include "mailcommon_export.h" #include #include class KPluralHandlingSpinBox; class KJob; class QCheckBox; class QPushButton; class QRadioButton; namespace MailCommon { class FolderRequester; - +/** + * @brief The CollectionExpiryPage class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT CollectionExpiryPage : public Akonadi::CollectionPropertiesPage { Q_OBJECT public: explicit CollectionExpiryPage(QWidget *parent = nullptr); ~CollectionExpiryPage() override; Q_REQUIRED_RESULT bool canHandle(const Akonadi::Collection &col) const override; void load(const Akonadi::Collection &collection) override; void save(Akonadi::Collection &collection) override; protected: void init(); protected Q_SLOTS: void slotUpdateControls(); void slotCollectionModified(KJob *job); void slotChanged(); void slotSaveAndExpire(); private: void saveAndExpire(Akonadi::Collection &collection, bool saveSettings, bool _expirenow); private: QCheckBox *expireReadMailCB = nullptr; KPluralHandlingSpinBox *expireReadMailSB = nullptr; QCheckBox *expireUnreadMailCB = nullptr; KPluralHandlingSpinBox *expireUnreadMailSB = nullptr; QRadioButton *moveToRB = nullptr; FolderRequester *folderSelector = nullptr; QRadioButton *deletePermanentlyRB = nullptr; QPushButton *expireNowPB = nullptr; Akonadi::Collection mCollection; bool mChanged = false; }; AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionExpiryPageFactory, CollectionExpiryPage) } #endif diff --git a/src/collectionpage/collectiongeneralpage.h b/src/collectionpage/collectiongeneralpage.h index 8d997d7..fe70a05 100644 --- a/src/collectionpage/collectiongeneralpage.h +++ b/src/collectionpage/collectiongeneralpage.h @@ -1,80 +1,84 @@ /* Copyright (c) 2009-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_COLLECTIONGENERALPAGE_H #define MAILCOMMON_COLLECTIONGENERALPAGE_H #include "mailcommon_export.h" #include class KLineEdit; class QCheckBox; template class QSharedPointer; namespace PimCommon { class IncidencesForWidget; class ContentTypeWidget; } namespace KIdentityManagement { class IdentityCombo; } class QVBoxLayout; namespace MailCommon { class FolderSettings; +/** + * @brief The CollectionGeneralPage class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT CollectionGeneralPage : public Akonadi::CollectionPropertiesPage { Q_OBJECT public: explicit CollectionGeneralPage(QWidget *parent = nullptr); ~CollectionGeneralPage() override; void load(const Akonadi::Collection &collection) override; void save(Akonadi::Collection &collection) override; protected: void init(const Akonadi::Collection &); private Q_SLOTS: void slotIdentityCheckboxChanged(); void slotFolderContentsSelectionChanged(int); void slotNameChanged(const QString &name); private: void addLine(QWidget *parent, QVBoxLayout *layout); QString mColorName; PimCommon::ContentTypeWidget *mContentsComboBox = nullptr; PimCommon::IncidencesForWidget *mIncidencesForComboBox = nullptr; QCheckBox *mSharedSeenFlagsCheckBox = nullptr; QCheckBox *mNotifyOnNewMailCheckBox = nullptr; QCheckBox *mKeepRepliesInSameFolderCheckBox = nullptr; QCheckBox *mHideInSelectionDialogCheckBox = nullptr; QCheckBox *mUseDefaultIdentityCheckBox = nullptr; KLineEdit *mNameEdit = nullptr; KIdentityManagement::IdentityCombo *mIdentityComboBox = nullptr; QSharedPointer mFolderCollection; bool mIsLocalSystemFolder = false; bool mIsResourceFolder = false; }; AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionGeneralPageFactory, CollectionGeneralPage) } #endif diff --git a/src/filter/filterimporter/filterimportergmail.h b/src/filter/filterimporter/filterimportergmail.h index a6d24a2..44e4ea5 100644 --- a/src/filter/filterimporter/filterimportergmail.h +++ b/src/filter/filterimporter/filterimportergmail.h @@ -1,38 +1,42 @@ /* Copyright (c) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERIMPORTERGMAIL_H #define FILTERIMPORTERGMAIL_H #include "filter/filterimporter/filterimporterabstract.h" class QFile; namespace MailCommon { +/** + * @brief The FilterImporterGmail class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FilterImporterGmail : public FilterImporterAbstract { public: explicit FilterImporterGmail(QFile *file); ~FilterImporterGmail(); static QString defaultFiltersSettingsPath(); private: QString createUniqFilterName(); void parseFilters(const QDomElement &e); int mFilterCount; }; } #endif // FILTERIMPORTERGMAIL_H diff --git a/src/filter/filterimporter/filterimporterthunderbird.h b/src/filter/filterimporter/filterimporterthunderbird.h index ff0b53e..9152741 100644 --- a/src/filter/filterimporter/filterimporterthunderbird.h +++ b/src/filter/filterimporter/filterimporterthunderbird.h @@ -1,52 +1,55 @@ /* Copyright (c) 2011-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_FILTERIMPORTER_FILTERIMPORTERTHUNDERBIRD_P_H #define MAILCOMMON_FILTERIMPORTER_FILTERIMPORTERTHUNDERBIRD_P_H #include "filter/filterimporter/filterimporterabstract.h" #include "mailcommon_export.h" #include class QFile; namespace MailCommon { class MailFilter; - +/** + * @brief The FilterImporterThunderbird class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FilterImporterThunderbird : public FilterImporterAbstract { public: explicit FilterImporterThunderbird(QFile *file, bool interactive = true); FilterImporterThunderbird(QString string, bool interactive = true); ~FilterImporterThunderbird(); static QString defaultThunderbirdFiltersSettingsPath(); static QString defaultIcedoveFiltersSettingsPath(); static QString defaultSeaMonkeyFiltersSettingsPath(); private: void readStream(QTextStream &stream); static QString cleanArgument(const QString &line, const QString &removeStr); void extractConditions(const QString &line, MailCommon::MailFilter *filter); QString extractActions(const QString &line, MailFilter *filter, QString &value); void extractType(const QString &line, MailCommon::MailFilter *filter); bool splitConditions(const QString &cond, MailCommon::MailFilter *filter); MailFilter *parseLine(QTextStream &stream, QString line, MailCommon::MailFilter *filter); }; } #endif /* FILTERIMPORTERTHUNDERBIRD_H */ diff --git a/src/filter/filterimporterpathcache.h b/src/filter/filterimporterpathcache.h index c9f31f5..b7cb742 100644 --- a/src/filter/filterimporterpathcache.h +++ b/src/filter/filterimporterpathcache.h @@ -1,45 +1,49 @@ /* Copyright (C) 2017-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERIMPORTERPATHCACHE_H #define FILTERIMPORTERPATHCACHE_H #include #include #include #include "mailcommon_export.h" namespace MailCommon { +/** + * @brief The FilterImporterPathCache class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FilterImporterPathCache : public QObject { Q_OBJECT public: static FilterImporterPathCache *self(); explicit FilterImporterPathCache(QObject *parent = nullptr); ~FilterImporterPathCache(); void insert(const QString &original, const Akonadi::Collection &newValue); Q_REQUIRED_RESULT Akonadi::Collection convertedFilterPath(const QString &original); void clear(); Q_REQUIRED_RESULT int count() const; private: QHash mFilterCache; }; } #endif // FILTERIMPORTERPATHCACHE_H diff --git a/src/filter/invalidfilters/invalidfilterwidget.h b/src/filter/invalidfilters/invalidfilterwidget.h index 560a848..e3c1189 100644 --- a/src/filter/invalidfilters/invalidfilterwidget.h +++ b/src/filter/invalidfilters/invalidfilterwidget.h @@ -1,44 +1,48 @@ /* Copyright (c) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef INVALIDFILTERWIDGET_H #define INVALIDFILTERWIDGET_H #include #include "invalidfilterinfo.h" #include "mailcommon_export.h" namespace MailCommon { class InvalidFilterListView; +/** + * @brief The InvalidFilterWidget class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT InvalidFilterWidget : public QWidget { Q_OBJECT public: explicit InvalidFilterWidget(QWidget *parent = nullptr); ~InvalidFilterWidget(); void setInvalidFilters(const QVector &lst); Q_SIGNALS: void showDetails(const QString &); void hideInformationWidget(); private: InvalidFilterListView *mInvalidFilterListWidget = nullptr; }; } #endif // INVALIDFILTERWIDGET_H diff --git a/src/filter/mailfilter.h b/src/filter/mailfilter.h index 377b9a0..50358f8 100644 --- a/src/filter/mailfilter.h +++ b/src/filter/mailfilter.h @@ -1,354 +1,357 @@ /* * kmail: KDE mail client * Copyright (c) 1996-1998 Stefan Taferner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef MAILCOMMON_MAILFILTER_H #define MAILCOMMON_MAILFILTER_H #include "mailcommon_export.h" #include "mailcommon/filteraction.h" #include "mailcommon/searchpattern.h" #include #include #include #include #include class KConfigGroup; namespace MailCommon { +/** + * @brief The MailFilter class + */ class MAILCOMMON_EXPORT MailFilter { friend MAILCOMMON_EXPORT QDataStream &operator<<(QDataStream &stream, const MailFilter &filter); friend MAILCOMMON_EXPORT QDataStream &operator>>(QDataStream &stream, MailFilter &filter); public: /** Result codes returned by process. They mean: @param GoOn Everything OK. You are still the owner of the message and you should continue applying filter actions to this message. @param CriticalError A critical error occurred (e.g. "disk full"). @param NoResult For internal use only! */ enum ReturnCode { NoResult, GoOn, CriticalError }; /** Account type codes used by setApplicability. They mean: @param All Apply to all accounts @param ButImap Apply to all but IMAP accounts @param Checked apply to all accounts specified by setApplyOnAccount */ enum AccountType { All, ButImap, Checked }; /** Constructor that initializes basic settings. */ MailFilter(); /** Constructor that initializes from given config group. * Filters are stored one by one in config groups, i.e. * one filter, one group. */ explicit MailFilter(const KConfigGroup &aConfig, bool internal, bool &needUpdate); /** Copy constructor. Constructs a deep copy of @p aFilter. */ MailFilter(const MailFilter &other); /** Cleanup. */ ~MailFilter(); static int filterActionsMaximumSize(); void generateRandomIdentifier(); /** * Returns the unique identifier of this filter. */ Q_REQUIRED_RESULT QString identifier() const; /** Equivalent to @p pattern()->name(). @return name of the filter */ Q_REQUIRED_RESULT QString name() const; /** Execute the filter action(s) on the given message. Returns: @li 2 if a critical error occurred, @li 1 if the caller is still the owner of the message, @li 0 if processed successfully. @param context The context that contains the item to which the actions should be applied. @param stopIt Contains @c true if the caller may apply other filters and @c false if he shall stop the filtering of this message. @param applyOnOutbound Defines whether to apply the rules on the outbound. */ Q_REQUIRED_RESULT ReturnCode execActions(ItemContext &context, bool &stopIt, bool applyOnOutbound) const; /** * Returns the required part from the item that is needed for the filter to * operate. See @ref SearchRule::RequiredPart */ Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart(const QString &id) const; /** Write contents to given config group. */ void writeConfig(KConfigGroup &config, bool exportFilter) const; /** Initialize from given config group. */ Q_REQUIRED_RESULT bool readConfig(const KConfigGroup &config, bool interactive = false); /** Remove empty rules (and actions one day). */ Q_REQUIRED_RESULT QString purify(bool removeAction = true); /** Check for empty pattern and action list. */ bool isEmpty() const; /** Provides a reference to the internal action list. If your used the @p setAction() and @p action() functions before, please convert to using myFilter->actions()->at() and friends now. */ QVector *actions(); /** Provides a reference to the internal action list. Const version. */ const QVector *actions() const; /** Provides a reference to the internal pattern. If you used the @p matches() function before, please convert to using myFilter->pattern()->matches() now. */ Q_REQUIRED_RESULT SearchPattern *pattern(); /** Provides a reference to the internal pattern. If you used the @p matches() function before, please convert to using myFilter->pattern()->matches() now. */ const SearchPattern *pattern() const; /** Set whether this filter should be applied on outbound messages (@p aApply == true) or not. See applyOnOutbound applyOnInbound setApplyOnInbound */ void setApplyOnOutbound(bool aApply); /** Set whether this filter should be applied on outbound messages before sending (@p aApply == TRUE) or not. See applyOnOutbound applyOnInbound setApplyOnInbound */ void setApplyBeforeOutbound(bool aApply); /** @return true if this filter should be applied on outbound messages, false otherwise. @see setApplyOnOutbound applyOnInbound setApplyOnInbound */ bool applyOnOutbound() const; /** @return TRUE if this filter should be applied on outbound messages before they are sent, FALSE otherwise. @see setApplyOnOutbound applyOnInbound setApplyOnInbound */ bool applyBeforeOutbound() const; /** Set whether this filter should be applied on inbound messages (@p aApply == true) or not. @see setApplyOnOutbound applyOnInbound applyOnOutbound */ void setApplyOnInbound(bool aApply); /** @return true if this filter should be applied on inbound messages, false otherwise. @see setApplyOnOutbound applyOnOutbound setApplyOnInbound */ bool applyOnInbound() const; /** Set whether this filter should be applied on explicit (CTRL-J) filtering (@p aApply == true) or not. @see setApplyOnOutbound applyOnInbound applyOnOutbound */ void setApplyOnExplicit(bool aApply); /** @return true if this filter should be applied on explicit (CTRL-J) filtering, false otherwise. @see setApplyOnOutbound applyOnOutbound setApplyOnInbound */ bool applyOnExplicit() const; /** Set whether this filter should be applied on inbound messages for all accounts (@p aApply == All) or inbound messages for all but IMAP accounts (@p aApply == ButImap) or for a specified set of accounts only. Only applicable to filters that are applied on inbound messages. @see setApplyOnInbound setApplyOnAccount */ void setApplicability(AccountType aApply = All); /** Sets whether the filter should be applied on inbound emails in all folders, not just Inbox. */ void setApplyOnAllFoldersInbound(bool aApply); /** Returns whether the filter should be applied on inbound emails in all folders, not just Inbox. */ bool applyOnAllFoldersInbound() const; /** @return true if this filter should be applied on inbound messages for all accounts, or false if this filter is to be applied on a specified set of accounts only. Only applicable to filters that are applied on inbound messages. @see setApplicability */ AccountType applicability() const; /** Set whether this filter should be applied on inbound messages for the account with id (@p id). Only applicable to filters that are only applied to a specified set of accounts. @see setApplicability applyOnAccount */ void setApplyOnAccount(const QString &id, bool aApply = true); /** @return true if this filter should be applied on inbound messages from the account with id (@p id), false otherwise. @see setApplicability */ bool applyOnAccount(const QString &id) const; void setStopProcessingHere(bool aStop); bool stopProcessingHere() const; /** Set whether this filter should be plugged into the filter menu. */ void setConfigureShortcut(bool aShort); /** @return true if this filter should be plugged into the filter menu, false otherwise. @see setConfigureShortcut */ bool configureShortcut() const; /** Set whether this filter should be plugged into the toolbar. This can be done only if a shortcut is defined. @see setConfigureShortcut */ void setConfigureToolbar(bool aTool); /** @return true if this filter should be plugged into the toolbar, false otherwise. @see setConfigureToolbar */ bool configureToolbar() const; /** @return The toolbar name of this filter. * @see setToolbarName */ QString toolbarName() const; /** This sets the toolbar name for this filter. * The toolbar name is the text to be displayed underneath the toolbar icon * for this filter. This is usually the same as name(), expect when * explicitly set by this function. * This is useful if the normal filter mame is too long for the toolbar. * @see toolbarName, name */ void setToolbarName(const QString &toolbarName); /** Set the shortcut to be used if plugged into the filter menu or toolbar. Default is no shortcut. @see setConfigureShortcut setConfigureToolbar */ void setShortcut(const QKeySequence &shortcut); /** @return The shortcut assigned to the filter. @see setShortcut */ const QKeySequence &shortcut() const; /** Set the icon to be used if plugged into the filter menu or toolbar. Default is the gear icon. @see setConfigureShortcut setConfigureToolbar */ void setIcon(const QString &icon); /** @return The name of the icon to be used. @see setIcon */ QString icon() const; /** * Called from the filter manager when a folder is moved. * Tests if the folder aFolder is used in any action. Changes it * to aNewFolder folder in this case. * @return true if a change in some action occurred, * false if no action was affected. */ void folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder); /** Returns the filter in a human-readable form. useful for debugging but not much else. Don't use, as it may well go away in the future... */ const QString asString() const; /** Set the mode for using automatic naming for the filter. If the feature is enabled, the name is derived from the first filter rule. */ void setAutoNaming(bool useAutomaticNames); /** @return Tells, if an automatic name is used for the filter */ bool isAutoNaming() const; /** Return if filter is enabled or not */ bool isEnabled() const; void setEnabled(bool); void generateSieveScript(QStringList &requiresModules, QString &code); void clearApplyOnAccount(); void agentRemoved(const QString &identifier); private: QString mIdentifier; SearchPattern mPattern; QVector mActions; QStringList mAccounts; QString mIcon; QString mToolbarName; QKeySequence mShortcut; bool bApplyOnInbound : 1; bool bApplyBeforeOutbound : 1; bool bApplyOnOutbound : 1; bool bApplyOnExplicit : 1; bool bApplyOnAllFolders : 1; bool bStopProcessingHere : 1; bool bConfigureShortcut : 1; bool bConfigureToolbar : 1; bool bAutoNaming : 1; bool bEnabled : 1; AccountType mApplicability; }; MAILCOMMON_EXPORT QDataStream &operator<<(QDataStream &stream, const MailFilter &filter); MAILCOMMON_EXPORT QDataStream &operator>>(QDataStream &stream, MailFilter &filter); } #endif /*MAILCOMMON_MAILFILTER_H*/ diff --git a/src/folder/accountconfigorderdialog.h b/src/folder/accountconfigorderdialog.h index 650265e..b12d730 100644 --- a/src/folder/accountconfigorderdialog.h +++ b/src/folder/accountconfigorderdialog.h @@ -1,52 +1,56 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef ACCOUNTCONFIGORDERDIALOG_H #define ACCOUNTCONFIGORDERDIALOG_H #include #include "mailcommon_export.h" namespace MailCommon { class AccountConfigOrderDialogPrivate; class MailCommonSettings; +/** + * @brief The AccountConfigOrderDialog class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT AccountConfigOrderDialog : public QDialog { Q_OBJECT public: explicit AccountConfigOrderDialog(MailCommon::MailCommonSettings *settings, QWidget *parent); ~AccountConfigOrderDialog(); private: void slotOk(); void slotMoveUp(); void slotMoveDown(); void slotEnableControls(); void slotEnableAccountOrder(bool state); enum Type { IdentifierAccount = Qt::UserRole + 1 }; void writeConfig(); void readConfig(); void init(); AccountConfigOrderDialogPrivate *const d; }; } #endif // ACCOUNTCONFIGORDERDIALOG_H diff --git a/src/folder/foldercollectionmonitor.h b/src/folder/foldercollectionmonitor.h index 3623d4b..f5c610c 100644 --- a/src/folder/foldercollectionmonitor.h +++ b/src/folder/foldercollectionmonitor.h @@ -1,61 +1,65 @@ /* Copyright (c) 2009-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_FOLDERCOLLECTIONMONITOR_H #define MAILCOMMON_FOLDERCOLLECTIONMONITOR_H #include "mailcommon_export.h" #include #include #include #include class QAbstractItemModel; namespace Akonadi { class ChangeRecorder; class Collection; class Session; } namespace MailCommon { class FolderCollectionMonitorPrivate; +/** + * @brief The FolderCollectionMonitor class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FolderCollectionMonitor : public QObject { Q_OBJECT public: explicit FolderCollectionMonitor(Akonadi::Session *session, QObject *parent = nullptr); ~FolderCollectionMonitor(); Q_REQUIRED_RESULT Akonadi::ChangeRecorder *monitor() const; void expireAllFolders(bool immediate, QAbstractItemModel *collectionModel); void expunge(const Akonadi::Collection &, bool sync = false); protected: void expireAllCollection(const QAbstractItemModel *model, bool immediate, const QModelIndex &parentIndex = QModelIndex()); private: void slotDeleteJob(KJob *job); FolderCollectionMonitorPrivate *const d; }; } #endif diff --git a/src/folder/foldersettings.h b/src/folder/foldersettings.h index fad9cba..c0c2cce 100644 --- a/src/folder/foldersettings.h +++ b/src/folder/foldersettings.h @@ -1,149 +1,153 @@ /* Copyright (c) 2009-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_FOLDERSETTINGS_H #define MAILCOMMON_FOLDERSETTINGS_H #include "mailcommon_export.h" #include #include using MessageCore::MailingList; #include #include #include #include #include namespace MailCommon { +/** + * @brief The FolderSettings class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FolderSettings : public QObject { Q_OBJECT public: static QSharedPointer forCollection( const Akonadi::Collection &coll, bool writeConfig = true); ~FolderSettings(); void setCollection(const Akonadi::Collection &collection); static QString configGroupName(const Akonadi::Collection &col); static void clearCache(); static void resetHtmlFormat(); Q_REQUIRED_RESULT bool isWriteConfig() const; void setWriteConfig(bool writeConfig); void writeConfig() const; void readConfig(); Q_REQUIRED_RESULT QString name() const; Q_REQUIRED_RESULT bool isReadOnly() const; Q_REQUIRED_RESULT bool isStructural() const; Q_REQUIRED_RESULT bool isSystemFolder() const; Q_REQUIRED_RESULT qint64 count() const; Q_REQUIRED_RESULT bool canDeleteMessages() const; Q_REQUIRED_RESULT bool canCreateMessages() const; Q_REQUIRED_RESULT bool isValid() const; Q_REQUIRED_RESULT Akonadi::Collection::Rights rights() const; Q_REQUIRED_RESULT Akonadi::CollectionStatistics statistics() const; void setShortcut(const QKeySequence &); const QKeySequence &shortcut() const; /** * Get / set whether the default identity should be used instead of the * identity specified by setIdentity(). */ void setUseDefaultIdentity(bool useDefaultIdentity); Q_REQUIRED_RESULT bool useDefaultIdentity() const; void setIdentity(uint identity); Q_REQUIRED_RESULT uint identity() const; /** * Returns true if this folder is associated with a mailing-list. */ void setMailingListEnabled(bool enabled); Q_REQUIRED_RESULT bool isMailingListEnabled() const; void setMailingList(const MailingList &mlist); MailingList mailingList() const; /** * Returns true if the replies to mails from this folder should be * put in the same folder. */ Q_REQUIRED_RESULT bool putRepliesInSameFolder() const; void setPutRepliesInSameFolder(bool b); /** * Returns true if this folder should be hidden from all folder selection dialogs */ Q_REQUIRED_RESULT bool hideInSelectionDialog() const; void setHideInSelectionDialog(bool hide); Q_REQUIRED_RESULT QString mailingListPostAddress() const; Q_REQUIRED_RESULT uint fallBackIdentity() const; Q_REQUIRED_RESULT MessageViewer::Viewer::DisplayFormatMessage formatMessage() const; void setFormatMessage(MessageViewer::Viewer::DisplayFormatMessage formatMessage); protected Q_SLOTS: void slotIdentitiesChanged(); private: explicit FolderSettings(const Akonadi::Collection &col, bool writeconfig); QString resource() const; Akonadi::Collection mCollection; /** Mailing list attributes */ bool mMailingListEnabled; MailingList mMailingList; bool mUseDefaultIdentity; uint mIdentity; MessageViewer::Viewer::DisplayFormatMessage mFormatMessage = MessageViewer::Viewer::Unknown; /** Should replies to messages in this folder be put in here? */ bool mPutRepliesInSameFolder = false; /** Should this folder be hidden in the folder selection dialog? */ bool mHideInSelectionDialog = false; /** shortcut associated with this folder or null, if none is configured. */ QKeySequence mShortcut; bool mWriteConfig; }; } #endif diff --git a/src/folder/foldertreewidgetproxymodel.h b/src/folder/foldertreewidgetproxymodel.h index 2ecd04b..2897861 100644 --- a/src/folder/foldertreewidgetproxymodel.h +++ b/src/folder/foldertreewidgetproxymodel.h @@ -1,77 +1,81 @@ /* Copyright (c) 2009-2019 Laurent Montel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAILCOMMON_FOLDERTREEWIDGETPROXYMODEL_H #define MAILCOMMON_FOLDERTREEWIDGETPROXYMODEL_H #include #include #include "mailcommon_export.h" namespace MailCommon { +/** + * @brief The FolderTreeWidgetProxyModel class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FolderTreeWidgetProxyModel : public Akonadi::EntityRightsFilterModel { Q_OBJECT public: enum FolderTreeWidgetProxyModelOption { None = 0, HideVirtualFolder = 1, HideSpecificFolder = 2, HideOutboxFolder = 4 }; Q_DECLARE_FLAGS(FolderTreeWidgetProxyModelOptions, FolderTreeWidgetProxyModelOption) explicit FolderTreeWidgetProxyModel( QObject *parent = nullptr, FolderTreeWidgetProxyModelOptions = FolderTreeWidgetProxyModel::None); ~FolderTreeWidgetProxyModel() override; Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override; Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; void setEnabledCheck(bool enable); Q_REQUIRED_RESULT bool enabledCheck() const; void setHideVirtualFolder(bool exclude); Q_REQUIRED_RESULT bool hideVirtualFolder() const; void setHideSpecificFolder(bool hide); Q_REQUIRED_RESULT bool hideSpecificFolder() const; void setHideOutboxFolder(bool hide); Q_REQUIRED_RESULT bool hideOutboxFolder() const; void addContentMimeTypeInclusionFilter(const QString &mimeTypes); void updatePalette(); void readConfig(); void setWarningThreshold(qreal threshold); protected: bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const override; private: class Private; Private *const d; }; } #endif diff --git a/src/job/folderjob.h b/src/job/folderjob.h index ad9f28a..2919700 100644 --- a/src/job/folderjob.h +++ b/src/job/folderjob.h @@ -1,107 +1,110 @@ /* * * Copyright (c) 2003 Zack Rusin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of this program with any edition of * the Qt library by Trolltech AS, Norway (or with modified versions * of Qt that use the same license as Qt), and distribute linked * combinations including the two. You must obey the GNU General * Public License in all respects for all of the code used other than * Qt. If you modify this file, you may extend this exception to * your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from * your version. */ #ifndef MAILCOMMON_FOLDERJOB_H #define MAILCOMMON_FOLDERJOB_H #include #include "mailcommon_export.h" namespace MailCommon { +/** + * @brief The FolderJob class + */ class MAILCOMMON_EXPORT FolderJob : public QObject { Q_OBJECT public: explicit FolderJob(QObject *parent = nullptr); virtual ~FolderJob(); /** * Start the job */ void start(); /** * Interrupt the job. Note that the finished() and result() signal * will be emitted, unless you called setPassiveDestructor(true) before. * This kills the job, don't use it afterwards. */ virtual void kill(); /** * @return the error code of the job. This must only be called from * the slot connected to the finished() signal. */ Q_REQUIRED_RESULT int error() const; /** * @return true if this job can be canceled, e.g. to exit the application */ Q_REQUIRED_RESULT bool isCancellable() const; /** * Call this to change the "cancellable" property of this job. * By default, tListMessages, tGetMessage, tGetFolder and tCheckUidValidity * are cancellable, the others are not. But when copying, a non-cancellable * tGetMessage is needed. */ void setCancellable(bool b); Q_SIGNALS: /** * Emitted when the job finishes all processing. */ void finished(); /** * Emitted when the job finishes all processing. * More convenient signal than finished(), since it provides a pointer to the job. * This signal is emitted by the FolderJob destructor => do NOT downcast * the job to a subclass! */ void result(FolderJob *job); protected: /** * Has to be reimplemented. It's called by the start() method. Should * start the processing of the specified job function. */ virtual void execute() = 0; Akonadi::Collection mSrcFolder; int mErrorCode; bool mStarted; bool mCancellable; }; } #endif diff --git a/src/snippets/snippetsmanager.h b/src/snippets/snippetsmanager.h index e77a3e7..cd951c7 100644 --- a/src/snippets/snippetsmanager.h +++ b/src/snippets/snippetsmanager.h @@ -1,140 +1,147 @@ /* Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company Author Tobias Koenig Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAILCOMMON_SNIPPETSMANAGER_H #define MAILCOMMON_SNIPPETSMANAGER_H #include "mailcommon_export.h" #include class KActionCollection; class QAbstractItemModel; class QAction; class QItemSelectionModel; namespace MailCommon { +/** + * @brief The SnippetInfo struct + * @author Laurent Montel + */ struct MAILCOMMON_EXPORT SnippetInfo { SnippetInfo(const QString &_subject, const QString &_text, const QString &_to, const QString &_cc, const QString &_bcc, const QString &_attachment) : subject(_subject) , text(_text) , to(_to) , cc(_cc) , bcc(_bcc) , attachment(_attachment) { } QString subject; QString text; QString to; QString cc; QString bcc; QString attachment; }; - +/** + * @brief The SnippetsManager class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT SnippetsManager : public QObject { Q_OBJECT public: /** * Creates a new snippets manager. * * @param actionCollection The action collection where the manager will * register the snippet shortcuts at. * @param parent The parent object. * @param widget The widget. */ explicit SnippetsManager(KActionCollection *actionCollection, QObject *parent = nullptr, QWidget *widget = nullptr); /** * Destroys the snippets manager. */ ~SnippetsManager(); /** * Returns the model that represents the snippets. */ QAbstractItemModel *model() const; /** * Returns the selection model that is used by the manager to select the * snippet or snippet group to work on. */ QItemSelectionModel *selectionModel() const; /** * Returns the action that handles adding new snippets. */ QAction *addSnippetAction() const; /** * Returns the action that handles editing the currently selected snippet. */ QAction *editSnippetAction() const; /** * Returns the action that handles deleting the currently selected snippet. */ QAction *deleteSnippetAction() const; /** * Returns the action that handles adding new snippet groups. */ QAction *addSnippetGroupAction() const; /** * Returns the action that handles editing the currently selected snippet group. */ QAction *editSnippetGroupAction() const; /** * Returns the action that handles deleting the currently selected snippet group. */ QAction *deleteSnippetGroupAction() const; /** * Returns the action that handles inserting a snippet into the editor. */ QAction *insertSnippetAction() const; /** * Returns whether the currently selected item is a snippet group. */ Q_REQUIRED_RESULT bool snippetGroupSelected() const; /** * Returns the name of the currently selected snippet or snippet group. */ Q_REQUIRED_RESULT QString selectedName() const; Q_SIGNALS: void insertSnippet(); void insertSnippetInfo(const SnippetInfo &info); private: //@cond PRIVATE class Private; Private *const d; //@endcond }; } #endif diff --git a/src/snippets/snippetsmodel.h b/src/snippets/snippetsmodel.h index 89e07bb..3309a3d 100644 --- a/src/snippets/snippetsmodel.h +++ b/src/snippets/snippetsmodel.h @@ -1,115 +1,122 @@ /* Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net, Author: Tobias Koenig Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAILCOMMON_SNIPPETSMODEL_P_H #define MAILCOMMON_SNIPPETSMODEL_P_H #include #include #include "mailcommon_export.h" namespace MailCommon { class SnippetItem; - +/** + * @brief The SnippetsInfo struct + * @author Laurent Montel + */ struct MAILCOMMON_EXPORT SnippetsInfo { QString newName; QKeySequence keySequence; QString text; QString keyword; QString subject; QString to; QString cc; QString bcc; QString attachment; }; +/** + * @brief The SnippetsModel class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT SnippetsModel : public QAbstractItemModel { Q_OBJECT public: enum Role { IsGroupRole = Qt::UserRole + 1, ///< Returns whether the index represents a group NameRole, ///< The name of a snippet or group TextRole, ///< The text of a snippet KeySequenceRole, ///< The key sequence to activate a snippet KeywordRole, ///< The keyword which will replace by snippet SubjectRole, ///< The subject of a snippet ToRole, ///< The To of a snippet CcRole, ///< The Cc of a snippet BccRole, ///< The Cc of a snippet AttachmentRole, ///< The Attachment of a snippet }; static SnippetsModel *instance(); explicit SnippetsModel(QObject *parent = nullptr); ~SnippetsModel() override; Q_REQUIRED_RESULT bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; Q_REQUIRED_RESULT QVariant data(const QModelIndex &index, int role) const override; Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override; Q_REQUIRED_RESULT QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; Q_REQUIRED_RESULT QModelIndex parent(const QModelIndex &index) const override; Q_REQUIRED_RESULT int rowCount(const QModelIndex &parent = QModelIndex()) const override; Q_REQUIRED_RESULT int columnCount(const QModelIndex &parent = QModelIndex()) const override; Q_REQUIRED_RESULT QStringList mimeTypes() const override; Q_REQUIRED_RESULT QMimeData *mimeData(const QModelIndexList &indexes) const override; Q_REQUIRED_RESULT bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; Q_REQUIRED_RESULT Qt::DropActions supportedDropActions() const override; void save(const QString &filename = QString()); void load(const QString &filename = QString()); Q_REQUIRED_RESULT QMap savedVariables() const; void setSavedVariables(const QMap &savedVariables); Q_REQUIRED_RESULT QVector snippetsInfo() const; protected: bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; Q_SIGNALS: void dndDone(); void addNewDndSnippset(const QString &); void updateActionCollection(const QString &oldName, const QString &newName, const QKeySequence &keySequence, const QString &text, const QString &subject, const QString &to, const QString &cc, const QString &bcc, const QString &attachment); private: QModelIndex createGroup(const QString &groupName); void createSnippet(const QModelIndex &groupIndex, const QString &snippetName, const QString &snippetText, const QString &snippetKeySequence, const QString &snippetKeyword, const QString &snippetSubject, const QString &to, const QString &cc, const QString &bcc, const QString &attachment); SnippetItem *mRootItem = nullptr; QMap mSavedVariables; }; } Q_DECLARE_TYPEINFO(MailCommon::SnippetsInfo, Q_MOVABLE_TYPE); #endif diff --git a/src/snippets/snippetwidget.h b/src/snippets/snippetwidget.h index ccb4f73..d5116d2 100644 --- a/src/snippets/snippetwidget.h +++ b/src/snippets/snippetwidget.h @@ -1,88 +1,92 @@ /* Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SNIPPETWIDGET_H #define SNIPPETWIDGET_H #include #include #include "mailcommon_export.h" class KActionCollection; class SnippetWidgetPrivate; namespace MailCommon { +/** + * @brief The SnippetWidget class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT SnippetWidget : public QWidget { Q_OBJECT public: explicit SnippetWidget(QWidget *parent = nullptr); ~SnippetWidget(); void setName(const QString &name); Q_REQUIRED_RESULT QString name() const; void setText(const QString &text); Q_REQUIRED_RESULT QString text() const; void setKeySequence(const QKeySequence &sequence); Q_REQUIRED_RESULT QKeySequence keySequence() const; void setKeyword(const QString &keyword); Q_REQUIRED_RESULT QString keyword() const; void setTo(const QString &keyword); Q_REQUIRED_RESULT QString to() const; void setCc(const QString &keyword); Q_REQUIRED_RESULT QString cc() const; void setBcc(const QString &keyword); Q_REQUIRED_RESULT QString bcc() const; void setGroupModel(QAbstractItemModel *model); void setGroupIndex(const QModelIndex &index); Q_REQUIRED_RESULT QModelIndex groupIndex() const; Q_REQUIRED_RESULT bool snippetIsValid() const; void setCheckActionCollections(const QList &lst); void setGroupSelected(bool b); Q_REQUIRED_RESULT bool isGroupSelected() const; void clear(); Q_REQUIRED_RESULT bool wasChanged() const; void setWasChanged(bool b); void setSubject(const QString &text); Q_REQUIRED_RESULT QString subject() const; void setAttachment(const QString &keyword); Q_REQUIRED_RESULT QString attachment() const; Q_SIGNALS: void textChanged(const QString &str); void groupChanged(int index); private: SnippetWidgetPrivate *const d; }; } #endif // SNIPPETWIDGET_H diff --git a/src/widgets/favoritecollectionwidget.h b/src/widgets/favoritecollectionwidget.h index 60b7f0c..a7a850d 100644 --- a/src/widgets/favoritecollectionwidget.h +++ b/src/widgets/favoritecollectionwidget.h @@ -1,70 +1,74 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILCOMMON_FAVORITECOLLECTIONWIDGET_H #define MAILCOMMON_FAVORITECOLLECTIONWIDGET_H #include "mailcommon_export.h" #include class KXMLGUIClient; class KActionCollection; namespace MailCommon { class MailCommonSettings; +/** + * @brief The FavoriteCollectionWidget class + * @author Laurent Montel + */ class MAILCOMMON_EXPORT FavoriteCollectionWidget : public Akonadi::EntityListView { Q_OBJECT public: explicit FavoriteCollectionWidget(MailCommon::MailCommonSettings *settings, KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr); ~FavoriteCollectionWidget() override; void readConfig(); void updateMode(); void changeViewMode(QListView::ViewMode mode); protected Q_SLOTS: void slotGeneralFontChanged(); void slotGeneralPaletteChanged(); void slotChangeIconSize(bool); void slotChangeMode(bool); protected: void paintEvent(QPaintEvent *) override; void dragEnterEvent(QDragEnterEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override; void dropEvent(QDropEvent *event) override; void startDrag(Qt::DropActions) override; void mousePressEvent(QMouseEvent *e) override; Q_SIGNALS: void newTabRequested(bool); private: bool acceptEvent(QDropEvent *event) const; void createMenu(KActionCollection *ac); class Private; Private *const d; }; } #endif /* MAILCOMMON_FAVORITECOLLECTIONWIDGET_H */