Free Electron
SurfaceAccessibleRecord.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __surface_SurfaceAccessibleRecord_h__
8 #define __surface_SurfaceAccessibleRecord_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Record Surface Binding
17 
18  @ingroup surface
19 *//***************************************************************************/
20 class FE_DL_EXPORT SurfaceAccessibleRecord:
21  public ObjectSafeShared<SurfaceAccessibleRecord>,
22  virtual public SurfaceAccessibleBase,
23  public CastableAs<SurfaceAccessibleRecord>
24 {
25  public:
27 virtual ~SurfaceAccessibleRecord(void);
28 
29  //* As Protectable
30 virtual Protectable* clone(Protectable* pInstance=NULL);
31 
32  //* as SurfaceAccessibleI
33 virtual void bind(Instance a_instance)
34  {
35  Record record=a_instance.cast<Record>();
36  if(record.isValid())
37  {
38  sp<Scope> spScope=
39  record.layout()->scope();
40  bind(spScope);
41  }
42  bind(record);
43  }
44 virtual BWORD isBound(void)
45  { return m_weakRecord.isValid(); }
46 
48 
49 virtual I32 count(String a_nodeName,
50  SurfaceAccessibleI::Element
51  a_element) const;
52 
53 virtual void bind(sp<Scope> a_spScope)
54  { m_spScope=a_spScope;
55  reset(); }
56 
58 
59 virtual BWORD load(String a_filename,
60  sp<Catalog> a_spSettings);
61 
63 
64 virtual BWORD save(String a_filename,
65  sp<Catalog> a_spSettings);
66 
68  a_spThreadingState)
69  { m_spThreadingState=a_spThreadingState; }
70 
71 virtual void groupNames(Array<String>& a_rNameArray,
72  SurfaceAccessibleI::Element
73  a_element) const;
74 
75  using SurfaceAccessibleBase::attributeSpecs;
76 
77 virtual void attributeSpecs(
79  a_rSpecs,
80  String a_node,
81  SurfaceAccessibleI::Element
82  a_element) const;
83 
84 virtual void require(SurfaceAccessibleI::Element a_element,
85  String a_name,String a_typeName);
86 
88 
89 virtual sp<SurfaceAccessorI> accessor(String a_node,Element a_element,
90  String a_name,
91  Creation a_create,Writable a_writable);
92 
93 virtual sp<SurfaceAccessorI> accessor(String a_node,Element a_element,
94  Attribute a_attribute,
95  Creation a_create,
96  Writable a_writable);
97 
99 
100 virtual sp<SurfaceI> surface(String a_group,
101  SurfaceI::Restrictions a_restrictions);
102 
103  using SurfaceAccessibleBase::subSurface;
104 
105 virtual sp<SurfaceI> subSurface(U32 a_subIndex,String a_group,
106  SurfaceI::Restrictions a_restrictions);
107 
108  using SurfaceAccessibleBase::copy;
109 
110 virtual void copy(sp<SurfaceAccessibleI>
111  a_spSurfaceAccessible);
112 virtual void copy(sp<SurfaceAccessibleI>
113  a_spSurfaceAccessible,
114  sp<FilterI> a_spFilter);
115 
116 virtual sp<MultiGroup> generateGroup(
117  SurfaceAccessibleI::Element a_element,
118  String a_groupString);
119 
120  //* as SurfaceAccessibleRecord
121  void bind(Record& a_rRecord);
122  Record record(void)
123  { return m_weakRecord; }
124 
125  void bindLike(sp<SurfaceAccessibleRecord>& a_rspOther)
126  {
127  if(a_rspOther.isValid())
128  {
129  m_spThreadingState=
130  a_rspOther->m_spThreadingState;
131  m_paging=a_rspOther->m_paging;
132  m_spScope=a_rspOther->m_spScope;
133  m_spRecordGroup=
134  a_rspOther->m_spRecordGroup;
135  m_weakRecord=a_rspOther->m_weakRecord;
136  }
137  }
138 virtual sp<Component> payload(void)
139  { return m_spForeignAccessible; }
140 
141  void setDiscontiguous(
142  SurfaceAccessibleI::Element a_element);
143 
144  protected:
145 virtual void reset(void);
146 
147 virtual void ensureBinding(void);
148 
149  void tuneRecordGroup(void);
150 
151  sp<Scope> m_spScope;
152  sp<RecordGroup> m_spRecordGroup;
153  WeakRecord m_weakRecord;
154  sp<SurfaceAccessibleI> m_spForeignAccessible;
155 
156  Accessor<String> m_groupNameAccessor;
157  Accessor< std::set<I32> > m_groupSetAccessor;
158 
159  BWORD m_contiguous[e_elementEnums];
160 };
161 
162 } /* namespace ext */
163 } /* namespace fe */
164 
165 #endif /* __surface_SurfaceAccessibleRecord_h__ */
Common Functionality for Accessible Surface.
Definition: SurfaceAccessibleBase.h:20
virtual sp< SurfaceI > surface(void)
Return current underlying SurfaceI.
Definition: SurfaceAccessibleBase.h:143
bool isValid(void) const
Return true if the Record points to a valid state block.
Definition: RecordSB.h:184
Base class providing protection counting for cp<>
Definition: Protectable.h:28
Smart pointer used with types represented by BaseType.
Definition: Instance.h:28
kernel
Definition: namespace.dox:3
sp< Layout > layout(void) const
Return the Layout.
Definition: RecordSB.h:189
virtual void bind(Instance a_instance)
associate with model data
Definition: SurfaceAccessibleRecord.h:33
Automatically reference-counted string container.
Definition: String.h:128
virtual void bind(sp< SurfaceAccessibleI::ThreadingState > a_spThreadingState)
Inform threading intentions.
Definition: SurfaceAccessibleRecord.h:67
Wrapper for std::vector.
Definition: Array.h:21
Record Surface Binding.
Definition: SurfaceAccessibleRecord.h:20
Reference to an instance of a Layout.
Definition: RecordSB.h:35
int count(void) const
Return the count of references.
Definition: Counted.h:156
virtual void bind(sp< Scope > a_spScope)
choose a data scope
Definition: SurfaceAccessibleRecord.h:53
virtual BWORD save(String a_filename)
save model data to file
Definition: SurfaceAccessibleBase.h:48
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192
Object level locking for thread safety.
Definition: SafeShared.h:220
Non-persistent reference to an instance of a Layout.
Definition: WeakRecordSB.h:17
virtual BWORD load(String a_filename)
load model data from file
Definition: SurfaceAccessibleBase.h:45
virtual BWORD isBound(void)
Return true if surface is available.
Definition: SurfaceAccessibleRecord.h:44
virtual sp< SurfaceAccessorI > accessor(String a_node, Element a_element, String a_name, Creation a_create, Writable a_writable)
Return access to an attribute.
Definition: SurfaceAccessibleBase.h:87