MailCommon::FolderRequester Class
class MailCommon::FolderRequester| Header: | #include <MailCommon/FolderRequester> |
| CMake: | find_package(KPim6MailCommon REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::MailCommon) |
| Inherits: | QWidget |
Public Functions
| FolderRequester(QWidget *parent = nullptr) | |
| Akonadi::Collection | collection() const |
| bool | hasCollection() const |
| void | setAccountActivities(Akonadi::AccountActivitiesAbstract *accountActivities) |
| void | setCollection(const Akonadi::Collection &collection, bool fetchCollection = true) |
| void | setMustBeReadWrite(bool readwrite) |
| void | setNotAllowToCreateNewFolder(bool notCreateNewFolder) |
| void | setSelectFolderTitleDialog(const QString &title) |
| void | setShowOutbox(bool show) |
Signals
| void | folderChanged(const Akonadi::Collection &) |
| void | invalidFolder() |
Reimplemented Protected Functions
| virtual void | keyPressEvent(QKeyEvent *e) override |
Protected Slots
| void | slotCollectionsReceived(KJob *) |
| void | slotOpenDialog() |
Detailed Description
A widget that contains a QLineEdit which shows the current folder and a button that fires a FolderSelectionDialog The dialog is set to disable readonly folders by default Search folders are excluded
@todo This should be cleaned up and go into libakonadi. This includes: - s/Folder/Collection/g - Use Akonadi::CollectionDialog instead of MailCommon::FolderSelectionDialog - merge that into CollectionDialog - or allow to replace the built-in dialog by your own - Allow to pass in an existing ETM, to remove the Kernel dependency
Member Function Documentation
[explicit] FolderRequester::FolderRequester(QWidget *parent = nullptr)
Constructor parent the parent widget
Akonadi::Collection FolderRequester::collection() const
Returns the selected collection.
See also setCollection().
[signal] void FolderRequester::folderChanged(const Akonadi::Collection &)
Emitted when the folder changed.
bool FolderRequester::hasCollection() const
Returns true if there's a valid collection set on this widget.
[signal] void FolderRequester::invalidFolder()
[override virtual protected] void FolderRequester::keyPressEvent(QKeyEvent *e)
Reimplements: QWidget::keyPressEvent(QKeyEvent *event).
Captures the space key of the key event e to open the dialog.
void FolderRequester::setAccountActivities(Akonadi::AccountActivitiesAbstract *accountActivities)
Sets accountActivities, used to filter the folders by activity.
void FolderRequester::setCollection(const Akonadi::Collection &collection, bool fetchCollection = true)
Presets the folder to the collection collection. Disable fetchcollection when not necessary fetchCollection
See also collection().
void FolderRequester::setMustBeReadWrite(bool readwrite)
Sets if readonly folders should be disabled, according to readwrite. Be aware that if you disable this the user can also select the 'Local Folders' folder which has no valid folder associated
void FolderRequester::setNotAllowToCreateNewFolder(bool notCreateNewFolder)
Prevents the creation of new folders from the folder dialog if notCreateNewFolder is true.
void FolderRequester::setSelectFolderTitleDialog(const QString &title)
Sets the title of the folder selection dialog.
void FolderRequester::setShowOutbox(bool show)
Sets whether the outbox folder is shown in the folder dialog, according to show.
[protected slot] void FolderRequester::slotCollectionsReceived(KJob *)
Updates the information we have about the current folder.
[protected slot] void FolderRequester::slotOpenDialog()
Opens the folder dialog.