[bt-devel] setText or setContent in CModuleManager

Torsten Uhlmann bt-devel@crosswire.org
23 Jan 2000 14:36:02 +0100


>>>>> "Joachim" == Joachim Ansorg <Jockel123@gmx.de> writes:

    > Hi!  I've changed two words: CModuleManager shuld be
    > CModulePresenter.  But you answered my question ;-)

    > Next question: I want to use CBackend in CBibleTimeView. Is that
    > right?

Yes. You need CBackEnd to initialize all parts of the backend (at this
time only SWORD). I also decided to copy the CModuleInfo API into
CBackEnd for convinience. There is a slot in CBackEnd where you can set
the active module. The API functions in CBackEnd will work on that
active module, but you can additionally use directly CModuleInfo.
In CBackEnd it is just a call to activeModule->sameFunction(...)

    > Which class should I use CBackend, CBackendManager or
    > CSWORDBackendManager ?

You use CBackEnd and CModuleInfo. The BackEndManagers take care of which
derived class of CModuleInfo (at this time only CSWORDModuleInfo) will
be instantiated. You do not care at this point what module you speak
to. You do not need to talk to any of the Managers directly.

You also need CData and CKey (see my mail yesterday).
If I find time tomorrow I will write up a description on how to use the
classes.

Searching will be done via CSearch where there will probably be a
derived class for each module type, CSearchResult which holds a list of
CSearchResultItem

But I haven't addressed searching yet, neither personal comments. That
comes later when the API is somehow clear.

Hope this helps...

    > Thanks!

    > I'll never change your BackEnd since I'm not so experienced in
    > using the SWORD.API. One reason more why we need you ;-)

    > --Joachim

    >> >>>>> "Joachim" == Joachim Ansorg <Jockel123@gmx.de> writes:
    >> 
    >> > Hi!  I wan't to implement the function in CModuleManager to set
    >> > the text or the content of a presenter.
    >> 
    >> CModuleManager is just an abstract class. You can't work with
    >> it. It implements however the interface all derived classes
    >> use. So for SWORD I created a CSWORDModuleManager. A backend can
    >> now speak to all Managers on a common basis, the API of
    >> CModuleManager.
    >> 
    >> But the ModuleManager is not the place to get or set text. You do
    >> this via CModuleInfo where there is a CSWORDModuleInfo. Look at
    >> this API and if it is not sufficient tell me what to add. Please
    >> don't add anything to this classes at this time, I'm
    >> experimenting very much and trying to figure out how to do it
    >> best. So I change the API from time to time- you would waste
    >> efforts. I think I will post next week a class hierarchy where
    >> you can see who is responsible for what.
    >> 
    >> For now, you classes should know:
    >> 
    >> CBackEnd is the class that will manage all modules for you and
    >> will give you a ListCModuleInfo CModuleInfo if you need to get
    >> text from a specific module (maybe the one selected in the tree)
    >> CData the result will be given in a CData object. Don't create it
    >> or delete it, it is created and deleted by the one who gives it,
    >> except you need a copy, then you can deep copy the object.  CKey
    >> this will hold key information (key, moduleName, moduleType), is
    >> part of CData and can be ordered on its own.
    >> 
    >> I hope this helps for the first time. I'm not yet done with all
    >> my thoughts, so the API is subject to change.
    >> 
    >> I didn't address searching at this point. It will come when these
    >> classes are usable.
    >> 
    >> But anyway Joachim, it is very good for me that you already
    >> create a connection between front and backend, how could I else
    >> test what I implement. So it would be good if we had soon some
    >> way to test the ModuleInfo API.
    >> 
    >> Thanks for your efforts!
    >> 
    >> > How could I make the function universal (we need later
    >> preenters > with other content than text or HTML). Should a
    >> presenter now get > the SWORD module it works with?
    >> 
    >> > Thanks!
    >> 
    >> > -- Joachim BibleTime - the bible study program for KDE >
    >> http://www.bibletime.de/ info@bibletime.de
    >> 
    >> 
    >> --
    >> 
    >> best regards, Torsten Uhlmann
    >> 
    >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TUhlmann@gmx.de
    >> TUhlmann@debis.com
    >> 
    >> http://www.tuhlmann.purespace.de http://www.bibletime.de
    >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Wise men still seek him!
    > -- BibleTime - the bible study program for KDE
    > http://www.bibletime.de/ info@bibletime.de

-- 

best regards,
Torsten Uhlmann

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TUhlmann@gmx.de
TUhlmann@debis.com

http://www.tuhlmann.purespace.de
http://www.bibletime.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wise men still seek him!