Finale PDK Framework  0.54
ff_globals.h
1 /*
2  * File: ff_globals.h
3  * Author: Jari Williamsson
4  *
5  * Created on den 28 november 2010, 16:47
6  */
7 
8 #ifndef FF_GLOBALS_H
9 #define FF_GLOBALS_H
10 
11 #include "ff_basecollection.h"
12 
13 
18 class __FCGlobals : public __FCBaseData
19 {
20 public:
21  virtual const char* ClassName() { return "__FCGlobals"; }
22 
26 
28  bool Load(twobyte globalnumber);
29 
30  virtual bool LoadFirst() { return Load(0); }
31 
32  virtual bool LoadNext() { return Load(_dataid.global.globalsNumber + 1); }
33 };
34 
42 class FCClefDef : public __FCGlobals
43 {
44  EDTClefDef _clefdefold;
45 #if FXT_VERSION >= FINALEVERSION_2012
46  EDTClefDef2012 _clefdef2012;
47 #endif
48 protected:
49 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
50  bool _Use2012Version() const;
51 
52  virtual EXTAG Tag() { return gb_ClefDef; }
53  virtual int DataSizeLoad();
54  virtual void* Allocate();
55  virtual EVERSION EnigmaVersion() { return _Use2012Version() ? FINALEVERSION_2012 : FINALEVERSION_2010; }
56 
61  virtual void CloneMemoryFrom(__FCBaseData* pSource)
62  {
63  memcpy(Allocate(), ((FCClefDef*)pSource)->_GetClefDef(), DataSizeLoad());
64  _datablock = Allocate();
66  }
67 
68  virtual __FCBaseData* CreateObject() { return new FCClefDef(); }
69 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
70 public:
71 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
72  virtual const char* ClassName() { return "FCClefDef"; }
73  virtual const PDKFRAMEWORK_CLASSID GetClassID() { return FCID_CLEFDEF; }
74 
81  void* _GetClefDef() { return Allocate(); }
82 #endif
83 
89  {
90  memset(&_clefdefold, 0, sizeof(_clefdefold));
91 #if FXT_VERSION >= FINALEVERSION_2012
92  memset(&_clefdef2012, 0, sizeof(_clefdef2012));
93 #endif
94  }
95 
103  twobyte GetVerticalAdjust() const;
104 
110  Efix16 GetBaselineOffset() const;
111 
116  eUniChar32 GetSymbol() const;
117 
125  twobyte GetClefPosition() const;
126 
131  bool GetUseCustomFont() const;
132 
141  bool GetFontInfo(FCFontInfo* pFontInfo);
142 
147  CMPER GetClefIndex() const { return _dataid.global.globalsNumber; }
148 
156  void SetFontInfo(FCFontInfo* pFontInfo);
157 
162  void SetShapeID(twobyte shapeID);
163 
168  void SetUseCustomFont(bool state);
169 
177  void SetVerticalAdjust(twobyte value);
178 
183  void SetBaselineOffset(Efix16 value);
184 
189  void SetSymbol(eUniChar32 symbolchar);
190 
198  void SetClefPosition(twobyte clefpos);
199 
204  void SetIsShape(bool state);
205 
210  bool GetIsShape() const;
211 
216  twobyte GetShapeID() const;
217 };
218 
219 
226 {
227 protected:
228 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
229  virtual __FCBaseData* CreateElement() { return new FCClefDef(); }
230 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
231 public:
237 
238  virtual const char* ClassName() { return "FCClefDefs"; }
239 
245 };
246 
247 
248 
249 #endif /* FF_GLOBALS_H */
250 
eUniChar32 GetSymbol() const
Returns the symbol character for the clef definition.
Definition: finaleframework.cpp:20025
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
Class for document-independent font information.
Definition: ff_base.h:1024
void * _datablock
Pointer to the object's data block, the meaning is implementation-specific for each derived subclass...
Definition: ff_base.h:640
twobyte GetClefPosition() const
Returns the vertical Clef Position.
Definition: finaleframework.cpp:20036
virtual bool LoadFirst()
Loads the very first element in the database, if any.
Definition: ff_globals.h:30
void SetUseCustomFont(bool state)
Sets the custom font state.
Definition: finaleframework.cpp:20112
PDKFRAMEWORK_CLASSID
Constants for the GetClassID method.
Definition: ff_base.h:60
void SetSymbol(eUniChar32 symbolchar)
Sets the symbol character for the clef definition.
Definition: finaleframework.cpp:20154
Base class for all data that use the global part of the EDataID.
Definition: ff_globals.h:18
virtual void CloneMemoryFrom(__FCBaseData *pSource)
Definition: finaleframework.cpp:753
void SetBaselineOffset(Efix16 value)
Sets the baseline offset, as an EFIX value.
Definition: finaleframework.cpp:20140
twobyte GetVerticalAdjust() const
Returns the vertical adjustment (related to middle C) of the clef.
Definition: finaleframework.cpp:20003
virtual void * Allocate()=0
virtual bool LoadNext()
Loads the next element from the database, if any.
Definition: ff_globals.h:32
Collection class for FCClefDef class objects.
Definition: ff_globals.h:225
void SetShapeID(twobyte shapeID)
Sets the shape ID for the clef.
Definition: finaleframework.cpp:20098
void SetVerticalAdjust(twobyte value)
Sets the vertical adjustment (related to middle C) of the clef.
Definition: finaleframework.cpp:20126
CMPER GetClefIndex() const
Returns the 0-based clef index/ID.
Definition: ff_globals.h:147
int _loadedsize
Loaded size of the data block for a loaded object, in bytes. Since the datablock is implementation-sp...
Definition: ff_base.h:653
void SetFontInfo(FCFontInfo *pFontInfo)
Sets the font for the clef definition.
Definition: finaleframework.cpp:20080
Base class for "Global" data.
Definition: ff_basecollection.h:700
Base class for all data-related classes (that handles Finale data).
Definition: ff_base.h:628
bool GetIsShape() const
Returns true if a shape is used as clef.
Definition: finaleframework.cpp:20196
virtual __FCBaseData * CreateObject()=0
Creates a new instance of the object.
__FCGlobals()
The constructor.
Definition: ff_globals.h:25
FCClefDefs()
The constructor.
Definition: ff_globals.h:236
virtual const PDKFRAMEWORK_CLASSID GetClassID()=0
Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has...
EDataID _dataid
The EdataID for the last loaded/saved object.
Definition: ff_base.h:657
twobyte GetShapeID() const
Returns the shape ID (if any) for the clef. 0 if there is no shape clef.
Definition: finaleframework.cpp:20207
Efix16 GetBaselineOffset() const
Returns the baseline offset, as an EFIX value.
Definition: finaleframework.cpp:20014
virtual EXTAG Tag()=0
The Enigma tag for the derived class.
FCClefDef * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_globals.h:244
FCClefDef()
The constructor.
Definition: ff_globals.h:88
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_globals.h:21
Data class for the global clef definitions.
Definition: ff_globals.h:42
void SetClefPosition(twobyte clefpos)
Sets the vertical Clef Position.
Definition: finaleframework.cpp:20168
virtual int DataSizeLoad()=0
Returns the data size for the data structure that should be loaded.
void SetIsShape(bool state)
Sets if a shape is used as clef or not.
Definition: finaleframework.cpp:20182
bool GetFontInfo(FCFontInfo *pFontInfo)
Gets the font for the clef.
Definition: finaleframework.cpp:20058
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_globals.h:238
virtual EVERSION EnigmaVersion()
The Enigma version for save/load/create/delete operations.
Definition: ff_base.h:757
bool Load(twobyte globalnumber)
Loads a single member from the globals data storage.
Definition: finaleframework.cpp:19960
bool GetUseCustomFont() const
Returns true if a custom font is used.
Definition: finaleframework.cpp:20047