CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FdField.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
25#ifndef _FdField_h_Included_
26#define _FdField_h_Included_
27
28#include "RxObject.h"
29#include "RxDictionary.h"
30#include "DbField.h"
31#include "StringArray.h"
32
33class OdDbField;
34class OdDbEvalVariant;
35class OdFieldValue;
36class OdFdFieldEngineImpl;
37class OdFdFieldResult;
38class OdDbDatabase;
39
40#include "TD_PackPush.h"
41
55{
56public:
57 //DOM-IGNORE-BEGIN
59 //DOM-IGNORE-END
60
68 virtual const OdString evaluatorId() const = 0;
69
79 virtual const OdString evaluatorId(OdDbField* pField) const = 0;
80
91 virtual OdResult initialize(OdDbField* pField) const = 0;
92
93// The field framework calls this method to compile a field when the field code
94// is changed.
95
108 virtual OdResult compile(OdDbField* pField,
109 OdDbDatabase* pDb,
110 OdFdFieldResult* pResult) const = 0;
111
112// The field framework calls this method to evaluate a field whenever the field
113// needs to be evaluated.
114
147 virtual OdResult evaluate(OdDbField* pField,
148 int nContext,
149 OdDbDatabase* pDb,
150 OdFdFieldResult* pResult) const = 0;
151
152// The field framework calls this method when a field is queried to get the
153// evaluated field value as a string.
154
165 virtual OdResult format(OdDbField* pField, OdString& pszValue) const = 0;
166};
167
173
188{
189public:
190 //DOM-IGNORE-BEGIN
192 //DOM-IGNORE-END
193
200 const OdString& pszEvalId) = 0;
201
208 OdDbField* pField,
209 OdString& pszEvalId) = 0;
210};
211
219{
220public:
221 //DOM-IGNORE-BEGIN
223 //DOM-IGNORE-END
224
232 int nContext,
233 OdDbDatabase* pDb);
234
241 virtual void endEvaluateFields(
242 int nContext,
243 OdDbDatabase* pDb);
244};
245
251
263{
264public:
265 //DOM-IGNORE-BEGIN
267 //DOM-IGNORE-END
268
274
284
293
298 virtual int evaluatorLoaderCount() const = 0;
299
309 virtual OdFdFieldEvaluatorLoader * getEvaluatorLoader(int inputIndex) = 0;
310
318 const OdString& pszEvalId) = 0;
319
329 OdDbField* pField,
330 OdString& pszEvalId) = 0;
331
336 virtual void addFieldReactor(OdFdFieldReactor* pReactor) = 0;
337
342 virtual void removeFieldReactor(OdFdFieldReactor* pReactor) = 0;
343};
344
350#define ODFD_FIELD_ENGINE OD_T("FieldEngine")
351
358
366
373 const OdString& sValue = L"%ls"); // value to keep result of previous evaluation
374
385{
386public:
387 //DOM-IGNORE-BEGIN
390 //DOM-IGNORE-END
391
398 virtual void setFieldValue(const OdFieldValue* pValue) = 0;
399
406 virtual void setEvaluationStatus(OdDbField::EvalStatus errorStatus, int errorCode = 0, const OdString& errorMessage = OdString()) = 0;
407};
408
417{
418public:
419 //DOM-IGNORE-BEGIN
421 //DOM-IGNORE-END
422
435 virtual OdResult getSheetSetProperty(OdString& propValue, OdDbField* pField, OdDbDatabase* pDb) = 0;
436
448 virtual bool parseObjProp(const OdString& prop, OdDbDatabase* pDb, OdDbObjectId& objId, OdString& propName) = 0;
449
460 virtual bool getObjPropValue(const OdString& propName, OdInt32 paramId, const OdDbObjectId& objId, OdFdFieldResult& result) = 0;
461
470
482
489 virtual void getLispVariable(const OdString& lispVar, OdFieldValue& fValue) = 0;
490
499 virtual OdDbObjectId getOwnerTable(const OdDbField* field) = 0;
500};
501
507
534 OdDbDatabase* pDb,
535 int nContext,
536 const OdDbObjectIdArray* objIds = 0,
537 const OdDbObjectIdArray* pFieldsToEvaluate = 0,
538 const OdString& pszEvaluatorId = OdString(),
540 int* pNumFound = 0,
541 int* pNumEvaluated = 0);
542
551 const OdString& sString,
552 OdStringArray& aSubStrings);
553
564 const OdString& sString,
565 OdString& sName,
566 OdString& sFormat);
567
568
569#include "TD_PackPop.h"
570
571#endif //_FdField_h_Included_
#define DBENT_EXPORT
Definition: DbExport.h:67
DBENT_EXPORT OdResult oddbEvaluateFields(OdDbDatabase *pDb, int nContext, const OdDbObjectIdArray *objIds=0, const OdDbObjectIdArray *pFieldsToEvaluate=0, const OdString &pszEvaluatorId=OdString(), OdFd::EvalFields nEvalFlag=OdFd::kEvalRecursive, int *pNumFound=0, int *pNumEvaluated=0)
DBENT_EXPORT void odfdGetSubStrings(const OdString &sString, OdStringArray &aSubStrings)
OdSmartPtr< OdFdFieldEvaluator > OdFdFieldEvaluatorPtr
Definition: FdField.h:172
DBENT_EXPORT OdFdFieldEnginePtr oddbGetFieldEngine()
DBENT_EXPORT bool odfdGetAcVarData(const OdString &sString, OdString &sName, OdString &sFormat)
OdSmartPtr< OdFdFieldEnginePE > OdFdFieldEnginePEPtr
Definition: FdField.h:506
OdSmartPtr< OdFdFieldEngine > OdFdFieldEnginePtr
Definition: FdField.h:349
DBENT_EXPORT OdString oddbGetFieldEngineValueByError(const OdString &sPrevValue)
OdArray< OdFdFieldReactor * > FieldReactors
Definition: FdField.h:250
DBENT_EXPORT OdString oddbSetFieldEngineValueFormatByError(const OdString &sValue=L"%ls")
int OdInt32
OdResult
Definition: OdResult.h:29
virtual int evaluatorLoaderCount() const =0
virtual OdFdFieldEvaluator * findEvaluator(OdDbField *pField, OdString &pszEvalId)=0
virtual void addFieldReactor(OdFdFieldReactor *pReactor)=0
virtual ~OdFdFieldEngine()
Definition: FdField.h:273
virtual void removeFieldReactor(OdFdFieldReactor *pReactor)=0
virtual void registerEvaluatorLoader(OdFdFieldEvaluatorLoader *pLoader)=0
virtual OdFdFieldEvaluator * getEvaluator(const OdString &pszEvalId)=0
virtual OdFdFieldEvaluatorLoader * getEvaluatorLoader(int inputIndex)=0
virtual void unregisterEvaluatorLoader(OdFdFieldEvaluatorLoader *pLoader)=0
ODRX_DECLARE_MEMBERS(OdFdFieldEngine)
virtual OdResult getSheetSetProperty(OdString &propValue, OdDbField *pField, OdDbDatabase *pDb)=0
virtual OdString getFileName(OdDbDatabase *pDb)=0
virtual OdDbObjectId getOwnerTable(const OdDbField *field)=0
ODRX_DECLARE_MEMBERS(OdFdFieldEnginePE)
virtual OdDbDatabase * getCurrentDb()=0
virtual bool parseObjProp(const OdString &prop, OdDbDatabase *pDb, OdDbObjectId &objId, OdString &propName)=0
virtual void getLispVariable(const OdString &lispVar, OdFieldValue &fValue)=0
virtual bool getObjPropValue(const OdString &propName, OdInt32 paramId, const OdDbObjectId &objId, OdFdFieldResult &result)=0
virtual OdResult evaluate(OdDbField *pField, int nContext, OdDbDatabase *pDb, OdFdFieldResult *pResult) const =0
virtual OdResult initialize(OdDbField *pField) const =0
virtual const OdString evaluatorId(OdDbField *pField) const =0
virtual OdResult compile(OdDbField *pField, OdDbDatabase *pDb, OdFdFieldResult *pResult) const =0
virtual OdResult format(OdDbField *pField, OdString &pszValue) const =0
virtual const OdString evaluatorId() const =0
ODRX_DECLARE_MEMBERS(OdFdFieldEvaluator)
ODRX_DECLARE_MEMBERS(OdFdFieldEvaluatorLoader)
virtual OdFdFieldEvaluator * getEvaluator(const OdString &pszEvalId)=0
virtual OdFdFieldEvaluator * findEvaluator(OdDbField *pField, OdString &pszEvalId)=0
virtual void beginEvaluateFields(int nContext, OdDbDatabase *pDb)
ODRX_DECLARE_MEMBERS(OdFdFieldReactor)
virtual void endEvaluateFields(int nContext, OdDbDatabase *pDb)
virtual void setFieldValue(const OdFieldValue *pValue)=0
virtual void setEvaluationStatus(OdDbField::EvalStatus errorStatus, int errorCode=0, const OdString &errorMessage=OdString())=0
ODRX_DECLARE_MEMBERS(OdFdFieldResult)
EvalFields
Definition: DbField.h:50
@ kEvalRecursive
Definition: DbField.h:51