Warning, /office/calligra/libs/main/DESIGN is written in an unsupported language. File is not indexed.

0001 -------------------------------------------------------------------------
0002 | This document answers some questions about how the startup of Calligra
0003 | applications works. This file was put together by
0004 | Eric R. Turner <eric.r.turner@bitbreather.com>
0005 | from the answers given by David Faure <faure@kde.org>
0006 -------------------------------------------------------------------------
0007 
0008 Q: Where is the pointer to the application's instance of KAboutData
0009 data stored?
0010 
0011 A: In a static member of the KCmdLineArgs class.
0012 
0013 
0014 
0015 Q: One of the arguments to KAboutData's constructor is the program
0016 name. Will this be used later to run the program?
0017 
0018 A: No (by the time the KAboutData's constructor is called, the program
0019 is already running). The program name is in fact the "instance name",
0020 which is used to locate the application's own data
0021 (/share/apps/<application name>/...) and many other things.
0022 
0023 
0024 
0025 Q: What is the "+[file]" option passed to KCmdLineArgs?
0026 
0027 A: KCmdLineOptions describe the KCmdLineArgs. "+[file]" means that the
0028 command line arguments can be one or more file names, and that these
0029 arguments are optional.
0030 
0031 
0032 
0033 Q: What is I18N_NOOP()?
0034 
0035 A: I18N_NOOP() marks the options description for translation to other
0036 languages.
0037 
0038 
0039 
0040 Q: What is a KoApplicationInterface used for?
0041 
0042 A: It allows a Calligra application to participate in Inter-Process
0043 Communication and Remote Procedure Calls via DCOP.
0044 
0045 
0046 
0047 Q: What is the .desktop file?
0048 
0049 A: It's responsible for the menu entry, standard KDE stuff. In Calligra
0050 we add a few useful tags to it, in particular the "native mime type"
0051 of the component (e.g. application/vnd.oasis.opendocument.text for words).
0052 
0053 
0054 
0055 Q: Is the .desktop file generated by hand?
0056 
0057 A: Yes.
0058 
0059 
0060 
0061 Q: What's a KoDocumentEntry? I couldn't find it in lib/calligracore.
0062 
0063 A: KoDocumentEntry describes a Calligra component (i.e. it's a
0064 representation in memory of the data contained in the .desktop
0065 file). It's in calligracore/koQueryTrader.h.
0066 
0067 
0068 
0069 Q: Is the show() method of KoMainWindow where the application actually
0070 appears to the user?
0071 
0072 A: Yes.
0073 
0074 
0075 
0076 Q: How does KoMainWindow->show() bring up the correct application (how
0077 does it know we want to show one app or another)?
0078 
0079 A: The KoMainWindow is the same for all. But KoDocumentEntry was
0080 created from specific application data, and koQueryTrader klopens the
0081 library containing this component. The very same mechanism is used to
0082 1) embed other components inside the app, 2) create any kind of
0083 calligra document, e.g. in koshell. All the Calligra applications are in
0084 fact very small wrappers that simply dlopen their own compnent - with
0085 the code in calligracore, which can also dlopen ANY component.
0086 
0087 
0088 
0089 Q: The KoApplication object doesn't store pointers to the KoDocument
0090 nd KoMainWindow objects. Do these objects communicate with each other
0091 later on, and if so, is that done through DCOP?
0092 
0093 A: The KoMainWindow knows about the KoDocument[s] inside it. The
0094 KoMainWindows are in a static linked list, if one really wants to
0095 iterateover all windows in the application, but this is rarely needed.
0096 
0097 
0098 Q: How does KoMainWindow relate to KoDocument and KoView?
0099 
0100 A: Calligra applications reimplement KoDocument and KoView. But the
0101 KoMainWindow is the same class for all, since it doesn't have any
0102 app-specific stuff. It's GUI, i.e. menus and toolbars, are provided by
0103 1) itself (the standard stuff like the File and Help menus), 2) the
0104 document's actions, and 3) the view's actions.
0105 
0106 
0107 
0108 Q: How do KoDocument and KoView relate to each other?
0109 
0110 A: KoDocument can have one or more KoViews, which allows the user to
0111 have multiple views of the same document. In a single KoMainWindow
0112 this might be accomplished using the "split view" feature. KoView[s]
0113 of the same document can be in separate KoMainWindow[s].