SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
StringItemDefinition.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 // .NAME StringItemDefinition.h -
11 // .SECTION Description
12 // .SECTION See Also
13 
14 #ifndef smtk_attribute_StringItemDefinition_h
15 #define smtk_attribute_StringItemDefinition_h
16 
17 #include "smtk/attribute/ValueItemDefinitionTemplate.h"
18 
19 namespace smtk
20 {
21 namespace attribute
22 {
23 class SMTKCORE_EXPORT StringItemDefinition : public ValueItemDefinitionTemplate<std::string>
24 {
25 public:
27  static smtk::attribute::StringItemDefinitionPtr New(const std::string& myName)
28  {
30  }
31 
32  ~StringItemDefinition() override;
33  Item::Type type() const override;
34  smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
35  smtk::attribute::ItemPtr buildItem(Item* owningItem, int position, int subGroupPosition)
36  const override;
37  bool isMultiline() const { return m_multiline; }
38  void setIsMultiline(bool val) { m_multiline = val; }
39 
40  //Set/Get the secure property of the item definition
41  //Note this is purely a GUI hint for now - the default is false. Also this
42  // will not be supported when the Item is multiline.
43  void setIsSecure(bool val) { m_secure = val; }
44  bool isSecure() const { return m_secure; }
45 
47  smtk::attribute::ItemDefinition::CopyInfo& info) const override;
48 
49 protected:
50  StringItemDefinition(const std::string& myName);
51  bool m_multiline;
52 
53 private:
54  bool m_secure;
55 };
56 } // namespace attribute
57 } // namespace smtk
58 
59 #endif /* smtk_attribute_StringItemDefinition_h */
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::Item::Type
Type
Definition: Item.h:52
smtk::attribute::StringItemDefinition
Definition: StringItemDefinition.h:23
smtk::attribute::ItemDefinition::CopyInfo
Definition: ItemDefinition.h:47
smtk::attribute::Item
Definition: Item.h:43
smtkTypeMacro
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:51
smtk::attribute::StringItemDefinitionPtr
smtk::shared_ptr< smtk::attribute::StringItemDefinition > StringItemDefinitionPtr
Definition: PublicPointerDefs.h:518
smtk::attribute::Attribute
Represent a (possibly composite) value according to a definition.
Definition: Attribute.h:49
smtk::attribute::ItemPtr
smtk::shared_ptr< smtk::attribute::Item > ItemPtr
Definition: PublicPointerDefs.h:467
smtk::attribute::ItemDefinitionPtr
smtk::shared_ptr< smtk::attribute::ItemDefinition > ItemDefinitionPtr
Definition: PublicPointerDefs.h:473
smtk::attribute::ValueItemDefinitionTemplate
Definition: ValueItemDefinitionTemplate.h:26