• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

scancontroller.h

Go to the documentation of this file.
00001 /* ============================================================
00002  *
00003  * This file is a part of digiKam project
00004  * http://www.digikam.org
00005  *
00006  * Date        : 2007-10-28
00007  * Description : scan pictures interface.
00008  * 
00009  * Copyright (C) 2005-2006 by Tom Albers <tomalbers@kde.nl>
00010  * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
00011  * Copyright (C) 2007-2008 by Marcel Wiesweg <marcel.wiesweg@gmx.de>
00012  *
00013  * This program is free software; you can redistribute it
00014  * and/or modify it under the terms of the GNU General
00015  * Public License as published by the Free Software Foundation;
00016  * either version 2, or (at your option)
00017  * any later version.
00018  * 
00019  * This program is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.
00023  * 
00024  * ============================================================ */
00025 
00026 #ifndef SCANCONTROLLER_H
00027 #define SCANCONTROLLER_H
00028 
00029 // Qt includes.
00030 
00031 #include <QThread>
00032 #include <QString>
00033 
00034 // KDE includes.
00035 
00036 #include <kurl.h>
00037 
00038 // Local includes.
00039 
00040 #include "digikam_export.h"
00041 #include "initializationobserver.h"
00042 
00043 
00044 namespace Digikam
00045 {
00046 
00047 class CollectionScanner;
00048 class SplashScreen;
00049 class PAlbum;
00050 class ScanControllerPriv;
00051 
00052 class ScanController : public QThread, public InitializationObserver
00053 {
00054     Q_OBJECT
00055 
00056 public:
00057 
00058     static ScanController *instance();
00059     void shutDown();
00060 
00061     enum Advice
00062     {
00063         Success,
00064         ContinueWithoutDatabase,
00065         AbortImmediately
00066     };
00067 
00073     Advice databaseInitialization();
00074 
00080     void completeCollectionScan(SplashScreen *splash=0);
00081 
00086     void scheduleCollectionScan(const QString &path);
00087 
00095     void suspendCollectionScan();
00096     void resumeCollectionScan();
00097 
00105     void hintAtMoveOrCopyOfAlbum(const PAlbum *album, const PAlbum *dstAlbum, const QString &newAlbumName = QString());
00106     void hintAtMoveOrCopyOfAlbum(const PAlbum *album, const QString &dstPath, const QString &newAlbumName = QString());
00107 
00114     void hintAtMoveOrCopyOfItems(const QList<qlonglong> ids, const PAlbum *dstAlbum, QStringList itemNames);
00115     void hintAtMoveOrCopyOfItem(qlonglong id, const PAlbum *dstAlbum, QString itemName);
00116 
00117 signals:
00118 
00119     void databaseInitialized(bool success);
00120     void completeScanDone();
00121     void triggerShowProgressDialog();
00122     void incrementProgressDialog(int);
00123     void errorFromInitialization(const QString &);
00124     void progressFromInitialization(const QString &, int);
00125 
00126 private slots:
00127 
00128     void slotTotalFilesToScan(int count);
00129     void slotStartScanningAlbum(const QString &albumRoot, const QString &album);
00130     void slotFinishedScanningAlbum(const QString &, const QString &, int filesScanned);
00131     void slotStartScanningAlbumRoot(const QString &albumRoot);
00132     void slotStartScanningForStaleAlbums();
00133     void slotStartScanningAlbumRoots();
00134 
00135     void slotShowProgressDialog();
00136     void slotTriggerShowProgressDialog();
00137 
00138     void slotProgressFromInitialization(const QString &message, int numberOfSteps);
00139     void slotErrorFromInitialization(const QString &errorMessage);
00140 
00141 protected:
00142 
00143     virtual void run();
00144 
00145 private:
00146 
00147     friend class ScanControllerCreator;
00148     ScanController();
00149     ~ScanController();
00150 
00151     ScanControllerPriv *d;
00152 
00153     virtual void moreSchemaUpdateSteps(int numberOfSteps);
00154     virtual void schemaUpdateProgress(const QString &message, int numberOfSteps);
00155     virtual void finishedSchemaUpdate(UpdateResult result);
00156     virtual void connectCollectionScanner(CollectionScanner *scanner) ;
00157     virtual void error(const QString &errorMessage);
00158 
00159     void createProgressDialog();
00160 };
00161 
00162 }  // namespace Digikam
00163 
00164 #endif /* SCANCONTROLLER_H */

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • digikam
Generated for API Reference by doxygen 1.5.7
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