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.

bibletimeinterface.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 BIBLETIME_INTERFACE_H
  10. #define BIBLETIME_INTERFACE_H
  11. //TQt includes
  12. #include <tqstring.h>
  13. #include <tqstringlist.h>
  14. //KDE includes
  15. #include <dcopobject.h>
  16. #include <tdemainwindowiface.h>
  17. /** DCOP interface definition for BibleTime.
  18. * This is the interface definition for BibleTime's DCOP client interface. The main window class "BibleTime"
  19. * inherits from this class and re-implements these pure virtual functions.
  20. * It uses virtual inheritance so that a widget which inherits twice from DCOPObject does not get mixed up.
  21. * This file is turned into bibletimeinterface_skel.cpp by the KDE automake system.
  22. *
  23. * @author Joachim Ansorg
  24. */
  25. class BibleTimeInterface : virtual public DCOPObject {
  26. //This K_DCOP line is required so that the k_dcop: and void are processed.
  27. K_DCOP
  28. public:
  29. BibleTimeInterface(TQCString id) : DCOPObject(id) {}
  30. k_dcop:
  31. /** Sync all open Bible windows to the key.
  32. * @param key The key which is set to all Bible windows.
  33. */
  34. virtual void syncAllBibles(const TQString& key) = 0;
  35. /** Sync all open commentary windows to the key.
  36. * @param key The key which is set to all Commentary windows.
  37. */
  38. virtual void syncAllCommentaries(const TQString& key) = 0;
  39. /** Sync all open lexicon windows to the key.
  40. * @param key The key which is set to all Lexicon windows.
  41. */
  42. virtual void syncAllLexicons(const TQString& key) = 0;
  43. /** Sync all open verse based (i.e. Bibles and commentaries) windows to the key.
  44. * @param key The key which is set to all Bible and Commentary windows.
  45. */
  46. virtual void syncAllVerseBasedModules(const TQString& key) = 0;
  47. /** Reload all modules
  48. */
  49. virtual void reloadModules() = 0;
  50. /** Open a new read window for the module moduleName using the given key
  51. * @param moduleName The name of the module which is opened in a new module window.
  52. * @param key The key to set to the newly opened window.
  53. */
  54. virtual void openWindow(const TQString& moduleName, const TQString& key) = 0;
  55. /** Open a new read window for the default Bible module using the given key
  56. * @param key The key to set to the newly opened window.
  57. */
  58. virtual void openDefaultBible(const TQString& key) = 0;
  59. /** Close all open windows.
  60. */
  61. virtual void closeAllModuleWindows() = 0;
  62. /** Returns the reference used in the current window.
  63. * The format of the returned reference is
  64. * [Module] [Type] OSIS_Reference,
  65. * wtih type one of BIBLE/COMMENTARY/BOOK/LEXICON/UNSUPPORTED
  66. * If the type is BIBLE or COMMENTARY the reference is an OSIS ref
  67. * in the other cases it's the key name, for books /Chapter/Subsection
  68. * for Lexicons just the plain key, e.g. "ADAM".
  69. * e.g.
  70. * [KJV] [BIBLE] Gen.1.1
  71. * [MHC] [COMMENTARY] Gen.1.1
  72. * [ISBE] [LEXICON] REDEMPTION
  73. * @return The reference displayed in the currently active module window. Empty if none is active.
  74. */
  75. virtual TQString getCurrentReference() = 0;
  76. /** Seach the searchText in the specified module.
  77. * @param moduleName The module to search in
  78. * @param searchText Search for this in the modules
  79. * @return The search result. It's in the format [modulename] osis_ref_of_the_found_key. For example "[KJV] Gen.1.1".
  80. */
  81. virtual TQStringList searchInModule(const TQString& moduleName, const TQString& searchText) = 0;
  82. /** Search in all open modules and return the search result.
  83. * The result is in the same format as searchInModule
  84. * @param searchText Search for this in the modules
  85. * @return The search result for a searchin all opened module windows
  86. * @see searchInModule For the search result format.
  87. */
  88. virtual TQStringList searchInOpenModules(const TQString& searchText) = 0;
  89. /** Search in the default Bible module and return the search result.
  90. * The result is in the same format as searchInModule
  91. * @param searchText Search for this in the modules
  92. * @return The search result for a search in the default Bible
  93. * @see searchInModule
  94. */
  95. virtual TQStringList searchInDefaultBible(const TQString& searchText) = 0;
  96. /** Return a list of modules of the given type.
  97. * @param type One of BIBLES, COMMENTARIES, LEXICONS, BOOKS
  98. * @return The list of modules of the given type, may be empty
  99. */
  100. virtual TQStringList getModulesOfType(const TQString& type) = 0;
  101. };
  102. #endif