ctkDICOM.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. All rights reserved.
  5. Distributed under a BSD License. See LICENSE.txt file.
  6. This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the above copyright notice for more information.
  9. =========================================================================*/
  10. #ifndef __ctkDICOM_h
  11. #define __ctkDICOM_h
  12. // Qt includes
  13. #include <QObject>
  14. #include <QSqlDatabase>
  15. // CTK includes
  16. #include <ctkPimpl.h>
  17. #include "CTKDICOMCoreExport.h"
  18. class ctkDICOMPrivate;
  19. class CTK_DICOM_CORE_EXPORT ctkDICOM : public QObject
  20. {
  21. Q_OBJECT
  22. public:
  23. typedef QObject Superclass;
  24. explicit ctkDICOM(QObject* parent = 0);
  25. virtual ~ctkDICOM();
  26. ///
  27. /// open the SQLite database in @param file. If the file does not
  28. /// exist, a new database is created and initialized with the
  29. /// default schema
  30. virtual bool openDatabase(const QString& file);
  31. const QSqlDatabase& database() const;
  32. const QString& GetLastError() const;
  33. ///
  34. /// close the database. It must not be used afterwards.
  35. void closeDatabase();
  36. ///
  37. /// delete all data and reinitialize the database.
  38. bool initializeDatabase(const char* schemaFile = ":/dicom/dicom-schema.sql");
  39. private:
  40. CTK_DECLARE_PRIVATE(ctkDICOM);
  41. };
  42. #endif