Bibletime – a bible study tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cbtconfig.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /*********
  2. *
  3. * This file is part of BibleTime's source code, http://www.bibletime.info/.
  4. *
  5. * Copyright 1999-2006 by the BibleTime developers.
  6. * The BibleTime source code is licensed under the GNU General Public License version 2.0.
  7. *
  8. **********/
  9. #ifndef CBTCONFIG_H
  10. #define CBTCONFIG_H
  11. #include "backend/cswordbackend.h"
  12. #include "backend/clanguagemgr.h"
  13. //TQt includes
  14. #include <tqstring.h>
  15. #include <tqfont.h>
  16. #include <tqvaluelist.h>
  17. #include <tqmap.h>
  18. //Forward declarations
  19. class TDEAccel;
  20. class TDEActionCollection;
  21. class TDEConfig;
  22. /**
  23. * This class is the interface to the config object of BibleTime
  24. * @author The BibleTime team
  25. */
  26. class CBTConfig {
  27. public:
  28. typedef TQMap<TQString, TQString> StringMap;
  29. enum strings {
  30. bibletimeVersion,
  31. language,
  32. displayStyle,
  33. bookshelfCurrentItem
  34. };
  35. enum modules {
  36. standardBible = 0, //just to make sure, default is IMHO 0, so that's redundant here
  37. standardCommentary,
  38. standardLexicon,
  39. standardDailyDevotional,
  40. standardHebrewStrongsLexicon,
  41. standardGreekStrongsLexicon,
  42. standardHebrewMorphLexicon,
  43. standardGreekMorphLexicon,
  44. lastModuleType = standardGreekMorphLexicon
  45. };
  46. enum bools {
  47. firstSearchDialog,
  48. readOldBookmarks,
  49. toolbar,
  50. mainIndex,
  51. infoDisplay,
  52. autoTileVertical,
  53. autoTileHorizontal,
  54. autoCascade,
  55. lineBreaks,
  56. verseNumbers,
  57. tips,
  58. logo,
  59. autoDeleteOrphanedIndices,
  60. crashedLastTime,
  61. crashedTwoTimes
  62. };
  63. enum ints {
  64. footnotes,
  65. strongNumbers,
  66. headings,
  67. morphTags,
  68. lemmas,
  69. hebrewPoints,
  70. hebrewCantillation,
  71. greekAccents,
  72. textualVariants,
  73. scriptureReferences,
  74. morphSegmentation,
  75. bookshelfContentsX,
  76. bookshelfContentsY,
  77. magDelay /* The delay until a mouse move makes the content appear in the mag */
  78. };
  79. enum intLists {
  80. leftPaneSplitterSizes,
  81. mainSplitterSizes
  82. };
  83. enum stringLists {
  84. searchCompletionTexts,
  85. searchTexts,
  86. bookshelfOpenGroups
  87. };
  88. enum keys {
  89. allWindows,
  90. readWindow,
  91. writeWindow,
  92. bookWindow,
  93. bibleWindow,
  94. commentaryWindow,
  95. lexiconWindow,
  96. application
  97. };
  98. enum stringMaps {
  99. searchScopes
  100. };
  101. typedef std::pair<bool, TQFont> FontSettingsPair;
  102. typedef TQMap<const CLanguageMgr::Language*, CBTConfig::FontSettingsPair> FontCache;
  103. static const TQString get
  104. ( const CBTConfig::strings );
  105. static CSwordModuleInfo* const get
  106. ( const CBTConfig::modules );
  107. static const bool get
  108. ( const CBTConfig::bools );
  109. static const int get
  110. ( const CBTConfig::ints );
  111. static const TQValueList<int> get
  112. ( const CBTConfig::intLists );
  113. static const TQStringList get
  114. ( const CBTConfig::stringLists );
  115. static const CBTConfig::StringMap get
  116. ( const CBTConfig::stringMaps );
  117. static const FontSettingsPair get
  118. ( const CLanguageMgr::Language* const );
  119. static const TQString getDefault( const CBTConfig::strings );
  120. static const TQString getDefault( const CBTConfig::modules );
  121. static const bool getDefault( const CBTConfig::bools );
  122. static const int getDefault( const CBTConfig::ints );
  123. static const TQValueList<int> getDefault( const CBTConfig::intLists );
  124. static const TQStringList getDefault( const CBTConfig::stringLists );
  125. static const CBTConfig::StringMap getDefault( const CBTConfig::stringMaps );
  126. static const TQFont& getDefault( const CLanguageMgr::Language* const );
  127. static void set
  128. ( const CBTConfig::strings, const TQString value );
  129. static void set
  130. ( const CBTConfig::modules, CSwordModuleInfo* const module );
  131. static void set
  132. ( const CBTConfig::modules, const TQString& moduleName );
  133. static void set
  134. ( const CBTConfig::bools, const bool value );
  135. static void set
  136. ( const CBTConfig::ints, const int value );
  137. static void set
  138. ( const CBTConfig::intLists, const TQValueList<int> value );
  139. static void set
  140. ( const CBTConfig::stringLists, const TQStringList value);
  141. static void set
  142. ( const CBTConfig::stringMaps, const CBTConfig::StringMap value);
  143. static void set
  144. ( const CLanguageMgr::Language* const language, const FontSettingsPair& fontSettings );
  145. static const CSwordBackend::FilterOptions getFilterOptionDefaults();
  146. static const CSwordBackend::DisplayOptions getDisplayOptionDefaults();
  147. static void setupAccelSettings(const CBTConfig::keys type, TDEActionCollection* const actionCollection);
  148. static void saveAccelSettings(const CBTConfig::keys type, TDEActionCollection* const actionCollection);
  149. static const TQString getModuleEncryptionKey( const TQString& name );
  150. static void setModuleEncryptionKey( const TQString& name, const TQString& key );
  151. /** The config object.
  152. * @return A config object which is used currently, may be the global config or the session config
  153. */
  154. static TDEConfig* const getConfig();
  155. private:
  156. static const TQString getKey( const CBTConfig::strings );
  157. static const TQString getKey( const CBTConfig::modules );
  158. static const TQString getKey( const CBTConfig::bools );
  159. static const TQString getKey( const CBTConfig::ints );
  160. static const TQString getKey( const CBTConfig::intLists );
  161. static const TQString getKey( const CBTConfig::stringLists );
  162. static const TQString getKey( const CBTConfig::stringMaps );
  163. static const TQString getKey( const CLanguageMgr::Language* const );
  164. //static caches
  165. static TQFont* m_defaultFont;
  166. static FontCache* fontConfigMap;
  167. };
  168. #endif