CFx SDK Documentation  2023 SP0
RxAttribute.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2018, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2018 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _ODRXATTRIBUTE_INCLUDED_
25 #define _ODRXATTRIBUTE_INCLUDED_
26 
27 #include "OdString.h"
28 #include "OdArray.h"
29 #include "RxValue.h"
30 
31  //DOM-IGNORE-BEGIN
32 class OdRxAttributeImpl;
33 class OdRxAttributeCollectionImpl;
34 class OdRxMember;
35 class OdRxPropertyBase;
36 //DOM-IGNORE-END
37 
44 {
45 public:
46  //DOM-IGNORE-BEGIN
48  //DOM-IGNORE-END
49 
53  virtual ~OdRxAttribute();
54 protected:
55  //DOM-IGNORE-BEGIN
56  OdRxAttribute(OdRxAttributeImpl*);
57  friend class OdRxAttributeImpl;
58  OdRxAttributeImpl* m_pImpl;
59  //DOM-IGNORE-END
60 };
61 
63 
71 {
72  //DOM-IGNORE-BEGIN
73  friend class OdRxAttributeCollectionImpl;
74  OdRxAttributeCollectionImpl* m_pImpl;
75  //DOM-IGNORE-END
76 public:
81 
86 
90  int count() const;
91 
95  const OdRxAttribute* getAt(int index) const;
96 
101 
105  const OdRxAttribute* get(const OdRxClass* type) const;
106 
111 
115  OdResult add(const OdRxAttribute* attribute);
116 
120  OdResult override(const OdRxAttribute* attribute);
121 
127  OdResult remove(const OdRxAttribute* attribute);
128 };
129 
136 {
137 protected:
141  virtual OdResult subLoadString(unsigned int id, unsigned int sourceHint, OdString& result) = 0;
142 public:
143  //DOM-IGNORE-BEGIN
145  //DOM-IGNORE-END
146 
150  static OdResult loadString(const OdRxObject* pClass, unsigned int id, unsigned int sourceHint, OdString& result);
151 };
152 
153 //DOM-IGNORE-BEGIN
154 class OdRxLocalizedNameAttributeImpl;
155 //DOM-IGNORE-END
156 
164 {
165 public:
166  //DOM-IGNORE-BEGIN
168  //DOM-IGNORE-END
169 
173  static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint = 0);
174 
179  //static OdString getLocalizedName(const OdRxObject* pO);
180 
184  unsigned int id() const;
185 
189  unsigned int sourceHint() const;
190 protected:
191  //DOM-IGNORE-BEGIN
192  OdRxLocalizedNameAttribute(OdRxLocalizedNameAttributeImpl*);
193  //DOM-IGNORE-END
194 };
195 
196 //DOM-IGNORE-BEGIN
197 class OdRxAlternateLocalizedNameAttributeImpl;
198 //DOM-IGNORE-END
199 
205 {
206 public:
207  //DOM-IGNORE-BEGIN
209  //DOM-IGNORE-END
210 
214  static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint = 0);
215 
216  //DOM-IGNORE-BEGIN
217  OdRxAlternateLocalizedNameAttribute(OdRxAlternateLocalizedNameAttributeImpl* impl);
218  //DOM-IGNORE-END
219 };
220 
221 class OdRxUiPlacementAttributeImpl;
222 
228 {
229 public:
230  //DOM-IGNORE-BEGIN
232  OdRxUiPlacementAttribute(OdRxUiPlacementAttributeImpl*);
233  //DOM-IGNORE-END
234 
238  static OdRxAttributePtr createObject(const OdString& category, unsigned int weight);
239 
243  static OdString getCategory(const OdRxObject* member);
244 
248  static float getWeight(const OdRxObject* member);
249 };
250 
251 //DOM-IGNORE-BEGIN
252 class OdRxLMVAttributeImpl;
254 {
255 public:
257  OdRxLMVAttribute(OdRxLMVAttributeImpl*);
258 };
259 //DOM-IGNORE-END
260 
261  //DOM-IGNORE-BEGIN
262 class OdRxDescriptionAttributeImpl;
263 //DOM-IGNORE-END
264 
271 {
272 public:
273  //DOM-IGNORE-BEGIN
275  OdRxDescriptionAttribute(OdRxDescriptionAttributeImpl*);
276  //DOM-IGNORE-END
277 
281  static OdRxAttributePtr createObject(const OdString& description, unsigned int id = 0, unsigned int sourceHint = 0);
282 
287  //static OdString getDescription(const OdRxObject* pO);
288 
292  unsigned int id() const;
296  unsigned int sourceHint() const;
297 };
298 
302 typedef const OdRxPropertyBase* (*FindPropertyCallback)(const OdRxObject* pObject, const OdString& pszPropName);
303 
307 typedef bool(*ConvertValueCallback)(const OdRxPropertyBase* pProperty, OdRxValue& value);
308 
309 //DOM-IGNORE-BEGIN
310 class OdRxRefersToAttributeImpl;
311 //DOM-IGNORE-END
312 
319 {
320 public:
322 
327 
332  OdString path() const;
333 
344 protected:
345  //DOM-IGNORE-BEGIN
346  OdRxRefersToAttribute(OdRxRefersToAttributeImpl*);
347  //DOM-IGNORE-END
348 };
349 
350 //DOM-IGNORE-BEGIN
351 class OdRxCOMAttributeImpl;
352 //DOM-IGNORE-END
353 
359 {
360 public:
361  //DOM-IGNORE-BEGIN
363  //DOM-IGNORE-END
371  OdString name() const;
372  //DOM-IGNORE-BEGIN
373 protected:
374  OdRxCOMAttribute(OdRxCOMAttributeImpl*);
375  //DOM-IGNORE-END
376 };
377 
378 //
379 class OdRxFilePathAttributeImpl;
385 {
386 public:
387  //DOM-IGNORE-BEGIN
389 protected:
390  OdRxFilePathAttribute(OdRxFilePathAttributeImpl*);
391  //DOM-IGNORE-END
392 };
393 
394 //DOM-IGNORE-BEGIN
395 class OdRxFlagsAttributeImpl;
396 //DOM-IGNORE-END
397 
403 {
404 public:
405  //DOM-IGNORE-BEGIN
407 protected:
408  OdRxFlagsAttribute(OdRxFlagsAttributeImpl*);
409  //DOM-IGNORE-END
410 };
411 
412 //DOM-IGNORE-BEGIN
413 class OdRxUnitTypeAttributeImpl;
414 //DOM-IGNORE-END
415 
421 {
422 public:
426  enum UnitType
427  {
428  kUnitless = 0,
429  kDistance = (0x1 << 0),
430  kAngle = (0x1 << 1),
431  kArea = (0x1 << 2),
432  kVolume = (0x1 << 3),
433  kCurrency = (0x1 << 4),
434  kPercentage = (0x1 << 5),
435  kAngleNotTransformed = (0x1 << 16),
436  };
437 
438  //DOM-IGNORE-BEGIN
440  //DOM-IGNORE-END
441 
446 
451 protected:
452  //DOM-IGNORE-BEGIN
453  OdRxUnitTypeAttribute(OdRxUnitTypeAttributeImpl*);
454  //DOM-IGNORE-END
455 };
456 
457 //DOM-IGNORE-BEGIN
458 class OdRxUseDialogForReferredCollectionAttributeImpl;
459 
465 {
466 public:
468 protected:
469  OdRxUseDialogForReferredCollectionAttribute(OdRxUseDialogForReferredCollectionAttributeImpl*);
470 };
471 
472 class OdRxUiCascadingContextMenuAttributeImpl;
477 {
478 public:
480 protected:
481  OdRxUiCascadingContextMenuAttribute(OdRxUiCascadingContextMenuAttributeImpl*);
482 };
483 //DOM-IGNORE-END
484 
485 //DOM-IGNORE-BEGIN
486 class OdRxCumulativeAttributeImpl;
487 //DOM-IGNORE-END
488 
494 {
495 public:
496  //DOM-IGNORE-BEGIN
498  //DOM-IGNORE-END
499 
504 
508  OdString type() const;
509 protected:
510  //DOM-IGNORE-BEGIN
511  OdRxCumulativeAttribute(OdRxCumulativeAttributeImpl*);
512  //DOM-IGNORE-END
513 };
514 
515 //DOM-IGNORE-BEGIN
516 class OdRxAffinityAttributeImpl;
517 //DOM-IGNORE-END
518 
523 {
524 public:
526 
528  OdString name() const;
529 protected:
530  OdRxAffinityAttribute(OdRxAffinityAttributeImpl*);
531 };
532 
533 //DOM-IGNORE-BEGIN
534 class OdRxTypePromotionAttributeImpl;
535 //DOM-IGNORE-END
540 {
541 public:
543  static OdRxAttributePtr createObject(const OdString& properties);
545 protected:
546  OdRxTypePromotionAttribute(OdRxTypePromotionAttributeImpl*);
547 };
548 
549 //DOM-IGNORE-BEGIN
550 class OdRxUnionTypeAttributeImpl;
551 //DOM-IGNORE-END
552 
554 {
555 public:
557  static OdRxAttributePtr createObject(const OdString& typenames);
559 protected:
560  OdRxUnionTypeAttribute(OdRxUnionTypeAttributeImpl*);
561 };
562 
563 class OdRxDefaultValueAttributeImpl;
564 
570 {
571 public:
572  //DOM-IGNORE-BEGIN
574  //DOM-IGNORE-END
575 
580 
584  const OdRxValue& value() const;
585 protected:
586  OdRxDefaultValueAttribute(OdRxDefaultValueAttributeImpl*);
587 };
588 
589 //DOM-IGNORE-BEGIN
590 class OdRxHierarchyLevelAttributeImpl;
591 //DOM-IGNORE-END
592 
598 {
599 public:
600  //DOM-IGNORE-BEGIN
602  //DOM-IGNORE-END
603 
608 
614 
615  //DOM-IGNORE-BEGIN
616  OdRxHierarchyLevelAttribute(OdRxHierarchyLevelAttributeImpl*);
618  //DOM-IGNORE-END
619 };
620 
621 class OdRxDisplayAsAttributeImpl;
622 
628 {
629 public:
630  //DOM-IGNORE-BEGIN
632  //DOM-IGNORE-END
633 
637  static OdRxAttributePtr createObject(const OdString& property_name);
638 
643 
649 
650  //DOM-IGNORE-BEGIN
651  OdRxDisplayAsAttribute(OdRxDisplayAsAttributeImpl* pImpl);
653  //DOM-IGNORE-END
654 };
655 
656 
657 #endif
658 
FXBIM_API OdString convert(const QString &qstr)
#define NULL
Definition: GsProperties.h:177
#define ODRX_ABSTRACT
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdSmartPtr< OdRxAttribute > OdRxAttributePtr
Definition: RxAttribute.h:62
const OdRxPropertyBase *(* FindPropertyCallback)(const OdRxObject *pObject, const OdString &pszPropName)
Definition: RxAttribute.h:302
bool(* ConvertValueCallback)(const OdRxPropertyBase *pProperty, OdRxValue &value)
Definition: RxAttribute.h:307
ODRX_DECLARE_MEMBERS(OdRxAffinityAttribute)
OdRxAffinityAttribute(OdRxAffinityAttributeImpl *)
OdString name() const
static OdRxAttributePtr createObject(const OdString &name)
static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxAlternateLocalizedNameAttribute)
OdRxAlternateLocalizedNameAttribute(OdRxAlternateLocalizedNameAttributeImpl *impl)
const OdRxAttribute * getAt(int index) const
OdRxAttribute * get(const OdRxClass *type)
OdRxAttribute * getAt(int index)
OdResult remove(const OdRxAttribute *attribute)
OdResult add(const OdRxAttribute *attribute)
const OdRxAttribute * get(const OdRxClass *type) const
ODRX_DECLARE_MEMBERS(OdRxAttribute)
virtual ~OdRxAttribute()
OdRxAttribute(OdRxAttributeImpl *)
OdRxAttributeImpl * m_pImpl
Definition: RxAttribute.h:58
OdString name() const
ODRX_DECLARE_MEMBERS(OdRxCOMAttribute)
OdRxCOMAttribute(OdRxCOMAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &name)
OdRxCumulativeAttribute(OdRxCumulativeAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &type)
ODRX_DECLARE_MEMBERS(OdRxCumulativeAttribute)
OdString type() const
static OdRxAttributePtr createObject(const OdRxValue &value)
OdRxDefaultValueAttribute(OdRxDefaultValueAttributeImpl *)
const OdRxValue & value() const
ODRX_DECLARE_MEMBERS(OdRxDefaultValueAttribute)
OdRxDescriptionAttribute(OdRxDescriptionAttributeImpl *)
unsigned int sourceHint() const
unsigned int id() const
static OdRxAttributePtr createObject(const OdString &description, unsigned int id=0, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxDescriptionAttribute)
virtual OdString getDisplayValue(OdRxValue &value)
static OdRxAttributePtr createObject(const OdString &property_name)
OdRxDisplayAsAttribute(OdRxDisplayAsAttributeImpl *pImpl)
ODRX_DECLARE_MEMBERS(OdRxDisplayAsAttribute)
ODRX_DECLARE_MEMBERS(OdRxFilePathAttribute)
OdRxFilePathAttribute(OdRxFilePathAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxFlagsAttribute)
OdRxFlagsAttribute(OdRxFlagsAttributeImpl *)
virtual OdString value(OdRxValue &value)
ODRX_DECLARE_MEMBERS(OdRxHierarchyLevelAttribute)
static OdRxAttributePtr createObject(const OdString &value)
OdRxHierarchyLevelAttribute(OdRxHierarchyLevelAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxLMVAttribute)
OdRxLMVAttribute(OdRxLMVAttributeImpl *)
unsigned int sourceHint() const
OdRxLocalizedNameAttribute(OdRxLocalizedNameAttributeImpl *)
unsigned int id() const
static OdRxAttributePtr createObject(unsigned int id, unsigned int sourceHint=0)
ODRX_DECLARE_MEMBERS(OdRxLocalizedNameAttribute)
static const OdRxPropertyBase * parseReference(const OdString &path, const OdRxObject *pObject, FindPropertyCallback find=NULL, ConvertValueCallback convert=NULL)
OdString path() const
ODRX_DECLARE_MEMBERS(OdRxRefersToAttribute)
static OdRxAttributePtr createObject(const OdString &path)
OdRxRefersToAttribute(OdRxRefersToAttributeImpl *)
virtual OdResult subLoadString(unsigned int id, unsigned int sourceHint, OdString &result)=0
static OdResult loadString(const OdRxObject *pClass, unsigned int id, unsigned int sourceHint, OdString &result)
ODRX_DECLARE_MEMBERS(OdRxResourceLoader)
OdRxTypePromotionAttribute(OdRxTypePromotionAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &properties)
OdString properties() const
ODRX_DECLARE_MEMBERS(OdRxTypePromotionAttribute)
ODRX_DECLARE_MEMBERS(OdRxUiCascadingContextMenuAttribute)
OdRxUiCascadingContextMenuAttribute(OdRxUiCascadingContextMenuAttributeImpl *)
static float getWeight(const OdRxObject *member)
static OdString getCategory(const OdRxObject *member)
ODRX_DECLARE_MEMBERS(OdRxUiPlacementAttribute)
OdRxUiPlacementAttribute(OdRxUiPlacementAttributeImpl *)
static OdRxAttributePtr createObject(const OdString &category, unsigned int weight)
OdString typenames() const
static OdRxAttributePtr createObject(const OdString &typenames)
OdRxUnionTypeAttribute(OdRxUnionTypeAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxUnionTypeAttribute)
OdRxUnitTypeAttribute(OdRxUnitTypeAttributeImpl *)
ODRX_DECLARE_MEMBERS(OdRxUnitTypeAttribute)
static OdRxAttributePtr createObject(UnitType unitType)
UnitType unitType() const
ODRX_DECLARE_MEMBERS(OdRxUseDialogForReferredCollectionAttribute)
OdRxUseDialogForReferredCollectionAttribute(OdRxUseDialogForReferredCollectionAttributeImpl *)
GLuint index
Definition: gles2_ext.h:265
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLsizei const GLfloat * value
Definition: gles2_ext.h:302