ctkDICOMPersonName.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef __ctkDICOMPersonName_h
  16. #define __ctkDICOMPersonName_h
  17. #include "ctkDICOMCoreExport.h"
  18. #include <QString>
  19. #include <QSharedDataPointer>
  20. #include <QMetaType>
  21. #include <string>
  22. class ctkDICOMPersonNameData;
  23. /// \ingroup DICOM_Core
  24. ///
  25. /// \brief A person's name as modelled in DICOM.
  26. ///
  27. class CTK_DICOM_CORE_EXPORT ctkDICOMPersonName
  28. {
  29. public:
  30. ctkDICOMPersonName(const QString& lastName = QString::null,
  31. const QString& firstName = QString::null,
  32. const QString& middleName = QString::null,
  33. const QString& namePrefix = QString::null,
  34. const QString& nameSuffix = QString::null);
  35. ctkDICOMPersonName(const ctkDICOMPersonName& other);
  36. ctkDICOMPersonName& operator=(const ctkDICOMPersonName& other);
  37. virtual ~ctkDICOMPersonName();
  38. ///
  39. /// \brief "Lastname, FirstName MiddleName, Suffix" (useful for alphabetical sorting)
  40. ///
  41. QString formattedName() const;
  42. QString lastName() const;
  43. QString firstName() const;
  44. QString middleName() const;
  45. QString namePrefix() const;
  46. QString nameSuffix() const;
  47. /// cast operator
  48. operator QString() const;
  49. std::string toStdString() const;
  50. private:
  51. QSharedDataPointer<ctkDICOMPersonNameData> d;
  52. };
  53. typedef QList<ctkDICOMPersonName> ctkDICOMPersonNameList;
  54. Q_DECLARE_METATYPE(ctkDICOMPersonName);
  55. #endif // ctkDICOMPersonName_h