ctkDICOM.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDICOM_h
  15. #define __ctkDICOM_h
  16. // Qt includes
  17. #include <QObject>
  18. #include <QSqlDatabase>
  19. // CTK includes
  20. #include <ctkPimpl.h>
  21. #include "CTKDICOMCoreExport.h"
  22. class ctkDICOMPrivate;
  23. class CTK_DICOM_CORE_EXPORT ctkDICOM : public QObject
  24. {
  25. Q_OBJECT
  26. public:
  27. typedef QObject Superclass;
  28. explicit ctkDICOM(QObject* parent = 0);
  29. virtual ~ctkDICOM();
  30. ///
  31. /// open the SQLite database in @param file. If the file does not
  32. /// exist, a new database is created and initialized with the
  33. /// default schema
  34. virtual void openDatabase(const QString& file);
  35. const QSqlDatabase& database() const;
  36. const QString& GetLastError() const;
  37. ///
  38. /// close the database. It must not be used afterwards.
  39. void closeDatabase();
  40. ///
  41. /// delete all data and reinitialize the database.
  42. bool initializeDatabase(const char* schemaFile = ":/dicom/dicom-schema.sql");
  43. private:
  44. CTK_DECLARE_PRIVATE(ctkDICOM);
  45. };
  46. #endif