• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

akonadi

standardactionmanager.h
00001 /*
00002     Copyright (c) 2008 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_STANDARDACTIONMANAGER_H
00021 #define AKONADI_STANDARDACTIONMANAGER_H
00022 
00023 #include "akonadi_export.h"
00024 
00025 #include <QtCore/QObject>
00026 
00027 #include <akonadi/collection.h>
00028 #include <akonadi/item.h>
00029 
00030 class KAction;
00031 class KActionCollection;
00032 class KLocalizedString;
00033 class QItemSelectionModel;
00034 class QWidget;
00035 
00036 namespace Akonadi {
00037 
00038 class FavoriteCollectionsModel;
00039 
00125 class AKONADI_EXPORT StandardActionManager : public QObject
00126 {
00127   Q_OBJECT
00128   public:
00132     enum Type {
00133       CreateCollection,          
00134       CopyCollections,           
00135       DeleteCollections,         
00136       SynchronizeCollections,    
00137       CollectionProperties,      
00138       CopyItems,                 
00139       Paste,                     
00140       DeleteItems,               
00141       ManageLocalSubscriptions,  
00142       AddToFavoriteCollections,  
00143       RemoveFromFavoriteCollections,  
00144       RenameFavoriteCollection,  
00145       CopyCollectionToMenu,      
00146       CopyItemToMenu,            
00147       MoveItemToMenu,            
00148       MoveCollectionToMenu,      
00149       CutItems,                  
00150       CutCollections,            
00151       CreateResource,            
00152       DeleteResources,           
00153       ResourceProperties,        
00154       SynchronizeResources,      
00155       ToggleWorkOffline,         
00156       CopyCollectionToDialog,    
00157       MoveCollectionToDialog,    
00158       CopyItemToDialog,          
00159       MoveItemToDialog,          
00160       SynchronizeCollectionsRecursive,    
00161       LastType                   
00162     };
00163 
00167     enum TextContext {
00168       DialogTitle,                
00169       DialogText,                 
00170       MessageBoxTitle,            
00171       MessageBoxText,             
00172       MessageBoxAlternativeText,  
00173       ErrorMessageTitle,          
00174       ErrorMessageText            
00175     };
00176 
00183     explicit StandardActionManager( KActionCollection *actionCollection, QWidget *parent = 0 );
00184 
00188     ~StandardActionManager();
00189 
00195     void setCollectionSelectionModel( QItemSelectionModel *selectionModel );
00196 
00201     void setItemSelectionModel( QItemSelectionModel* selectionModel );
00202 
00210     void setFavoriteCollectionsModel( FavoriteCollectionsModel *favoritesModel );
00211 
00219     void setFavoriteSelectionModel( QItemSelectionModel *selectionModel );
00220 
00226     KAction* createAction( Type type );
00227 
00232     void createAllActions();
00233 
00237     KAction* action( Type type ) const;
00238 
00251     void setActionText( Type type, const KLocalizedString &text );
00252 
00262     void interceptAction( Type type, bool intercept = true );
00263 
00270     Akonadi::Collection::List selectedCollections() const;
00271 
00278     Akonadi::Item::List selectedItems() const;
00279 
00285     void setContextText( Type type, TextContext context, const QString &text );
00286 
00292     void setContextText( Type type, TextContext context, const KLocalizedString &text );
00293 
00299     void setMimeTypeFilter( const QStringList &mimeTypes );
00300 
00306     void setCapabilityFilter( const QStringList &capabilities );
00307 
00314     void setCollectionPropertiesPageNames( const QStringList &names );
00315 
00316   Q_SIGNALS:
00322     void actionStateUpdated();
00323 
00324   private:
00325     //@cond PRIVATE
00326     class Private;
00327     Private* const d;
00328 
00329     Q_PRIVATE_SLOT( d, void updateActions() )
00330 #ifndef QT_NO_CLIPBOARD
00331     Q_PRIVATE_SLOT( d, void clipboardChanged(QClipboard::Mode) )
00332 #endif
00333     Q_PRIVATE_SLOT( d, void collectionSelectionChanged() )
00334     Q_PRIVATE_SLOT( d, void favoriteSelectionChanged() )
00335 
00336     Q_PRIVATE_SLOT( d, void slotCreateCollection() )
00337     Q_PRIVATE_SLOT( d, void slotCopyCollections() )
00338     Q_PRIVATE_SLOT( d, void slotCutCollections() )
00339     Q_PRIVATE_SLOT( d, void slotDeleteCollection() )
00340     Q_PRIVATE_SLOT( d, void slotSynchronizeCollection() )
00341     Q_PRIVATE_SLOT( d, void slotSynchronizeCollectionRecursive() )
00342     Q_PRIVATE_SLOT( d, void slotCollectionProperties() )
00343     Q_PRIVATE_SLOT( d, void slotCopyItems() )
00344     Q_PRIVATE_SLOT( d, void slotCutItems() )
00345     Q_PRIVATE_SLOT( d, void slotPaste() )
00346     Q_PRIVATE_SLOT( d, void slotDeleteItems() )
00347     Q_PRIVATE_SLOT( d, void slotDeleteItemsDeferred(const Akonadi::Item::List &) )
00348     Q_PRIVATE_SLOT( d, void slotLocalSubscription() )
00349     Q_PRIVATE_SLOT( d, void slotAddToFavorites() )
00350     Q_PRIVATE_SLOT( d, void slotRemoveFromFavorites() )
00351     Q_PRIVATE_SLOT( d, void slotRenameFavorite() )
00352     Q_PRIVATE_SLOT( d, void slotCopyCollectionTo() )
00353     Q_PRIVATE_SLOT( d, void slotMoveCollectionTo() )
00354     Q_PRIVATE_SLOT( d, void slotCopyItemTo() )
00355     Q_PRIVATE_SLOT( d, void slotMoveItemTo() )
00356     Q_PRIVATE_SLOT( d, void slotCopyCollectionTo(QAction*) )
00357     Q_PRIVATE_SLOT( d, void slotMoveCollectionTo(QAction*) )
00358     Q_PRIVATE_SLOT( d, void slotCopyItemTo(QAction*) )
00359     Q_PRIVATE_SLOT( d, void slotMoveItemTo(QAction*) )
00360     Q_PRIVATE_SLOT( d, void slotCreateResource() )
00361     Q_PRIVATE_SLOT( d, void slotDeleteResource() )
00362     Q_PRIVATE_SLOT( d, void slotResourceProperties() )
00363     Q_PRIVATE_SLOT( d, void slotSynchronizeResource() )
00364     Q_PRIVATE_SLOT( d, void slotToggleWorkOffline(bool) )
00365 
00366     Q_PRIVATE_SLOT( d, void collectionCreationResult(KJob*) )
00367     Q_PRIVATE_SLOT( d, void collectionDeletionResult(KJob*) )
00368     Q_PRIVATE_SLOT( d, void itemDeletionResult(KJob*) )
00369     Q_PRIVATE_SLOT( d, void resourceCreationResult(KJob*) )
00370     Q_PRIVATE_SLOT( d, void pasteResult(KJob*) )
00371 
00372     Q_PRIVATE_SLOT( d, void enableAction(int, bool) )
00373     Q_PRIVATE_SLOT( d, void updatePluralLabel(int, int) )
00374     Q_PRIVATE_SLOT( d, bool isFavoriteCollection(const Akonadi::Collection&) )
00375 
00376     Q_PRIVATE_SLOT( d, void aboutToShowMenu() )
00377     //@endcond
00378 };
00379 
00380 }
00381 
00382 #endif

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal